Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Generating xml document at runtime based on a xml schema (using c#)

$
0
0

Hi,

I have to generate following xml document at runtime.

<?xml version="1.0" encoding="utf-8" ?>
< Information>
  <FirstName>Sean</FirstName>
  <Last>Jone</Last>
  <Age>30</Age>
  <Gender>Male</Gender>
  <Left>
    <China>
      <Panjab Fine="True">20</Panjab>
      <Lahore Fine="False">30</Lahore>
    </China>
    <Arab>
      <ABC Fine="False">20</ABC>
      <XYZ Fine="Trye">30</XYZ>
      </Arab>
  </Left>
   <Right>
    <Pakistan>
      <Panjab Fine="True">20</Panjab>
      <Lahore Fine="False">30</Lahore>
    </Pakistan>
    <Arab>
      <ABC Fine="False">20</ABC>
      <XYZ Fine="Trye">30</XYZ>
      </Arab>
  </Right>
< /Information>

I can generate it at runtime using xDocument and xElement. But what I do not know is what will
be its schema. And if suppose I have wriiten the schema (which will be xsd file), how shall I tell
that it is based on the given schema?

Can someone please help?

Thanks.


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>