XPath question-urgent help required

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I got a program source code from my client which I need to understand and implement the same in C#.
The client is using VC++ with XML. The requirement is , we have an XSD file , we need to transform the data from our c# object to xml document
which will be complaining to the schema.
The client is generating xml from xsd file as shown below.
XSD content
<xsd:element name="Employee
..............
.............
</xsd:element>
XML content which he is generating from XSD.
<Data>
<span style="white-space:pre <DataHeirarchy>
<span style="white-space:pre <Element Name="Employee" MinOccurs=""<span style="white-space:pre
MaxOccurs=""<span style="white-space:pre Type=""<span style="white-space:pre
XPath="Employee" >
<span style="white-space:pre <Element<span style="white-space:pre
Name="EmployeeHeader" <span style="white-space:pre MinOccurs="" MaxOccurs=""<span style="white-space:pre
Type=""<span style="white-space:pre XPath="Employee/EmployeeHeader
<span style="white-space:pre <Element<span style="white-space:pre
Name="FirstName" <span style="white-space:pre MinOccurs="" MaxOccurs=""
<span style="white-space:pre Type="PersonNameType" <span style="white-space:pre
XPath="Employee/EmployeeHeader/FirstName"<span style="white-space:pre
Pattern="Some pattn..." />
<span style="white-space:pre <Element<span style="white-space:pre
Name="LastName" <span style="white-space:pre MinOccurs="" MaxOccurs=""
<span style="white-space:pre Type="PersonNameType" <span style="white-space:pre
XPath="Employee/EmployeeHeader/LastName"<span style="white-space:pre
Pattern="Some pattn..." />
<span style="white-space:pre </Element>
<span style="white-space:pre </Element>
<span style="white-space:pre </DataHeirarchy>
<span style="white-space:pre <IndividualSequence>
<span style="white-space:pre <XPathsInOrder
<span style="white-space:pre MainFormXPath="Employee/Permanent
<span style="white-space:pre <XPath>Employee</XPath>
<span style="white-space:pre <XPath>Employee/EmployeeHeader</XPath>
<span style="white-space:pre <XPath>Employee/EmployeeHeader/FirstName</XPath>
<span style="white-space:pre <XPath>Employee/EmployeeHeader/LastName</XPath>
<span style="white-space:pre ...
<span style="white-space:pre </XPathsInOrder>
<span style="white-space:pre <XPathsInOrder
<span style="white-space:pre MainFormXPath="Employee/Contract
<span style="white-space:pre <XPath>Employee</XPath>
<span style="white-space:pre <XPath>Employee/EmployeeHeader</XPath>
<span style="white-space:pre <XPath>Employee/EmployeeHeader/FirstName</XPath>
<span style="white-space:pre <XPath>Employee/EmployeeHeader/LastName</XPath>
<span style="white-space:pre ...
<span style="white-space:pre </XPathsInOrder>
<span style="white-space:pre </IndividualSequence>
</Data>

He developed a mapping utility which uses this xml and he uses this xml for tranformation as well.
I am not able to understand why he is generating a structure like above and how this strcuture ca be used for tranforming the C# objectdata to xml file



Any help on this is highly appreciated.
Thanks

<hr class="sig Thanks,Hari

View the full article
 
Back
Top