Jump to content

Xsd Schema To Xml File Generation Using C#


Recommended Posts

Posted

Hi,

I need small help with my current scenario.

I have 2 xsd schemas one is input and other is output.

Now my requirement is based on those xsd template or structure, i need to write a C# code that takes the 1 xsd template as input in xml format and then do some mapping and then set that values to 2 xsd template in xml format.

Can you please guide or assist in this regards ??

It would be helpful if we have the flexibility of configuring the schema properties.

Posted

XSD ni C# class ga convert cheyyaniki you can use Built-in schema definition tool (XSD.exe) bhayya. 

 

 

Once you have the classes for both input and output XSD. you can use  XML serialization in .net framework to do the rest. 

 

 

Posted

XSD ni C# class ga convert cheyyaniki you can use Built-in schema definition tool (XSD.exe) bhayya. 

 

 

Once you have the classes for both input and output XSD. you can use  XML serialization in .net framework to do the rest. 

ok....so youre saying that 2 convert both of them into clasess and hen map the fields correct....

 

for some reason , whie i try to convert the xsd using the tool i am getting error and they are failing while classes are to be created...

these are vendor product...

 

ok thanks bhaya.......will try to solve that error.....

 

i will wait for other options

Posted

ok....so youre saying that 2 convert both of them into clasess and hen map the fields correct....

 

for some reason , whie i try to convert the xsd using the tool i am getting error and they are failing while classes are to be created...

these are vendor product...

 

ok thanks bhaya.......will try to solve that error.....

 

i will wait for other options

 

 

Em error vasthundi classes create chesthunte. PM cheyyi  bhayya if you want. 

Posted

Em error vasthundi classes create chesthunte. PM cheyyi  bhayya if you want. 

actually it has dependency other xsd files and while giving the command i havent mentioned them....

so i will try to give all the xsd schemas and try o convert and see if that was causing error....

if not i will pm u error...

 

thanks dude

Posted

actually it has dependency other xsd files and while giving the command i havent mentioned them....

so i will try to give all the xsd schemas and try o convert and see if that was causing error....

if not i will pm u error...

 

thanks dude

 

np bhayya.  S%Hi

  • 2 weeks later...
Posted

np bhayya.  S%Hi

hey dude...now i am stuck with this issue....

 

maa lead xsd schemas nunche he want to mapping by using configuration...

right now

 

option 1: i am taking those xsd schemas of source and target and generated classes respectively...
              He wants the mapping to be in the config rather than coding..I found the below link that meets my criteria.
              But it has a limitation.. refer to the below url .... in the complex type, if it has 2 properties (Bar class) when we try to assign                       value, each time a new instance is created and previous value is null.

http://stackoverflow.com/questions/19179459/how-to-define-automapper-mapping-outside-code-i-e-in-a-xml-file-or-use-differen/28752582?noredirect=1#comment45790803_28752582

 

Any Ideas or suggestions ???

 

Option 2: he wants to use Xpath query concept to read the each value from xml file or xml object itself....

any samples u can sharee.....

 

 

anybody pls guide..

Posted

poseidon uncle..

 

 

poseidon ankul pakka thrd lo sql dbt lu aduguthunnaduuu....

Posted

actually it has dependency other xsd files and while giving the command i havent mentioned them....

so i will try to give all the xsd schemas and try o convert and see if that was causing error....

if not i will pm u error...

 

thanks dude

PM me too.. 

Posted

ch.gifuse tibco

Happy ga XSLT Activity use chesukuntaam kadha manam.. sunil3.gif

×
×
  • Create New...