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 John Utz <ut...@singingfish.com> on 2002/03/26 01:10:40 UTC

error caused when running xni.DocumentTracer on personal.xsd

hello all;

 i am continuing to try to find a way to read a schema so that i can get a
the list of elements so that i can use the elements to populate a UI.

so, i ran xni.DocumentTracer on personal.xsd:

bash-2.04$ java  -classpath
Compile/Xerces/xml-xerces/java/build/xerces.jar:Compile/Xerces/xml-xerces/java/build/xercesSamples.jar
xni.DocumentTracer -v -s Compile/Xerces/xml-xerces/java/data/personal.xsd
>foo.txt
[Error] personal.xsd:2:58: cvc-elt.1: Cannot find the declaration of
element 'xs:schema'.

It *does* print the elements out, which is good, but i wonder why it
doesnt 'know' that it's reading a schema once it sees the top element is

  <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>

can anyone enlighten me? am i mistaken in thinking that it should know
that it's looking at a schema?

note that even if you pass in the 
-p org.apache.xerces.parsers.XMLGrammarCachingConfiguration

the error is still the same. is this a bug?

tnx!

johnu


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: error caused when running xni.DocumentTracer on personal.xsd

Posted by Eddie Robertsson <er...@allette.com.au>.
Hi Elena,

> Xerces does not allow you to validate a schema against Schema for
> Schemas.

Just out of curiosity, why doens't Xerces allow you to validate a Schema against
the schema for schemas?
Can't you supply the Schema for schemas in the
"http://apache.org/xml/properties/schema/external-schemaLocation" property and
then validate normally? What's different with the Schema for schemas compared to
other schemas?
Like this:

reader.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation",
"XMLSchema.xsd");

Cheers,
/Eddie

>
>
> > but, you avoided the quaestion that i asked, shouldnt xerces 'know' that i
> > am asking it to validate a schema?
>
> No. The DocumentTracer is design to trace instance documents (and
> validate those). For parsing XML Schemas we use completely different
> code which has XML Schema validation code built-in. If you don't need
> events to parser XML Schemas use dom.ASBuilder sample:
> http://xml.apache.org/xerces2-j/samples-dom.html#ASBuilder
>
> --
> Elena Litani / IBM Toronto
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: error caused when running xni.DocumentTracer on personal.xsd

Posted by John Utz <ut...@singingfish.com>.
Hi Elena

On Tue, 26 Mar 2002, Elena Litani wrote:

> John Utz wrote:
> > > Do you need to validate the Schema against the Schema grammar?
> > 
> > ultimately, yes, i do. 
> 
> Xerces does not allow you to validate a schema against Schema for
> Schemas. 

but it can do so at some point in the future, correct?

> > but, you avoided the quaestion that i asked, shouldnt xerces 'know' that i
> > am asking it to validate a schema?
> 
> No. The DocumentTracer is design to trace instance documents (and
> validate those). For parsing XML Schemas we use completely different
> code which has XML Schema validation code built-in. If you don't need
> events to parser XML Schemas use dom.ASBuilder sample:
> http://xml.apache.org/xerces2-j/samples-dom.html#ASBuilder

actually, i *started* this project working with ASBuilder :-). but ASModel
has no implemented accessors for the 'facts' of the parsed schema yet.

and implementing those methods are something we discussed on the -dev list
and it's on hold until the w3c emits some new docs.

in the interim, *is* there some mechanism for extracting the facts? i'd
use it for now if it existed, even if it was complicated. because then i'd
know what the components where so that i could help out with ASModel :-).

tnx!

johnu


> -- 
> Elena Litani / IBM Toronto
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: error caused when running xni.DocumentTracer on personal.xsd

Posted by Elena Litani <el...@ca.ibm.com>.
John Utz wrote:
> > Do you need to validate the Schema against the Schema grammar?
> 
> ultimately, yes, i do. 

Xerces does not allow you to validate a schema against Schema for
Schemas. 

> but, you avoided the quaestion that i asked, shouldnt xerces 'know' that i
> am asking it to validate a schema?

No. The DocumentTracer is design to trace instance documents (and
validate those). For parsing XML Schemas we use completely different
code which has XML Schema validation code built-in. If you don't need
events to parser XML Schemas use dom.ASBuilder sample:
http://xml.apache.org/xerces2-j/samples-dom.html#ASBuilder

-- 
Elena Litani / IBM Toronto

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: error caused when running xni.DocumentTracer on personal.xsd

Posted by John Utz <ut...@singingfish.com>.
Hi andy;

On Tue, 26 Mar 2002, Andy Clark wrote:

> John Utz wrote:
> > It *does* print the elements out, which is good, but i wonder why it
> > doesnt 'know' that it's reading a schema once it sees the top element is
> 
> Do you need to validate the Schema against the Schema grammar?

ultimately, yes, i do. the Cunning Plan(tm) is to eliminate the
maintenance of Data Input UI code by dynamically generating the UI from
the Schema. If somebody changes the schema and that change breaks it, then
we'd obviously not want to proceed any further.

i am not the only person that has expressed interest on this mailing list
in using schemas in this fashion.

> If not, then turn off validation:
> 
>   java xni.DocumentTracer -n -V document.xml

but whilst i labor mightily to fake up a proof of concept, i'll turn off
validation. :-)

but, you avoided the quaestion that i asked, shouldnt xerces 'know' that i
am asking it to validate a schema?
 
> -- 
> Andy Clark * andyc@apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: error caused when running xni.DocumentTracer on personal.xsd

Posted by Andy Clark <an...@apache.org>.
John Utz wrote:
> It *does* print the elements out, which is good, but i wonder why it
> doesnt 'know' that it's reading a schema once it sees the top element is

Do you need to validate the Schema against the Schema grammar?
If not, then turn off validation:

  java xni.DocumentTracer -n -V document.xml

-- 
Andy Clark * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org