Is there a way to make newSchema () display what xsd's it has / is
resolving or loading ?


On Mar 28, 2012, at 6:14 PM, Michael Glavassevich <mrgla...@ca.ibm.com>
wrote:

One thing to check is whether you have imports/includes to the same
document but pointing to different schema locations. Xerces can only
determine that they're the same if they have identical non-null schema
location URIs (after resolveEntity() returns). Otherwise Xerces will
process them as unique documents and would produce errors about duplicate
components.

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Andrew Welch <andrew.j.we...@gmail.com> wrote on 28/03/2012 04:38:29 PM:

> From: Andrew Welch <andrew.j.we...@gmail.com>
> To: j-users@xerces.apache.org,
> Date: 28/03/2012 04:40 PM
> Subject: Re: factory.newSchema(schemaLocation) freezes
>
> I'm afraid I don't know... if you don't have any luck here, maybe try
> on the more general 'xmlschema-dev' mailing list.
>
>
> On 28 March 2012 15:38, Danny Sinang <d.sin...@gmail.com> wrote:
> > Hi Andrew,
> >
> > Thanks, I was able to find the XML that had a blank line before the XML
> > prolog.
> >
> > Also, I used Kernow to validate my document using the same schema in
> > question. Odd thing was, it took like 2 minutes for the schema to
compile,
> > and Kernow issued this error :
> >
> > sch-props-correct.2: A schema cannot contain two global components with
the
> > same name; this schema contains two occurrences of
> > 'http://www.w3.org/1999/xhtml,Length'.
> >
> > Am encountering the same slow schema compilation and "cannot contain two
> > global components" error in my Java app - even after using a catalog to
> > resolve the import for "http://www.w3.org/2001/xml.xsd";.
> >
> > I later decided to reference the files locally in my XSD's like this :
> >
> > <xs:import namespace="http://www.w3.org/XML/1998/namespace";
> > schemaLocation="file:/C:/Users/dsinang/Desktop/xml.xsd">
> >
> >
> > but schema compilation is still slow.
> >
> > As for the validation error, I did a case-insensitive search for
> > name="Length" and found these :
> >
> >  D:\schema\mathml3-common.xsd (1 hits)
> > Line 96:    <xs:simpleType name="length">
> >   D:\schema\mathml3-presentation.xsd (2 hits)
> > Line 462:       <xs:attribute name="length" type="m:unsigned-integer"/>
> > Line 1085:       <xs:attribute name="length" type="m:unsigned-integer"/>
> >   D:\schema\xhtml-datatypes-1.xsd (1 hits)
> > Line 19:     <xs:simpleType name="Length">
> >   D:\schema\xhtml-notations-1.xsd (1 hits)
> > Line 57:   <xs:notation name="length" public="-//W3C//NOTATION XHTML
> > Datatype: Length//EN"/>
> >
> > Thanks to Michael's mentioning SAXParseException.getSystemId() , I was
able
> > to zero-in on the Length declaration in xhtml-datatypes-1.xsd.
> >
> > I'm just not sure which other "length" declaration it conflicts with
(i.e.
> > not sure if 'Length' conflicts with 'length').
> >
> > Would you know ?
> >
> > Regards,
> > Danny
> >
> > On Wed, Mar 28, 2012 at 2:23 AM, Andrew Welch <andrew.j.we...@gmail.com>
> > wrote:
> >>
> >> > There's only one XML document being validated and I made sure to add
> >> > a <?xml
> >> > version="1.0" encoding="UTF-8"?> at the beginning of the file, making
> >> > sure
> >> > there's no whitespace before it. Still running into the same error.
> >>
> >> I'm guessing now but if it looks ok, perhaps there's a non-visible
> >> character at the start... if you look at the bytes in a hex editor
> >> what is the first byte?
> >>
> >> > As for the XSD, there's one main XSD, but it imports and includes
other
> >> > XSD's.
> >> >
> >> > Besides inspecting all those XSD files (there are lots of them) for
> >> > whitespaces, is there a way to get Xerces to indicate which XSD it
finds
> >> > the
> >> > problem in ?
> >>
> >> One option (if Michael's suggestion of writing some code isn't doable)
> >>  is to use the validation tab in Kernow, and click the 'check schema'
> >> button.  That will return any errors when compiling the xsd (although
> >> I can't remember if I include the extra information... I will add it
> >> if not).  Either way, it will help narrow down the issue.
> >>
> >> http::/kernowforsaxon.sf.net/
> >>
> >>
> >> --
> >> Andrew Welch
> >> http://andrewjwelch.com
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> >> For additional commands, e-mail: j-users-h...@xerces.apache.org
> >>
> >
>
>
>
> --
> Andrew Welch
> http://andrewjwelch.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to