List Info

Thread: FYI: Possible DOM problems with namespace URIs for attributes




FYI: Possible DOM problems with namespace URIs for attributes
user name
2006-03-15 14:26:29
Due to my recent work on changing the way SVG graphics are
loaded in FOP
and a special XML parser/XSLT impl setup I discovered a
potential source
of problems. For example, if you use SAXON 8 as your XSLT
implementation
and use the XSLT output to build up the SVG DOM you might
run into
problems with attributes: The namespace URI for attributes
will be an
empty string ("", used by SAX) instead of null
(used by W3C). The Batik
DOM currently doesn't normalize empty strings to null. It
may be good to
eventually do more defensive programming in this area. BTW,
the same
problem can occur with older versions of Xalan-J. See [1].
In recent
releases this has been fixed.

[1] http://mail
-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200602.m
box/%3c20060224111229.0CAF.DEVjeremias-maerki.ch%3e

Jeremias Maerki


------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-dev-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-dev-helpxmlgraphics.apache.org

FYI: Possible DOM problems with namespace URIs for attributes
user name
2006-03-15 14:43:24
On Mar 15, 2006, at 15:26, Jeremias Maerki wrote:
> Due to my recent work on changing the way SVG graphics
are loaded  
> in FOP
> and a special XML parser/XSLT impl setup I discovered a
potential  
> source
> of problems. For example, if you use SAXON 8 as your
XSLT  
> implementation
> and use the XSLT output to build up the SVG DOM you
might run into
> problems with attributes: The namespace URI for
attributes will be an
> empty string ("", used by SAX) instead of
null (used by W3C). The  
> Batik
> DOM currently doesn't normalize empty strings to null.
It may be  
> good to
> eventually do more defensive programming in this area.

It's not just defensive, it's actually required for
conformance to  
the DOM: "In programming languages where empty strings
can be  
differentiated from null, empty strings, when given as a
namespace  
URI, are converted to null." --http://www.w3.
org/TR/DOM-Level-3-Core/ 
core.html#Namespaces-Considerations

-- 
Robin Berjon
    Senior Research Scientist
    Expway, http://expway.com/



------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-dev-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-dev-helpxmlgraphics.apache.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )