You can put any URI you want into the location attribute on import or include, and resolve it from schemas held in strings or relational databases or resources in a jar file or anything else, if you provide an EntityResolver to the parser. See DocumentBuilder.setEntityResolver().
You can also use set a property on the parser to specify a set of schema locations. The property is http://apache.org/xml/properties/schema/external-schemaLocation and its value is a string containing an alternating series of namespace followed by location-URI. This can be combined with the use of an EntityResolver. If you use the non-JAXP parsers provided by Xerces, you can specify an XMLEntityResolver. This is passed an XmlResourceIdentifier, which, for a needed XML schema, will include the target namespace of the schema. You can build an XmlEntityResolver which uses some arbitrary technique to resolve schema namespaces to the source text. Jeff On Wed, Jul 1, 2009 at 2:24 PM, Grubaugh, Eric-p65363<eric.gruba...@gdc4s.com> wrote: > I have been made aware of a bug in Xerces 2.6.2 on JRE 1.5.0_18: > > According to source code comments there is a bug in xerces that prevents it > from parsing schemas with imports and includes correctly: > > Xerces (used by JAXP in Java 1.5 and later) does not correctly parse > composite schema, > (i.e. schema containing <import> and <include> elements) unless the schema > are first written > to disk files. Writing schema to disk files, forces us to re-write each > <import> and <include> > element's schemalocation attribute to reference disk files instead. > > I have been searching the Bugzilla reports to determine whether this has > been fixed or even ever reported, but I cannot find anything that seems > directly related. I just wanted to know if this has been fixed between 2.6.2 > and the current version, as an upgrade would obviously be the simplest fix, > or if it needs to be reported. > > Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org For additional commands, e-mail: j-users-h...@xerces.apache.org