You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by John Utz <ut...@singingfish.com> on 2002/02/08 18:38:20 UTC

picking apart XMLSchema with 1.6

hello;

after the schema has been read in, there must be a representation of it in
memory somewhere, right?

so how can access that data structure? XMLValidator has a
getGrammar() method that returns a Grammar, but i couldnt find any docs
that described the Grammar data structure. is this the one i want? does it
have some accessors?

I know that DOM3 knows how to do these things, but we dont have DOM3.

thankyou very much!

johnu



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


Re: picking apart XMLSchema with 1.6

Posted by John Utz <ut...@singingfish.com>.
hi Tinny!

On Fri, 8 Feb 2002, Tinny Ng wrote:

> Please check the sample SEnumVal and see if that helps.

ooooohhhhh, excellent! looking at
http://xml.apache.org/xerces-c/senumval.html, the sample output looks to
have all the facts that i am looking for!

i am going to try and adapt this example to xerces-p and see how it
flies. that would really be a great test for the new xerces-p release and
it would allow me to see if my current Cunning Plan(tm) will actually
work!

i am sooo excited!

johnu

> Tinny
> 
> John Utz wrote:
> 
> > hello;
> >
> > after the schema has been read in, there must be a representation of it in
> > memory somewhere, right?
> >
> > so how can access that data structure? XMLValidator has a
> > getGrammar() method that returns a Grammar, but i couldnt find any docs
> > that described the Grammar data structure. is this the one i want? does it
> > have some accessors?
> >
> > I know that DOM3 knows how to do these things, but we dont have DOM3.
> >
> > thankyou very much!
> >
> > johnu
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 


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


Re: picking apart XMLSchema with 1.6

Posted by John Utz <ut...@singingfish.com>.
hi Tinny!

On Fri, 8 Feb 2002, Tinny Ng wrote:

> Please check the sample SEnumVal and see if that helps.

ooooohhhhh, excellent! looking at
http://xml.apache.org/xerces-c/senumval.html, the sample output looks to
have all the facts that i am looking for!

i am going to try and adapt this example to xerces-p and see how it
flies. that would really be a great test for the new xerces-p release and
it would allow me to see if my current Cunning Plan(tm) will actually
work!

i am sooo excited!

johnu

> Tinny
> 
> John Utz wrote:
> 
> > hello;
> >
> > after the schema has been read in, there must be a representation of it in
> > memory somewhere, right?
> >
> > so how can access that data structure? XMLValidator has a
> > getGrammar() method that returns a Grammar, but i couldnt find any docs
> > that described the Grammar data structure. is this the one i want? does it
> > have some accessors?
> >
> > I know that DOM3 knows how to do these things, but we dont have DOM3.
> >
> > thankyou very much!
> >
> > johnu
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 


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


Re: picking apart XMLSchema with 1.6

Posted by Tinny Ng <tn...@ca.ibm.com>.
Please check the sample SEnumVal and see if that helps.

Tinny

John Utz wrote:

> hello;
>
> after the schema has been read in, there must be a representation of it in
> memory somewhere, right?
>
> so how can access that data structure? XMLValidator has a
> getGrammar() method that returns a Grammar, but i couldnt find any docs
> that described the Grammar data structure. is this the one i want? does it
> have some accessors?
>
> I know that DOM3 knows how to do these things, but we dont have DOM3.
>
> thankyou very much!
>
> johnu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


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


RE: picking apart XMLSchema with 1.6

Posted by Elisha Berns <e....@computer.org>.
Hi All,

John, I tried to get a validation object to use during parsing with the
following code:

		long nGrammarType = parser->getValidator().getGrammar()->getGrammarType();
		if ( nGrammarType == Grammar::SchemaGrammarType )
		{
			if ( parser->getValidator().handlesSchema() )
			{
				const XMLValidator& xmlValidator = parser->getValidator();

				SchemaGrammar* pGrammar =
					(SchemaGrammar*)xmlValidator.getGrammar();
			}
		}

Why it does not work is a mystery because the call the handlesSchema()
returns true, and you get an XMLValidator object, but you can't get a
SchemaGrammar object.  By the way, the documentation states that for version
1.6 schema information is available only during parsing.

Another problems is that I tried the following:

	SchemaValidator* pSchemaValidator = new SchemaValidator();
	DOMParser *parser = new DOMParser(pSchemaValidator);
	DOMParser *parser = new DOMParser();

And that doesn't work either.  The reason to even attempt the above is
because the default validator is a DTDValidator, not a schema validator.

So would somebody from the Xerces-C team like to comment on what should
work, how it should work and what actually does work at present?

Many Thanks,

Elisha Berns
e.berns@computer.org

-----Original Message-----
From: John Utz [mailto:utz@singingfish.com]
Sent: Fri, February 08, 2002 09:38
To: xerces-c-dev@xml.apache.org
Subject: picking apart XMLSchema with 1.6


hello;

after the schema has been read in, there must be a representation of it in
memory somewhere, right?

so how can access that data structure? XMLValidator has a
getGrammar() method that returns a Grammar, but i couldnt find any docs
that described the Grammar data structure. is this the one i want? does it
have some accessors?

I know that DOM3 knows how to do these things, but we dont have DOM3.

thankyou very much!

johnu



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


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