You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Imran Rashid <im...@wolfram.com> on 2000/06/08 17:09:40 UTC

validating w/ namespaces

    at first I thought this was a problem w/ my XML and DTD, but now I think
its a problem w/ xerces-j.

I'm using xerces-j 1.1.0 jar release as a SAX2 parser.

my XML document looks something like this:
<CellGroup>
 <style:Input>
  ...
 </style:Input>
</CellGroup>

with DTD:
<!ELEMENT CellGroup ( Cell | style:Input | style:Output)+>


I get the error:
The content of element type "CellGroup" must match
"(Cell|style:Input|style:Output)".

I tried taking out the namespaces, like this:
<CellGroup>
 <Input>
  ...
 </Input>
</CellGroup>

with DTD:
<!ELEMENT CellGroup (Cell | Input | Output)+>

and it worked fine.  which was very strange, b/c I actually did *not* have
a declaration for the element "Input", just for "style:Input", leading me to
believe that its a parser error.

when i turn "http://xml.org/sax/features/namespaces" off, it validates OK.
when i turn "http://xml.org/sax/features/namespaces" on and
"http://xml.org/sax/features/namespace-prefixes" off, it does *not*
validate.

is this a xerces bug??
or just a newbie mistake??

thanks,
Imran Rashid

Re: validating w/ namespaces

Posted by Eric Ye <er...@locus.apache.org>.
If you want to validate with DTD, you have to turn off the namespace
support, because DTD doesn't work quite well with namespaces.
_____


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

----- Original Message -----
From: "Imran Rashid" <im...@wolfram.com>
To: <xe...@xml.apache.org>
Sent: Thursday, June 08, 2000 8:09 AM
Subject: validating w/ namespaces


>
>     at first I thought this was a problem w/ my XML and DTD, but now I
think
> its a problem w/ xerces-j.
>
> I'm using xerces-j 1.1.0 jar release as a SAX2 parser.
>
> my XML document looks something like this:
> <CellGroup>
>  <style:Input>
>   ...
>  </style:Input>
> </CellGroup>
>
> with DTD:
> <!ELEMENT CellGroup ( Cell | style:Input | style:Output)+>
>
>
> I get the error:
> The content of element type "CellGroup" must match
> "(Cell|style:Input|style:Output)".
>
> I tried taking out the namespaces, like this:
> <CellGroup>
>  <Input>
>   ...
>  </Input>
> </CellGroup>
>
> with DTD:
> <!ELEMENT CellGroup (Cell | Input | Output)+>
>
> and it worked fine.  which was very strange, b/c I actually did *not* have
> a declaration for the element "Input", just for "style:Input", leading me
to
> believe that its a parser error.
>
> when i turn "http://xml.org/sax/features/namespaces" off, it validates OK.
> when i turn "http://xml.org/sax/features/namespaces" on and
> "http://xml.org/sax/features/namespace-prefixes" off, it does *not*
> validate.
>
> is this a xerces bug??
> or just a newbie mistake??
>
> thanks,
> Imran Rashid
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>