cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicola Ken Barozzi" <nicola...@apache.org>
Subject Re: problems parsing xml from a foreign source in c2.0.0
Date Thu, 07 Mar 2002 07:27:21 GMT
From: "Donald Ball" <balld@webslingerZ.com>

>  tried to figure out how to disable validation to ignore
> the issue completely. well, it seems that in c2.0.0, you cannot configure
> the parser's validation behavior in the cocoon.xconf file. i looked in the
> source for JaxpParser, and was surprised to note the parser factory's are
> configured to create non-validating parsers:
>
>     public JaxpParser ()
>     throws SAXException, ParserConfigurationException {
>         this.factory.setNamespaceAware(true);
>         this.factory.setValidating(false);
>         this.docfactory.setNamespaceAware(true);
>         this.docfactory.setValidating(false);
>     }
>
> if this is right, why is the parser trying to validate?

Hi Donald! :-)

When a DTD is declared, it is needed by the parser even if it's not
validating.
Take for example how it parses whitespaces: if an element is declared in the
DTD to contain only other elements, the whitespace between itself and the
children is not sent; otherwise it is, since the parser doesn't know if it
is needed (has a meaning) or not.

--
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message