2011-09-20 3 views
5

XSLT는 매우 강력한 도구이지만 사용하면 고통 스러울 수 있습니다 ... zencoding도 있습니다. xslt로 컴파일되고 사용 및 지원이 더 간단 해지는 언어가 있습니까?

는 대략 나는 XSLT를위한 커피 스크립트, 당신은 XMLStarlet을 확인 할 수 있습니다

<xsl:call-template name="test"> 
    <xsl:with-param select="'oof'" name="foo"></xsl:with-param> 
    <xsl:with-param select="2" name="bar"></xsl:with-param> 
</xsl:call-template> 

<xsl:template name="test"> 
    <xsl:param select="'foo'" name="foo" /> 
    <xsl:param select="1" name="bar" /> 
    <p><xsl:value-of select="$foo" />, <xsl:value-of select="$bar" /></p> 
</xsl:template> 

이나 뭐 ...

+0

생성합니다 : 예를 들어

XSLT 언어. 이러한 도구를 사용하는 것보다 훨씬 좋은 점은 XSelerator, Visual Studio 또는 oXygen과 같은 훌륭한 XSLT IDE를 사용하는 것입니다. –

+0

스키마 기반 코드 완성과 함께 편집기를 사용하십시오. 예를 들어, Visual Studio에서''과 같이 '

+0

물론 "XSLT의 의미와 기능"을 그대로 유지하는 도구를 말합니다. 이러한 IDE는 xsl을 만드는 데 적합하지만 작업하는 동안 여전히 많은 코드를보고 편집 할 수 있습니다. – installero

답변

1

에 예를

template test 
    params = {:foo => 'foo', :bar => 1} 
    <p>$foo, $bar</p> 
end 

call test :foo => 'oof', :bar => 2 

에 대한 컴파일 뭔가를 원한다.

XSL 템플릿을 생성하는 데 도움이 될 수 있습니다.

xml sel -C -t -c "xpath0" -m "xpath1" -m "xpath2" -v "xpath3" -t -m "xpath4" -c "xpath5" 

가이 전달된다는 보장은 없으며, 전체 의미와 기능을 유지하기 때문에 강력하게 그러한 ""도구를 방지하기 위해 추천 할 것입니다

<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
    <xsl:output omit-xml-declaration="yes" indent="no"/> 
    <xsl:template match="/"> 
    <xsl:call-template name="t1"/> 
    <xsl:call-template name="t2"/> 
    </xsl:template> 
    <xsl:template name="t1"> 
    <xsl:copy-of select="xpath0"/> 
    <xsl:for-each select="xpath1"> 
     <xsl:for-each select="xpath2"> 
     <xsl:value-of select="xpath3"/> 
     </xsl:for-each> 
    </xsl:for-each> 
    </xsl:template> 
    <xsl:template name="t2"> 
    <xsl:for-each select="xpath4"> 
     <xsl:copy-of select="xpath5"/> 
    </xsl:for-each> 
    </xsl:template> 
</xsl:stylesheet> 
관련 문제