You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Andreas Schmidt <an...@team-konzept.de> on 2000/07/28 14:23:58 UTC

working with XMLContentSpec?

hi,

i'm triing to analyze the grammar of a schema/dtd to transform the complete 
grammar into an new representation. with the help of the 
TraverseSchema-class i get the SchemaGrammar, and then i traverse the 
grammar through access to the XMLElementDecl of my "root"-element and 
traverse it's XMLContentSpec. when a XMLContentSpec is a leaf-node refering 
to another element, i use XMLContentSpec .value as the name-index in the 
StringPool and get the index of the corresponding XMLElementDecl through 
SchemaGrammar.getElementDeclIndex( XMLContentSpec.value, 0 ).

my problem is the second parameter of getElementDeclIndex, scopeIndex. i'm 
not shure, how to get this parameter out of the XMLContentSpec. it doesn't 
seem to be part of XMLContentSpec.

what is the correct value for scopeIndex, and how can i get it?

thanks
	andi


Re: working with XMLContentSpec?

Posted by Eric Ye <er...@locus.apache.org>.
Scope information is not stored in the XMLContentSpec. for Schema Grammar,
you can get the scope index by calling the method getElementDefinedScope(int
elementDeclIndex), this the scope you will be using to resolve all the
children element of this element.
For DTD Grammar, you can always use "-1" for all the scope index.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Andreas Schmidt" <an...@team-konzept.de>
To: <ge...@xml.apache.org>; <xe...@xml.apache.org>
Sent: Friday, July 28, 2000 5:23 AM
Subject: working with XMLContentSpec?


> hi,
>
> i'm triing to analyze the grammar of a schema/dtd to transform the
complete
> grammar into an new representation. with the help of the
> TraverseSchema-class i get the SchemaGrammar, and then i traverse the
> grammar through access to the XMLElementDecl of my "root"-element and
> traverse it's XMLContentSpec. when a XMLContentSpec is a leaf-node
refering
> to another element, i use XMLContentSpec .value as the name-index in the
> StringPool and get the index of the corresponding XMLElementDecl through
> SchemaGrammar.getElementDeclIndex( XMLContentSpec.value, 0 ).
>
> my problem is the second parameter of getElementDeclIndex, scopeIndex. i'm
> not shure, how to get this parameter out of the XMLContentSpec. it doesn't
> seem to be part of XMLContentSpec.
>
> what is the correct value for scopeIndex, and how can i get it?
>
> thanks
> andi
>
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
>
>