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 "Williamson, Siehnai" <sw...@docucorp.com> on 2002/02/12 01:29:57 UTC

Can't access content model in SEnumVal when complex type = All

Hi,

I have 2 issues:

1.)  While running the SEnumVal example using the personal-schema.xml file,
I realized that getFormattedContentModel() returns nothing when the complex
type for the element equals "All" (see element "name" in
personal-schemal.xml).  After further research, it appears that the switch
statement in the method formatNode(...) of the ContentSpecNode class does
not check for an "All" event.  As a result, the content model for the
element is never formatted when its complex type is "All."  

My application needs this data--is there an alternative way to get it or do
I have to wait for a fix?

2.)  Why does SchemaElementDecl in SEnumVal example contain elements from
the XML document even if it is not in the schema?  Shouldn't it only contain
those elements or values that are listed in the schema?

I have a dummy xml document with a root element called "dummy" pointing to
the document's schema.  Whenever I run SEnumVal, the last element retrieved
from SchemaElementDecl is this "dummy" element.  Since I don't know if the
user will use the word "dummy" as the root element for her dummy document, I
can't therefore check for "dummy" and eliminate it in my application.  The
only alternative is to figure out the last element validated and then assume
that this is the root element from the xml document.  

Is there a better way to do this in Xerces or is there going to be a fix to
remove the root element from being listed in the validator?
 

Re: Can't access content model in SEnumVal when complex type = All

Posted by PeiYong PY Zhang <pe...@ca.ibm.com>.
Williamson,

"Williamson, Siehnai" wrote:

> 1.)  While running the SEnumVal example using the personal-schema.xml
> file, I realized that getFormattedContentModel() returns nothing when
> the complex type for the element equals "All" (see element "name" in
> personal-schemal.xml).  After further research, it appears that the
> switch statement in the method formatNode(...) of the ContentSpecNode
> class does not check for an "All" event.  As a result, the content
> model for the element is never formatted when its complex type is
> "All."
>

     Your finding is valid, please open a bug in the bugzilla for the
record.
     The code for ContentSpecNode::All has been added and available from
CVS.

>
>
> 2.)  Why does SchemaElementDecl in SEnumVal example contain elements
> from the XML document even if it is not in the schema?  Shouldn't it
> only contain those elements or values that are listed in the schema?
>
> I have a dummy xml document with a root element called "dummy"
> pointing to the document's schema.  Whenever I run SEnumVal, the last
> element retrieved from SchemaElementDecl is this "dummy" element.
> Since I don't know if the user will use the word "dummy" as the root
> element for her dummy document, I can't therefore check for "dummy"
> and eliminate it in my application.  The only alternative is to figure
> out the last element validated and then assume that this is the root
> element from the xml document.

      Please forward us your sample instance document and xsd file to
reproduce what you have, (is it on windows?, please
specify the platform), thanks.

Rgds,
Peiyong