?
Solved

Any way to flatten a namespace or easily access attribute/lement type definitions

Posted on 2003-11-11
3
Medium Priority
?
410 Views
Last Modified: 2013-11-19
What I want do do is to create a simple paramater maintenance interface, with input validation, based on type definitions held in XML Schemas.  The shemas themselves rely heavily on namespaces following the venetial blind model of structure.

I would like to be able to access type definitons of the namespaces in order drive the validation at the user interface.  I will overlay a parameter schema on the underlying types to drive generic validation or to invoke taglib style processes.

Problems:

  I don't want to have to parse the XML unless I have no choice.  Is there any kind of tool that will provide intorspection on a an XSD.

  If I do have to parse the XML, is there any tool that will flatten a namespace so that at least I don't have to deal with multiple namespaces, extension, redefinition, etc etc.

I dont't really see jaxb or xsd.exe as being much help unless I am missing something?

More points for good answers

Oops - just found apache xerces.  Has anyone used this to query a schema in order to validate input?
0
Comment
Question by:tonimargiotta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:savalou
ID: 9722348
Try JDom at JDom.org.  The Oracle articles posted on the documentation page provide a quick intro.

JDom lets you quickly build an XML document and query it using xpath.  It is a lot more Java-friendly than Xerces.

Of course, all this assuming you are programming in Java.
0
 
LVL 1

Author Comment

by:tonimargiotta
ID: 9722778
Thanks but the access I need is to the namespace rather than a document instance.

I don't see any access to grammar or the equivalent of the pvsi package in jdom
0
 
LVL 26

Accepted Solution

by:
rdcpro earned 500 total points
ID: 9723531
the Schema Object Model, or SOM is one way of providing introspection of the schema.  This is available in MSXML 4, but I'm not sure what other parsers support it.  But I believe it's used precisely for what you're wanting to do.  In your particular case, ISchemaElement is an interface of the SOM, which has a type property. That property corresponds to an XML Schema document simpleType or complexType element, and that type is represented in the SOM by the ISchemaType interface.

This article covers it (though shallowly, if that's a word) but you have to get to part 5 before it really starts addressing the subject:
http://www.informit.com/isapi/product_id~%7B1D7C86B4-63C6-4C49-9DDC-AC39FE809E17%7D/content/index.asp

And the Microsoft documentation for the SOM developer's guide:
http://msdn.microsoft.com/library/en-us/xmlsdk/htm/som_devguide_overview_73g7.asp
and the SOM Reference:
http://msdn.microsoft.com/library/en-us/xmlsdk/htm/som_reference_3ig5.asp
and Aaron Skonards'  introductory article (from the MSDN Magazine XML files column):
http://msdn.microsoft.com/msdnmag/issues/01/12/xml/default.aspx

Regards,
Mike Sharp
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question