November 2003
Intermediate to advanced
476 pages
14h 38m
English
You already know how to load any XML document into memory. Once you
have a document in memory, you can navigate through its elements
using XmlDocument’s standard
methods, and read it into an XmlSchema for other
purposes:
XmlDocument document = new XmlDocument( ); document.Load(args[0]); XmlNodeReader reader = new XmlNodeReader(document); ValidationEventHandler handler = new ValidationEventHandler(Handler); XmlSchema schema = XmlSchema.Read(reader, handler); schema.Compile(handler);
I
n much the same way, you can use
XmlDocument’s
GetNavigator( ), SelectNodes(
), and SelectSingleNode( ) methods to
navigate an XSD. You can also transform it into any other format,
given an appropriate XSLT stylesheet. For example, you might wish to
transform an XSD into a DTD; you could write an XSLT transform to do
so.