Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2004, 05:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML parsing and schema

Hi XML masters...!

I have been using XML documents for simple data storage for a while, but I am completely new to the game of XML schemas, so I am trying to get better understanding of how they work. I am focusing on the W3C version of these.

The question is... I thought that XML schemas was used to validate the XML document so that you could make an XML document and a schema and then show the XML document using Internet Explorer, and if the XML document is not wellformed, an error would be shown in IE; Is this completely incorrect?

The book says something like ...a validating parser will raise an error in regards to what happens if a wrong tag is added. Isn't IE a parser for the XML document when showing it!?

Thanks.

Jacob.



__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old March 18th, 2004, 05:46 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You are slightly confusing well-formed and valid. IE is not a validating parser. It will only point out syntax errors such as unquoted attributes and non-nested tags, i.e. whether the document is in fact XML. It doesn't check to see if the elements are allowed by a certain schema. There are two methods of using MSXML for schema validation, you can include references to the schema in the xml or you can refer to them using a schema cache. Both methods are detailed in the SDK.

http://msdn.microsoft.com/library/de...asp?frame=true

Joe (Microsoft MVP - xml)
 
Old March 21st, 2004, 08:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, thanks and sorry for this late reply!

So you are saying that the words wellformed refer to syntax in a possible XML document (missing endings etc), and a valid XML document refers to the structure according to some scheme, say MS or W3C style?!

I did all the referencing in the XML document, but thought that IE would read the reference to the schema and then validate the XML document before showing it, and I have now learned that this is not the case!

A have been busy reading about the schemas, and I think I have found the exact thing I was looking for. I thought that IE was doing the parsing, however I have found that you have to do an application that does the actual parsing e.g using the class XmlValidatingReader, right?

Thanks for your help!

Jacob.



 
Old March 21st, 2004, 09:49 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:Originally posted by jacob
 Well, thanks and sorry for this late reply!
No problem, it was your question.
Quote:
quote:
So you are saying that the words wellformed refer to syntax in a possible XML document (missing endings etc), and a valid XML document refers to the structure according to some scheme, say MS or W3C style?!
Yes, except that it is valid according to a schema. This normally means an xml schema which are usually files with an xsd extension. Microsoft also had data reduced schema which had an xdr extension but these are falling out of favour. It could also be validated against a DTD.
Quote:
quote:
I did all the referencing in the XML document, but thought that IE would read the reference to the schema and then validate the XML document before showing it, and I have now learned that this is not the case!
Exactly.
Quote:
quote:
A have been busy reading about the schemas, and I think I have found the exact thing I was looking for. I thought that IE was doing the parsing, however I have found that you have to do an application that does the actual parsing e.g using the class XmlValidatingReader, right?
Well that's if you are using .Net. If you are using Msxml parser no, you just include a reference to the schema or add schemas using the schemaCollection class. What maybe confusing is that although IE uses the msxml parser it only uses it in a non-validating mode. To use it in a validating mode you have to manipulate the class yourself. See the link I posted previously.
Quote:
quote:
Thanks for your help!

Jacob.
My pleasure

Joe (Microsoft MVP - xml)





Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Schema in Email ariyanto XML 0 September 11th, 2006 09:00 AM
XML schema for SQL swan XML 4 July 27th, 2006 05:07 AM
What's the use of XML Schema?! janise XML 2 August 29th, 2004 05:31 AM
xml schema help allang XML 0 August 19th, 2004 09:58 PM
XML, XML Schema, JavaScript, ASP cyberjames2003 XML 0 June 4th, 2003 04:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.