2
다음 XML을 내가 만든 XSLT 스타일 시트를 사용하여 다른 XML 문서로 변환하려고 시도했습니다. 출력물이 내가 원하는 것을 제공하지 않는다. 출력은 올바른 XML 노드가 아니며 태그를 출력하지도 않는다.XSLT를 정의하여 XML을 XML로 변환
누군가 도와 드릴 수 있습니다. 변환 할
XML 파일은 다음과 같습니다
이<?xml version="1.0" encoding="utf-8"?>
<Extract xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Header>
<SubscriptionName>Auto_Clients</SubscriptionName>
<SubscriptionID>1731</SubscriptionID>
<ExecutionID>11987</ExecutionID>
<ODIFeed>Clients</ODIFeed>
<DataDateTime>2013-07-22T13:53:49</DataDateTime>
<FirmCodes>
<FirmCode>ZR</FirmCode>
</FirmCodes>
<Environment>INTEGRATION</Environment>
<NoOfRecords>1</NoOfRecords>
</Header>
<Clients>
<Client>
<FirmCode>ZR</FirmCode>
<ClientReference>ZR1071049</ClientReference>
<ClientType>02</ClientType>
<ShortName>ZRTEST</ShortName>
<FullName>CLTTEST</FullName>
</Client>
</Clients>
</Extract>
내가 만든 XSLT 스타일 시트이
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="table">
<Clients>
<xsl:for-each select="Client">
<Client>
<FirmCode>
<xsl:value-of select="FirmCode" />
</FirmCode>
<ClientReference>
<xsl:value-of select="ClientReference" />
</ClientReference>
<ClientType>
<xsl:value-of select="ClientType" />
</ClientType>
<ShortName>
<xsl:value-of select="ShortName" />
</ShortName>
<FullName>
<xsl:value-of select="FullName" />
</FullName>
</Client>
</xsl:for-each>
</Clients>
</xsl:template>
</xsl:stylesheet>
내 원하는 출력 뭔가 같은 :
<Clients>
<Client>
<FirmCode>ZR</FirmCode>
<ClientReference>ZR1071049</ClientReference>
<FullName>CLTTEST</FullName>
</Client>
</Clients>
출력을 변경하지 않았습니다. 어떤 이유로 출력이 텍스트이고, 모든 노드 데이터가 출력되는 노드뿐 아니라 관심있는 노드도 출력됩니다. 또한 태그도 출력되지 않습니다. – DBoyDev
@DBoyDev 여기서 볼 수 있습니다. http://xsltransform.net/naZXpWx –
아니요, 문제는 다른 것입니다. http://stackoverflow.com/questions/34758492/xslt-transform-doesnt-work- until-i-remove-root-node/34762628 # 34762628 –