xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Helder Magalhães" <helder.magalh...@gmail.com>
Subject Re: Attrbutes Generated For USE tag
Date Mon, 07 Apr 2008 12:48:08 GMT
>  On the contrary, I think it is valid to use a prefix for the second
>  parameter of setAttributeNS() (see
>  http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAttrNS).  It is
>  also valid to omit the prefix.

Yes, agreed [1]. Thanks for clarifying! :-)

Nevertheless, one should be careful with namespace mess up - for
example, one may set XLink namespace to use the "xl" prefix in the top
level SVG element and then try to access it by using "xlink" prefix.
Not using prefixes at all in namespace-aware method addresses this
error (rather pretty unlikely, though).

Finally, not using prefixes seems to squeeze a (small) performance
gain - although unmeasured with Batik, seen using ASV and Firefox.
Probably due to avoiding additional string parsing needed if prefixes
are used. Running a few tests to profile this difference could be
(potentially) useful to include in a possible "Performance Tips" or
"Best practices", but this is outside the scope of this thread, as
it's a general SVG/XML subject. ;-)


  Helder Magalhães

[1] http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-qualifiedname

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

View raw message