• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is there a way to put the Schema in the same java object (like Document) as XML?

 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way in the XML APIs to make one Document object that has both the schema and XML in it? Can i then get the XML elements'/attributes' metadata from that object instead of having to do the usual two steps:

* Get schemaTypeInfo
* using schemaTypeInfo (name, namespace) look it up in schema object
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In case anyone's interested, i solved this in Xerces. Simply get the domConfiguration and pass the following parameter:



Then you get an Element from the document root and do the following cast:

XSElementDeclaration elementMetaData = ( ( ElementPSVI ) element ).getElementDeclaration();

From there you're using schema stuff!
[ September 29, 2006: Message edited by: Dan Bizman ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic