XML Repetitive Elements
Posted: Tue Jul 13, 2010 12:36 pm
I have been going through the XML posts here, but not able to find an appropriate solution.
Here is my issue.
I have a Material(Parent) and its corresponding Plants, Sales Orgs, likewise 3 more children for every material.
The business requirement is that an MQ Message should contain a Material and all its children in single message. As of now, the job is working and sending multiple messages.
Here is the Job Design:
Dataset-->Lkp-->RemoveDups-->Transformer-->XML-->MQ
As per the XML Guide I mentioned the Child IDs as Keys and removed Material as Key in the XML OutPut stage.
Here is the sample XSD.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="MATERIAL" type="MaterialType"/>
<xsd:complexType name="MaterialType">
<xsd:sequence>
<xsd:element name="MATERIAL_NO" type="xsd:string"/>
<xsd:element name="FIELD1" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="FIELD2" type="xsd:string" minOccurs="0"/>
<xsd:element name="FIELD3" type="xsd:double" minOccurs="0"/>
<xsd:element name="FIELD4" type="xsd:dateTime" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="MaterialAlternateUomType">
<xsd:sequence>
<xsd:element name="ALT_UOM_CD" type="xsd:string"/>
<xsd:element name="FIELD1" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="FIELD2" type="xsd:string" minOccurs="0"/>
<xsd:element name="FIELD3" type="xsd:double" minOccurs="0"/>
<xsd:element name="FIELD4" type="xsd:dateTime" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
But No luck so far, I even tried Parent Key as Trigger Column, with an assumption of its change will trigger a new file, but it did not work either.
Thanks for looking into this.
Here is my issue.
I have a Material(Parent) and its corresponding Plants, Sales Orgs, likewise 3 more children for every material.
The business requirement is that an MQ Message should contain a Material and all its children in single message. As of now, the job is working and sending multiple messages.
Here is the Job Design:
Dataset-->Lkp-->RemoveDups-->Transformer-->XML-->MQ
As per the XML Guide I mentioned the Child IDs as Keys and removed Material as Key in the XML OutPut stage.
Here is the sample XSD.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="MATERIAL" type="MaterialType"/>
<xsd:complexType name="MaterialType">
<xsd:sequence>
<xsd:element name="MATERIAL_NO" type="xsd:string"/>
<xsd:element name="FIELD1" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="FIELD2" type="xsd:string" minOccurs="0"/>
<xsd:element name="FIELD3" type="xsd:double" minOccurs="0"/>
<xsd:element name="FIELD4" type="xsd:dateTime" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="MaterialAlternateUomType">
<xsd:sequence>
<xsd:element name="ALT_UOM_CD" type="xsd:string"/>
<xsd:element name="FIELD1" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="FIELD2" type="xsd:string" minOccurs="0"/>
<xsd:element name="FIELD3" type="xsd:double" minOccurs="0"/>
<xsd:element name="FIELD4" type="xsd:dateTime" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
But No luck so far, I even tried Parent Key as Trigger Column, with an assumption of its change will trigger a new file, but it did not work either.
Thanks for looking into this.