on 03-23-2011 6:59 AM
Hi Experts,
Could you please help me in creation of the XSD so that the output file from PI will contain the following message:
Message xmlns="http://www.abc.com/schemas/" xmlns:xsi="http://www.w3.org/Schema-instance" xsi_schemaLocation="http://www.abc.com/schemas/ http://www.abc.com/schemas/4.0.0/2001/message.xsd"; >
Hello,
You need to use Java Mapping or XSLT Mapping to append
xmlns="http://www.abc.com/schemas/" xmlns:xsi="http://www.w3.org/Schema-instance" xsi_schemaLocation="http://www.abc.com/schemas/ http://www.abc.com/schemas/4.0.0/2001/message.xsd"
to the field Message.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
As i said my requirement is to include the following in the output XML.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation =="http://www.XYZ.com/schemas/ http://www.XYZ.com/schemas/4.0.0/2001/message.xsd">
i have written the XSD as below
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.XYZ.com/schemas/"
xmlns="http://www.XYZ.com/schemas/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:schemaLocation="http://www.XYZ.com/schemas/ http://www.XYZ.com/schemas/4.0.0/2001/message.xsd">
<xsd:element name="Message" type="Message" />
<xsd:complexType name="Message">
<xsd:sequence>
<xsd:element name="Head">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="field1">
<xsd:complexType>
<xsd:attribute name="Id" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
but when the correponding XML from this XSD donot have the
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation =="http://www.XYZ.com/schemas/ http://www.XYZ.com/schemas/4.0.0/2001/message.xsd">
Any clue , how to handle this.
Hello,
Yup, I stick with my previous answer. This is possible to achieve via Java mapping or XSLT mapping. Your requirement is almost similar to importing the xsds from gs1.org. Even though there are multiple namespaces declared in the xsd, only the targetNamespace is appearing.
I have not tried using the XMLAnonymizer Bean for adding namespaces. Let us wait for the replies of others
Hope this helps,
Mark
Hi,
this is not easy to handle with creating a XML schema for exteranl message type and a message mapping.
A XSL stylesheet would be much easier, you dont need an exact data type (use a data type with a dummy field).
Just write down the target message as you like it, exaclty with that strange namespaces and attributes and add the field values dynamicly with xsl:value-of. For repeating fields use xsl:for-each.
Regards,
Udo
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.