on 03-01-2012 5:50 PM
Hi experts,
I have an imported complex xsd in PI that acts as the target of my message mapping.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:osn="http://perfect.com/LiteEnvelope/xcbl" xmlns="rrn:org.xcbl:schemas/xcbl/v3_5/xcbl35.xsd" targetNamespace="rrn:org.xcbl:schemas/xcbl/v3_5/xcbl35.xsd" elementFormDefault="qualified" version="1.0">
<xs:include schemaLocation="schemas/Order.xsd" />
<xs:import namespace="http://perfect.com/LiteEnvelope/xcbl" schemaLocation="osnxcbl.xsd" />
<xs:element name="OSNOrder">
<xs:complexType>
<xs:sequence>
<xs:element name="Order" type="Order" />
<xs:element name="Envelope" type="osn:EnvelopeType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
When I process this mapping, the target xml-file says, after the xml begin tag
<OSNChangeOrder xmlns="rrn:org.xcbl:schemas/xcbl/v3_5/xcbl35.xsd">
I want the namespace to include all the :xs and :osn namespaces as well, like
<OSNChangeOrder xmlns="rrn:org.xcbl:schemas/xcbl/v3_5/xcbl35.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osn="http://perfect.com/LiteEnvelope/xcbl" xsi:schemaLocation="rrn:org.xcbl:schemas/xcbl/v3_5/xcbl35.xsd osnxcbl35.xsd">
I assume that the file I get have the namespace assigned as targetNamespace.
My question: Can I fix the target namespace so that it includes all of what I want, like in the second example? If so, how do I do it? Do I have to use XSLT?
kind regards,
Glenn
Hi all,
Are there no other ways to achieve this than xslt? Can't I do something to the imported xsd file? Are PI limited to one namespace if I do not use xslt mapping?
regards,
Glenn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>I want the namespace to include all the :xs and :osn namespaces as well, like
You basically want to add namespace prefix. This can be done using XMLAnonymizerBean module.
refer this link
http://help.sap.com/saphelp_nw04/helpdata/en/45/d169186a29570ae10000000a114a6b/content.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glenn,
You can try with XSLT.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="OSNChangeOrder">
<xsl:element name="{name()}" namespace="rrn:org.xcbl:schemas/xcbl/v3_5/xcbl35.xsd">
<xsl:attribute name="xsi:schemaLocation">osnxcbl35.xsd
</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="OSNChangeOrder">
<xsl:element name="{name()}" namespace="http://perfect.com/LiteEnvelope/xcbl">
<xsl:attribute name="osn:schemaLocation">osnxcbl.xsd
</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
I havent tested....just try from your side...and modify for your requirement.
Thanks
Ray..
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.