Hi all,
I have a problem with XSL policy. This policy is default created when i create WSL proxy and this add the namespace in the payload. The name space is correct an other nodes but when one node has attributes this policy convert attributes in other node.
This is XSL policy.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://schema.com.poc" version="1.0"> <xsl:output encoding="utf-8" indent="yes" method="xml" omit-xml-declaration="yes"/> <!-- Stylesheet to inject namespaces into a document in specific places --> <xsl:template match="/"> <soapenv:Envelope> <soapenv:Header/> <soapenv:Body> <xsl:choose> <!-- Handle 'Root' wrapper added by JSON to XML policy --> <xsl:when test="normalize-space(/Root)"> <sch:pocSync> <xsl:apply-templates select="node()|@*"/> </sch:pocSync> </xsl:when> <!-- Handle 'Array' wrapper added by JSON to XML policy --> <xsl:when test="normalize-space(/Array)"> <sch:pocSync> <xsl:apply-templates select="node()|@*"/> </sch:pocSync> </xsl:when> <!-- If the root element is not what was in the schema, add it --> <xsl:when test="not(normalize-space(/pocSync))"> <sch:pocSync> <xsl:apply-templates select="node()|@*"/> </sch:pocSync> </xsl:when> <!-- everything checks out, just copy the xml--> <xsl:otherwise> <xsl:apply-templates select="node()|@*"/> </xsl:otherwise> </xsl:choose> </soapenv:Body> </soapenv:Envelope> </xsl:template> <xsl:template match="/Root/*" name="copy-root"> <xsl:element name="sch:{local-name()}"> <xsl:copy-of select="namespace::*"/> <xsl:apply-templates select="node()|@*"/> </xsl:element> </xsl:template> <xsl:template match="/Array/*" name="copy-array"> <xsl:element name="sch:{local-name()}"> <xsl:copy-of select="namespace::*"/> <xsl:apply-templates select="node()|@*"/> </xsl:element> </xsl:template> <xsl:template match="*[not(local-name()='Root') and not(local-name()='Array')]" name="copy-all"> <xsl:element name="{local-name()}"> <xsl:copy-of select="namespace::*"/> <xsl:apply-templates select="node()|@*"/> </xsl:element> </xsl:template> <!-- template to copy the rest of the nodes --> <xsl:template match="comment() | processing-instruction()"> <xsl:copy/> </xsl:template> </xsl:stylesheet>
Thanks.
Regards.