<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2716.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I am having a problem with using the results of
DOMOutputter. I needed to get the canonicalized version of a
portion of a document I create using JDOM, so I wrote the following code that
uses Apache's XML Security package.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> DOMOutputter
domOutputter = new
DOMOutputter();<BR>
Canonicalizer c14n
=<BR>
Canonicalizer<BR>
.getInstance("<A
href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">http://www.w3.org/TR/2001/REC-xml-c14n-20010315</A>");<BR>
byte[] canonicalizedData =
c14n.canonicalizeSubtree(domOutputter.output(wrapperElem));<BR></FONT></DIV>
<DIV><FONT size=2>This is failing in the Apache XML Security package when it
tries to use the local name of an attribute. attrNode.getLocalName()
returns null, but attrNode.getNodeName() returns the attributes
name.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I researched a bit and found in the Xalan documentation this
note concerning getLocalName</FONT></DIV><FONT size=2>
<H3>getLocalName</H3><PRE>public java.lang.String <B>getLocalName</B>()</PRE>
<DL>
<DD>Returns the local part of the qualified name of this node. <BR>For nodes
of any type other than <CODE>ELEMENT_NODE</CODE> and
<CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method, such
as <CODE>createElement</CODE> from the <CODE>Document</CODE> interface, this
is always <CODE>null</CODE>. </DD>
<DL>
<DT><B>Since: </B>
<DD>DOM Level 2 </DD></DL></DL>
<DIV> </DIV>
<DIV>I looked in the code and sure enough, DOMOutputter is using createElement
which is a DOM level 1 method.</DIV>
<DIV> </DIV>
<DIV>Is DOMOutputter meant to be only DOM Level 1 compliant, or is this just an
oversight?</DIV></FONT></BODY></HTML>