Automatically retrieving XML

Hi all,

I'm using a SAXParser created with a SAXParserFactory with a custom
ContentHandler for parsing XML files and creating some graph
representation of the files contents.

Currently, I generate plain trees, but what I really want is to indicate
cross references as well, as given by element attributes of type

However, Attributes.getType(int) reports only CDATA for all attributes.
So probably I need to create a validating parser. I tried that, but
still no luck, and SAXParserFactory.setValidating(boolean) says that
this is mostly for DTDs anyway and I should set a Schema using

However, the XML files I parse may be completely arbitrary, so I cannot
set some fixed schema. But at least I can presume that they all declare
their schemas properly (and in general there are mostly well-known
schemas), like

--8<---------------cut here---------------start------------->8---
<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmi:version="2.1"
xmi:id="_FbjLzPlaEeCo98mycbxXgw" name="de.uko.nsd.NSDSchema">
--8<---------------cut here---------------end--------------->8---

Isn't there something that retrieves the needed schemas automatically by
the declarations given in the XML file?

(I remember some years back, I've used some open-source parser [maybe
xerces] that did exactly that when some option was set.)

Thanks for any pointers!


Relevant Pages

  • Re: LoadGen - Complete sample using Dyn message creation
    ... not trying to work directly with Schemas (XSD files) to generate load. ... I have two XML files and I like LoadGen ... It is possible to extend the tool by creating a Custom Message-Creator ...
  • Re: Oracle XMLDB question
    ... Fred Pierce - ... Real men write their xml files on the fly. ... Schemas, we don't need no steenkin' schemas! ...
  • Re: Oracle XMLDB question
    ... somebody in this group knows and posting here justifies my spending so ... Real men write their xml files on the fly. ... Schemas, we don't need no steenkin' schemas! ...
  • Compare two XML Files and save to One
    ... Is there a way to have two XML files and compare them and save them ... I downloaded and installed the "XML Diff and Patch" Tool ... documentation seems to imply that I would be able to tell if their ... Schemas are different but not actually save them to a different file. ...