I know very little about xslt.
Here's my .xslt that transforms xml doc A into xml doc B:
If my xml doc A contains a xmlns declaration:
The xml doc B is not created right - it's missing the whole OrderCreate section:
If I omit the xmlns declaration:
the xml doc B does contain the 'OrderCreate' section.
It looks to me that the reason for that is the transform stylesheet is not finding a match on 'OrderCreate'. What can I do to fix that? Thank you.
Here's my .xslt that transforms xml doc A into xml doc B:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:output version="1.0" encoding="UTF-8" indent="yes" method="xml" omit-xml-declaration="no"/>
<xsl:template match="/">
<dXML>
<RemoteUser>
<UserLogin>admin</UserLogin>
<UserAuthenticator>admin</UserAuthenticator>
</RemoteUser>
<xsl:apply-templates select="OrderCreate"/>
</dXML>
</xsl:template>
<xsl:template match="OrderCreate">
...
</xsl:template>
</xsl:stylesheet>
If my xml doc A contains a xmlns declaration:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<OrderCreate xmlns="urn:cidx:names:DRAFT_0012:ces:schema:all:5:0" Version="5.0">
...
</OrderCreate>
The xml doc B is not created right - it's missing the whole OrderCreate section:
Code:
<dXML>
<RemoteUser>
<UserLogin>admin</UserLogin>
<UserAuthenticator>admin</UserAuthenticator>
</RemoteUser>
</dXML>
If I omit the xmlns declaration:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<OrderCreate Version="5.0">
...
</OrderCreate>
the xml doc B does contain the 'OrderCreate' section.
It looks to me that the reason for that is the transform stylesheet is not finding a match on 'OrderCreate'. What can I do to fix that? Thank you.