on 11-04-2014 11:32 AM
Hi
My client expecting output like below
<Data>
<DataInfo>
<OwnerOrganization Code="123"/>
</DataInfo>
<Details>
<Type>
<BusinessUnitGroups>
<BusinessUnitGroup>
<Code Code="Zzz"/>
<Description> vvvvvv</Description>
<Parent Code>”123"/>
</BusinessUnitGroup>
<BusinessUnitGroup>
<Code Code="xxxxxx"/>
<Description>XXXXXXXXX</Description>
<Parent Code>"xxxxxx"/>
</BusinessUnitGroup>
</BusinessUnitGroups>
</Type>
<Type>
<Stores>
<Store>
<Code Code="11111"/>
<Description>xxxx</Description>
<Parent Code>=”DIST1”/>
</Store>
<Store>
<Code Code="0011"/>
<Description>Store 11</Description>
<Parent Code=”DIST1”/>
</Store>
</Stores>
</Type>
</Details>
</Data>
My Question is. can we create this kind of sturcture manually in PI7.0? if its possible how can we create "Code Code" field in in pi
Thanks,
Bhanu
if
Hi Azhar,
Thanks for your replying .But here Field name like that "Code Code".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to add - Here i don't think the element name is "Code Code" as an element cannot have spaces in it.
So as already suggested create the Code as an attribute to get the desired xml output
XML elements must follow these naming rules:
Reference : XML Elements
Hi,
There are a lot of tools that generates a XSD from the XML.
For example from XMLSPY and your XML i generated the next XSD:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="BusinessUnitGroup">
<xs:complexType>
<xs:sequence>
<xs:element ref="Code"/>
<xs:element ref="Description"/>
<xs:element ref="Parent"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BusinessUnitGroups">
<xs:complexType>
<xs:sequence>
<xs:element ref="BusinessUnitGroup" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Code">
<xs:complexType>
<xs:attribute name="Code" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Data">
<xs:complexType>
<xs:sequence>
<xs:element ref="DataInfo"/>
<xs:element ref="Details"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DataInfo">
<xs:complexType>
<xs:sequence>
<xs:element ref="OwnerOrganization"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Description">
<xs:simpleType>
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Details">
<xs:complexType>
<xs:sequence>
<xs:element ref="Type" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="OwnerOrganization">
<xs:complexType>
<xs:attribute name="Code" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Parent">
<xs:complexType>
<xs:attribute name="Code" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Store">
<xs:complexType>
<xs:sequence>
<xs:element ref="Code"/>
<xs:element ref="Description"/>
<xs:element ref="Parent"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Stores">
<xs:complexType>
<xs:sequence>
<xs:element ref="Store" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Type">
<xs:complexType>
<xs:choice>
<xs:element ref="BusinessUnitGroups"/>
<xs:element ref="Stores"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhanu,
You can add Code as an Attribute under the Element that you want while defining the Data Type in ESR. It will create the require tag for you.
Regards,
Azhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.