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 Conny Krappatsch <co...@smb-tec.com> on 2001/01/25 14:39:01 UTC

[bugfix] HTMLSerializer

Hallo,

attached is a patch for the HTMLSerializer.java and
BaseMarkupSerializer.java. The HTMLSerializer used to replace line breaks
with a space character. This causes problems, if the generated HTML page
contains JavaScript, which is enclosed within comment for browser backward
compatibility.

The patch corrects this behaviour. HTMLSerializer overwrites the comment()
method which checks for line breaks within the comment and adds the proper
HTML comment delimiter.
The patch is for the latest (checked out this morning) CVS.



And PLEASE, could somebody answer the question below?
First time I send it nobody responded :-(

If I create DOM nodes with the *NS() methods (with namespaceURI != "") and
serialize the document using org.apache.xml.serialize.XMLSerializer, there
are no namespace declarations in the resulting XML file. Parsing this file
results in an error because of the missing declarations.
The same happens if I use the SAX interface instead of DOM.

Is this a known behaviour? Do I have to create the needed declaration
attributes by myself? Are there any other work arounds?

BTW, it's Xerces 1.1.3 (I glanced at the CVS, and it doesn't seem as
something like that has been fixed since this version (according to the
CVS comments).)

Best regards,
Conny Krappatsch

-- 
______________________________________________________________________
Conny Krappatsch                              mailto:conny@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




RE: [bugfix] HTMLSerializer

Posted by "Julian F. Reschke" <ju...@gmx.de>.
> If I create DOM nodes with the *NS() methods (with namespaceURI != "") and
> serialize the document using org.apache.xml.serialize.XMLSerializer, there
> are no namespace declarations in the resulting XML file. Parsing this file
> results in an error because of the missing declarations.
> The same happens if I use the SAX interface instead of DOM.
>
> Is this a known behaviour? Do I have to create the needed declaration
> attributes by myself? Are there any other work arounds?

I think it's a known fact that the serializer doesn't work well (or at all)
with namespace declarations.

Currently, before serializing, I am forcing an xmnls=".." into the output
stream by setting it with a DOM level 1 method (which sort of works when
your whole document uses just one default namespace).