View Single Post
  #2 (permalink)  
Old October 11th, 2012, 05:11 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Processing raw schema documents using XPath isn't easy because there are so many different ways of writing effectively the same schema, e.g. using named types or anonymous types, included documents, named model groups and attribute groups, etc. You may be better off trying to get the information from the compiled schema made available by a schema processor. Xerces for example offers an API for access to schema information. Saxon will output the compiled schema in an easy-to-process XML form called SCM - though unfortunately this does not include annotations.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
The Following User Says Thank You to mhkay For This Useful Post:
WilliamYou (October 11th, 2012)