cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject RE: i18n trouble with nested elements in catalog messages
Date Thu, 11 Sep 2003 09:24:31 GMT
On Wed, 2003-09-10 at 20:28, Olivier Lange wrote:
> > Is that normal SAX behavior - and we should replace the null value with an
> 
> Oh! I should have read the doc. From the Javadocs for the org.w3c.dom.Node
> interface:
> http://java.sun.com/j2se/1.4.1/docs/api/org/w3c/dom/Node.html#getNamespaceUR
> I()
> 
> "
> public String getNamespaceURI()
>     The namespace URI of this node, or null if it is unspecified.
> "
> 
> Now, should 'MirrorRecord.nodeToEvents()' handle the 'node.getNamespaceURI()
> == null' case? Is it correct to replace null with an empty string?

yes that's correct. DOM and SAX have different conventions to represent
empty namespaces, so it's necessary to translate between them.

This should be done both for elements and attributes.

While the changes you've done up to know are certainly improvements over
the previous situation, there are still some problems. For example, if
the namespace prefix you use in the translation doesn't exist in the
document in which it's embedded, or the prefix is bound to another
namespace, and then you serialize the document to XML, you will get
incorrect XML because of missing or incorrect namespace declarations.
There's a DOMStreamer class in Cocoon which takes care of all these and
other issues, but integrating that into the I18nTransformer would be
more then a one line change.

In the meantime, if you could make a patch out of all the changes you've
done and submit that to bugzilla, it'll be in the next version of
Cocoon.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Mime
View raw message