0
아래 document_1.xml
xslt를 사용하여 문서에서 정렬하는 방법?
<products>
<product>
<name>Pen</name>
<Quantity>30</Quantity>
</product>
<product>
<name>Pencil</name>
<Quantity>20</Quantity>
</product>
<product>
<name>Bag</name>
<Quantity>25</Quantity>
</product>
</products>
및 document_2.xml
입니다
<products>
<product>
<name>Pen</name>
<Quantity>10</Quantity>
</product>
<product>
<name>Pencil</name>
<Quantity>5</Quantity>
</product>
<product>
<name>Bag</name>
<Quantity>2</Quantity>
</product>
</products>
및 document.xml
아래는
<products>
</products>
내 XSL은이다, 나는 document.xml
document_1.xml
및
document_2.xml
에 가입하는 데 사용 51,515,
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/products">
<xsl:copy>
<xsl:apply-templates select="document('document_1.xml')/*/product"/>
<xsl:apply-templates select="document('document_2.xml')/*/product"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()">
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
난 수량 ASC로
- 아래 놓아 같은 출력을 필요
<products> <product> <name>Bag</name> <Quantity>2</Quantity> </product> <product> <name>Pencil</name> <Quantity>5</Quantity> </product> <product> <name>Pen</name> <Quantity>10</Quantity> </product> <product> <name>Pencil</name> <Quantity>20</Quantity> </product> <product> <name>Bag</name> <Quantity>25</Quantity> </product> <product> <name>Pen</name> <Quantity>30</Quantity> </product>
tks, 여기 내 xsl에 넣을 수 있습니까? – user475464
xsl : template ... xsl에 대해 많이 모른다면 - 간단한 응용 프로그램에서 먼저 배워보십시오. – SergeS