1
<Rs xmlns="http://tempuri.org/schemas">
문서 노드의 나머지 부분을 복사하는 모든 동안 함께 최초의 RS 노드를 내 문서에 비누 헤더를 추가하고 업데이트하기 위해 노력하고있어 복사합니다. 내 실제 예제에서 RS 부모 노드 내에서 더 많은 노드를 갖게 될 것이므로 나는 일종의 완전한 복사본을 가진 솔루션을 찾고있다.
<-- this is the data which needs transforming -->
<Rs>
<ID>934</ID>
<Dt>995116</Dt>
<Date>090717180408</Date>
<Code>9349</Code>
<Status>000</Status>
</Rs>
<-- Desired Result -->
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<Rs xmlns="http://tempuri.org/schemas">
<ID>934</ID>
<Dt>090717180408</Dt>
<Code>9349</Code>
<Status>000</Status>
</Rs>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<-- this is my StyleSheet. it's not well formed so i can't exexute it-->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/">
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<xsl:apply-templates select = "Rs">
</xsl:apply-templates>
<xsl:copy-of select="*"/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</xsl:template>
<xsl:template match ="Rs">
<Rs xmlns="http://tempuri.org/schemas">
</xsl:template>
</xsl:stylesheet>
저는 튜토리얼을 읽었지만 템플리트를 고민하고 구현할 때 문제가 있습니다.
XSL은 사소하지 않습니다. 내가 너라면 좀 더 간단하게 시작할거야. –