Hi, I was
tidying some code and came across a problem. I need to
retrieve a attribute based on namespace and name, but via the Element.attribute(Qname)
method. I note that
there is a convenience method to generate a QName based on the prefix and the
attribute name, but no such method for Namespace and name Taking a
similar line to that in Element.getQName(String) I could use Element.getDocumentFactory().createQName(
name, myNamespace ); but getDocument is protected, and part of AbstractElement,
not Element. I have 3
questions 1.
What
is the preferred way to generate a QName given a namespace and name? 2.
Is
here any reason why getDocumentFactory is not part of the Node interface? 3.
Looking
at Qname there appears to be little documentation – I presume that this class
is only intended to be constructed by a DocumentFactory, or by Nodes Mike |
image001.gif
Description: GIF image