xslt ... 의 변환에 약간 문제가있어 그 작은 문제는 내가 생각하지만 인터넷에서 솔루션을 찾을 수 없습니다. xml 노드에서 숫자 또는 날짜를 선택하려고하면 다른 XML에 표시 할 수 없습니다. 이것은 원래의 코드 1.0XML에서 XML로 XSLT 번호
내가 XSLT 버전을 사용하고 =
<?xml version="1.0" encoding="utf-8"?>
<ALL_Machines_having_buttons_from_a_Machintype_price_greater9700>
<GreaterTypes>
<typename>Grant and Sons</typename>
<price>984912.41</price>
<serialnumber>7</serialnumber>
<outputrate>5</outputrate>
<purchasebillxml>
<purchasebill>
<billnumber>345-20-2422</billnumber>
<seller>
<id>Nienow-Daugherty</id>
</seller>
<product>
<articlenumber>172185964-0</articlenumber>
<amount>50359</amount>
<price>676833.08</price>
</product>
<date>2004-01-28</date>
</purchasebill>
</purchasebillxml>
<buttonsname>595027529-2</buttonsname>
<colour>Khaki</colour>
</GreaterTypes>
</ALL_Machines_having_buttons_from_a_Machintype_price_greater9700>
XSL :
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="/ALL_Machines_having_buttons_from_a_Machintype_price_greater9700">
<humans>
<xsl:for-each select="GreaterTypes">
<human>
<firstName><xsl:value-of select="typename"/></firstName>
<livingyears><xsl:value-of select="amount"/></livingyears>
<alifesince><xsl:value-of select="date"/></alifesince>
</human>
</xsl:for-each>
</humans>
</xsl:template>
</xsl:stylesheet>
내가 무엇을 얻을 :
<humans>
<human>
<firstName>Grant and Sons</firstName>
<livingyears/>
<alifesince/>
</human>
</humans>
귀하의 XSLT 코드가 작동하지 않는이 XSLT를 사용해보십시오. 먼저을 제거해야합니다. 그러면 예상대로 작동합니다. –
Gerriet
당신은 내가 문제를 보았던 바로 ...이게 내 문제를 설명하기 위해 만든 예제입니다 ... 어떻게 든 제 원래 파일에서 작동하지 않습니다. (나는 왜 그런지 알지 못합니다. –
예제를 간소화하는 것이 좋습니다. 가능하지만 그 문제는 여전히 관심있는 문제를 복제한다는 것을 의미합니다. 이제는 문제가 다시 나타날 때까지 작동하는 단순화 기능이 있으며 원래 부분에 추가 할 수 있습니다. – Gerriet