You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Thomas Corte <Th...@knipp.de> on 2002/11/21 17:45:23 UTC

automatic generation of namespace prefixes?

Hi,

trying to create an XML document using Xerces' 1.4.2 XMLSerializer,
I guess it should possible to automatically generate the needed
xml namespace prefixes for the generated element names, i.e. to use

 doc.createElementNS (<ns uri>, "<elemname>");

instead of adding the prefix manually every time like

 doc.createElementNS (<ns uri>, "<prefix>:<elemname>");

and have Xerces add (and possibly even choose) the necessary
ns <prefix> automatically.

However, I can't get this to work with Xerces 1.4.2.
What precautions (i.e., flags to configure the serializer or similar)
have to be taken to accomplish this?

Regards,

_____

Thomas Corte
<th...@knipp.de>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: automatic generation of namespace prefixes?

Posted by Joseph Kesselman <ke...@us.ibm.com>.
See the DOM Level 3 Working Draft's discussion of "namespace 
normalization" for a recommended way of handling this. As far as I know 
that algorithm is still evolving, and I don't know how much of it the 
Xerces serializers impelement.

______________________________________
Joe Kesselman  / IBM Research

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org