Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / January 2008

Tip: Looking for answers? Try searching our database.

Create XSD (or something else) from XML to validate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Moncholv - 16 Jan 2008 13:01 GMT
Hello everybody, here is my question (sorry for my english)

I know I am going to receive some xml´s. I know the structure they are
going to have.
As an example:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
       <gi-test xmlns="urn:pm_interfaz_soap2">
            <cod-user xmlns="">TESTUSER</cod-user>
            <tex-pass xmlns="">TESTPASS</tex-pass>
            <cod-action xmlns="">pupporttest</cod-action>
            <cod-issue xmlns="">6001-000200880</cod-issue>
            <typ-associate xmlns="">P</typ-associate>
            <tex-associate xmlns=""></tex-associate>
            <fec-action xmlns="">11/01/2008 12:21:00</fec-action>
            <lst-options xmlns="">
                <item xsi:type="xsd:string">test1</item>
                <item xsi:type="xsd:string">test2</item>
            </lst-options>
            <tex-issue xmlns="">Issue test type P</tex-issue>
        </gi-test>
    </soapenv:Body>
</soapenv:Envelope>

How can I validate future xmls I will receive, knowing they will need
to have the structure of the above xml?

I think I should generate an XSD, DTD or something similar from the
above xml, and then validate the future xml I will receive.

If this is correct (not really sure), another issue is that I will not
have those xml in a file, and all I have found for validating xml need
to have the xml in a file.
Another problem, is that I can not modify those xmls so they will not
be linked to the xsd to which they will need to be validated.

How could this be done??

I don´t know if I have explained well, but thanks in advance for any
help.

Greetings.
Harshal - 19 Jan 2008 07:15 GMT
Moncholv, you can use Xsd.exe
(http://msdn2.microsoft.com/en-us/library/x6c1kb0s(VS.80).aspx) to generate
schema from Xml.
Not sure about rest.

Thanks,
Harshal

Hello everybody, here is my question (sorry for my english)

I know I am going to receive some xml´s. I know the structure they are
going to have.
As an example:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
   <gi-test xmlns="urn:pm_interfaz_soap2">
<cod-user xmlns="">TESTUSER</cod-user>
<tex-pass xmlns="">TESTPASS</tex-pass>
<cod-action xmlns="">pupporttest</cod-action>
<cod-issue xmlns="">6001-000200880</cod-issue>
<typ-associate xmlns="">P</typ-associate>
<tex-associate xmlns=""></tex-associate>
<fec-action xmlns="">11/01/2008 12:21:00</fec-action>
<lst-options xmlns="">
<item xsi:type="xsd:string">test1</item>
<item xsi:type="xsd:string">test2</item>
</lst-options>
<tex-issue xmlns="">Issue test type P</tex-issue>
</gi-test>
</soapenv:Body>
</soapenv:Envelope>

How can I validate future xmls I will receive, knowing they will need
to have the structure of the above xml?

I think I should generate an XSD, DTD or something similar from the
above xml, and then validate the future xml I will receive.

If this is correct (not really sure), another issue is that I will not
have those xml in a file, and all I have found for validating xml need
to have the xml in a file.
Another problem, is that I can not modify those xmls so they will not
be linked to the xsd to which they will need to be validated.

How could this be done??

I don´t know if I have explained well, but thanks in advance for any
help.

Greetings.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.