You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Rogerio Meneguelli Gatto <ga...@widesoft.com.br> on 2000/01/25 19:55:01 UTC

ProjectX to Xerces migration

Hello,

I was developing an application using Sun's ProjectX parser, and now I'm
migrating it to Xerces Java.

It happens that the two parsers give me two different DOM trees for this XML:

<definition>
  <group code='PM'>
  ...

While Sun's parser ommitted the #text node between the two tags (the newline),
Xerces is not ignoring it, although definition's DTD declarations doesn't allow
#PCDATA:

<!ELEMENT definition (group)+>

I'm using the validating parser from both packages. Is there a way to duplicate
ProjectX's behaviour using Xerces?

TIA
-- 
Rogério Meneguelli Gatto | Visite http://www.widesoft.com.br | God is a comic
ICQ# 25775025            |    e veja a solução ideal para    | playing to an
+55 19 451-6300 (com)    |         se comunicar com          | audience that's
+55 19 234-6923 (res)    |      fornecedores e clientes      | afraid to laugh

Re: ProjectX to Xerces migration

Posted by Andy Clark <an...@apache.org>.
Rogerio Meneguelli Gatto wrote:
> I'd guess that Xerces is not recognizing such a feature.  It's not 
> documented on the features page either. I haven't mentioned before, 
> I'm using Xerces 1.0.1.

Do a checkout of the latest source from the CVS repository. Or
wait until we have a new release that includes that feature. I
just added this feature recently so it must have been after we
did the 1.0.1 release.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org

Re: ProjectX to Xerces migration

Posted by Rogerio Meneguelli Gatto <ga...@widesoft.com.br>.
Ted Leung wrote:
> 
> Rogerio
> 
> Try setting the feature
> 
> http://apache.org/xml/features/dom/include-ignorable-whitespace
> 
> to false.  This will keep ignorable whitespace out of the DOM

Hi, Ted, thank's for the quick reply! But now the following exception is thrown:

http://apache.org/xml/features/dom/include-ignorable-whitespace
        at org.apache.xerces.framework.XMLParser.setFeature(XMLParser.java:1442)
        at org.apache.xerces.parsers.DOMParser.setFeature(DOMParser.java:601)
        at widesoft.xml.loader.RndConverter2.main(RndConverter2.java:304)

I'd guess that Xerces is not recognizing such a feature.  It's not documented on
the features page either.
I haven't mentioned before, I'm using Xerces 1.0.1.

TIA
-- 
Rogério Meneguelli Gatto | Visite http://www.widesoft.com.br | God is a comic
ICQ# 25775025            |    e veja a solução ideal para    | playing to an
+55 19 451-6300 (com)    |         se comunicar com          | audience that's
+55 19 234-6923 (res)    |      fornecedores e clientes      | afraid to laugh

Re: ProjectX to Xerces migration

Posted by Ted Leung <tw...@sauria.com>.
Rogerio

Try setting the feature

http://apache.org/xml/features/dom/include-ignorable-whitespace

to false.  This will keep ignorable whitespace out of the DOM
----- Original Message -----
From: "Rogerio Meneguelli Gatto" <ga...@widesoft.com.br>
To: <ge...@xml.apache.org>
Sent: Tuesday, January 25, 2000 10:55 AM
Subject: ProjectX to Xerces migration


> Hello,
>
> I was developing an application using Sun's ProjectX parser, and now I'm
> migrating it to Xerces Java.
>
> It happens that the two parsers give me two different DOM trees for this
XML:
>
> <definition>
>   <group code='PM'>
>   ...
>
> While Sun's parser ommitted the #text node between the two tags (the
newline),
> Xerces is not ignoring it, although definition's DTD declarations doesn't
allow
> #PCDATA:
>
> <!ELEMENT definition (group)+>
>
> I'm using the validating parser from both packages. Is there a way to
duplicate
> ProjectX's behaviour using Xerces?
>
> TIA
> --
> Rogério Meneguelli Gatto | Visite http://www.widesoft.com.br | God is a
comic
> ICQ# 25775025            |    e veja a solução ideal para    | playing to
an
> +55 19 451-6300 (com)    |         se comunicar com          | audience
that's
> +55 19 234-6923 (res)    |      fornecedores e clientes      | afraid to
laugh