EDN Admin
Well-known member
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-spacere <DataHeirarchy>
<span style="white-spacere <Element Name="Employee" MinOccurs=""<span style="white-spacere
MaxOccurs=""<span style="white-spacere Type=""<span style="white-spacere
XPath="Employee" >
<span style="white-spacere <Element<span style="white-spacere
Name="EmployeeHeader" <span style="white-spacere MinOccurs="" MaxOccurs=""<span style="white-spacere
Type=""<span style="white-spacere XPath="Employee/EmployeeHeader
<span style="white-spacere <Element<span style="white-spacere
Name="FirstName" <span style="white-spacere MinOccurs="" MaxOccurs=""
<span style="white-spacere Type="PersonNameType" <span style="white-spacere
XPath="Employee/EmployeeHeader/FirstName"<span style="white-spacere
Pattern="Some pattn..." />
<span style="white-spacere <Element<span style="white-spacere
Name="LastName" <span style="white-spacere MinOccurs="" MaxOccurs=""
<span style="white-spacere Type="PersonNameType" <span style="white-spacere
XPath="Employee/EmployeeHeader/LastName"<span style="white-spacere
Pattern="Some pattn..." />
<span style="white-spacere </Element>
<span style="white-spacere </Element>
<span style="white-spacere </DataHeirarchy>
<span style="white-spacere <IndividualSequence>
<span style="white-spacere <XPathsInOrder
<span style="white-spacere MainFormXPath="Employee/Permanent
<span style="white-spacere <XPath>Employee</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/FirstName</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/LastName</XPath>
<span style="white-spacere ...
<span style="white-spacere </XPathsInOrder>
<span style="white-spacere <XPathsInOrder
<span style="white-spacere MainFormXPath="Employee/Contract
<span style="white-spacere <XPath>Employee</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/FirstName</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/LastName</XPath>
<span style="white-spacere ...
<span style="white-spacere </XPathsInOrder>
<span style="white-spacere </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
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-spacere <DataHeirarchy>
<span style="white-spacere <Element Name="Employee" MinOccurs=""<span style="white-spacere
MaxOccurs=""<span style="white-spacere Type=""<span style="white-spacere
XPath="Employee" >
<span style="white-spacere <Element<span style="white-spacere
Name="EmployeeHeader" <span style="white-spacere MinOccurs="" MaxOccurs=""<span style="white-spacere
Type=""<span style="white-spacere XPath="Employee/EmployeeHeader
<span style="white-spacere <Element<span style="white-spacere
Name="FirstName" <span style="white-spacere MinOccurs="" MaxOccurs=""
<span style="white-spacere Type="PersonNameType" <span style="white-spacere
XPath="Employee/EmployeeHeader/FirstName"<span style="white-spacere
Pattern="Some pattn..." />
<span style="white-spacere <Element<span style="white-spacere
Name="LastName" <span style="white-spacere MinOccurs="" MaxOccurs=""
<span style="white-spacere Type="PersonNameType" <span style="white-spacere
XPath="Employee/EmployeeHeader/LastName"<span style="white-spacere
Pattern="Some pattn..." />
<span style="white-spacere </Element>
<span style="white-spacere </Element>
<span style="white-spacere </DataHeirarchy>
<span style="white-spacere <IndividualSequence>
<span style="white-spacere <XPathsInOrder
<span style="white-spacere MainFormXPath="Employee/Permanent
<span style="white-spacere <XPath>Employee</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/FirstName</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/LastName</XPath>
<span style="white-spacere ...
<span style="white-spacere </XPathsInOrder>
<span style="white-spacere <XPathsInOrder
<span style="white-spacere MainFormXPath="Employee/Contract
<span style="white-spacere <XPath>Employee</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/FirstName</XPath>
<span style="white-spacere <XPath>Employee/EmployeeHeader/LastName</XPath>
<span style="white-spacere ...
<span style="white-spacere </XPathsInOrder>
<span style="white-spacere </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