You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Grubaugh, Eric-p65363" <Er...@gdc4s.com> on 2009/07/01 23:24:36 UTC

Composite schema issue

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.


Re: Composite schema issue

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
... and the usual disclaimer. What ships in Java 5 is Sun's fork of the
Xerces codebase. It is not Xerces 2.6.2 or any other Apache version for
that matter. All sorts of changes and additions were made to it since it
branched from the Apache code that we are not aware of and have no
influence over. It is known to have issues which are unique to it and
others which have long been fixed in Xerces. If you need assistance with
this codebase the Sun forums are a more appropriate place for discussion.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com.
E-mail: mrglavas@apache.org

jeff.greif@gmail.com wrote on 07/02/2009 02:21:20 AM:

> 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<Er...@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-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

Re: Composite schema issue

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
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<Er...@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-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org