Solved

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

Posted on 2003-11-11
3
403 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 125 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

739 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