Jump to content
AndrewHoward

Create an XSD validated XML file

Recommended Posts

Hello,
I would like to get data from a sql db, go through data and generate XML file.
The XML needs to be valid when checkeck against XSD schema.


If I had a list of users:

UserID, Name
------  ----
01      David
02      Test1


How do I validate user Names against XSD rule: e.g.

                            <xs:element name="Name" minOccurs="1">
                                <xs:simpleType>
                                    <xs:restriction base="xs:string">
                                        <xs:pattern value="[^0-9\r\n|&quot;]{1,50}"/>
                                    </xs:restriction>
                                </xs:simpleType>
                            </xs:element>


I have about 50 fields & 50 rules.

Which is the best way to do this ?

Anyone have an example I can look at ?
Thank you

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×