Validating an xml file Complete free sexy chat or web no credit
by Deepak Vohra 09/15/2004 An XML schema defines the structure of the elements and attributes in an XML document.
For an XML document to be valid based on an XML schema, the XML document has to be validated against the XML schema.
string xml Input string xsd Input Xml Schema Set sc = new Xml Schema Set(); sc. Create(new String Reader(xsd Input)); // Set the validation settings. The xml schema validation stuff is a lot better in 2.0. Here is a sample from MS help: Visual Basic Imports System Imports System. Dim settings as Xml Reader Settings = new Xml Reader Settings() settings.
Xml Reader Settings settings = new Xml Reader Settings(); settings.
The Xerces2-j parser may be obtained from the Xerces2-j page.
Extract the Xerces-J-bin.2.5.0(for Windows) or Xerces-J-bin.2.5.0gz (for Unix) files to the installation directory of your choice.
Add(Nothing, "D:\xxml\books.xsd") Dim event Handler As New Validation Event Handler(Address Of Validation Event Handler) tmp Doc. Validate(event Handler) You can check the code of errors in your new list variable. You will want to comment out this line: Msg Box("Error: " & Convert. Message)) or you will get a message box for each error. Anyway, if you can determine from the error message what is really wrong you can certainly write some code that checks the error message givin and then change it to something that users would understand. Write End Element() Exit Select End Select with he above code a is created but its not as per the format needed the nodes & elements needs to be more structured & looped how can it be done i need the first line of the xml to be 'ABC xmlns:xsi=" xsi:no Namespace Schema Location="ABC.xsd") i am not getting it Honestly sql sever 2000 doesn't do xml very well.I just sort of pulled pieces and parts to make it work like I wanted it to. I am not sure if it can be done any easy way in sql server 2000. If you had sql server 2005 or 2008 I think you could do what you wanted.