This is a kluge to let us shove a declaration for xml: into the
DOM2DTM model. Basically, it creates a proxy node in DOM space to
carry the additional information. This is _NOT_ a full DOM
implementation, and shouldn't be one since it sits alongside the
DOM rather than becoming part of the DOM model.
(This used to be an internal class within DOM2DTM. Moved out because
I need to perform an instanceof operation on it to support a temporary
workaround in DTMManagerDefault.)
%REVIEW% What if the DOM2DTM was built around a DocumentFragment and
there isn't a single root element? I think this fails that case...
%REVIEW% An alternative solution would be to create the node _only_
in DTM space, but given how DOM2DTM is currently written I think
this is simplest.
getHandleOfNode
public int getHandleOfNode()
Non-DOM method, part of the temporary kluge
%REVIEW% This would be a pruning problem, but since it will always be
added to the root element and we prune on elements, we shouldn't have
to worry.
getName
public String getName()
Returns the name of this attribute.
- getName in interface Attr
getOwnerElement
public Element getOwnerElement()
The Element
node this attribute is attached to or
null
if this attribute is not in use.
- getOwnerElement in interface Attr
getSpecified
public boolean getSpecified()
If this attribute was explicitly given a value in the original
document, this is true
; otherwise, it is
false
. Note that the implementation is in charge of this
attribute, not the user. If the user changes the value of the
attribute (even if it ends up having the same value as the default
value) then the specified
flag is automatically flipped
to true
. To re-specify the attribute as the default
value from the DTD, the user must delete the attribute. The
implementation will then make a new attribute available with
specified
set to false
and the default
value (if one exists).
In summary: If the attribute has an assigned value in the document
then specified
is true
, and the value is
the assigned value.If the attribute has no assigned value in the
document and has a default value in the DTD, then
specified
is false
, and the value is the
default value in the DTD.If the attribute has no assigned value in
the document and has a value of #IMPLIED in the DTD, then the
attribute does not appear in the structure model of the document.If
the ownerElement
attribute is null
(i.e.
because it was just created or was set to null
by the
various removal and cloning operations) specified
is
true
.
- getSpecified in interface Attr
getValue
public String getValue()
On retrieval, the value of the attribute is returned as a string.
Character and general entity references are replaced with their
values. See also the method getAttribute
on the
Element
interface.
On setting, this creates a Text
node with the unparsed
contents of the string. I.e. any characters that an XML processor
would recognize as markup are instead treated as literal text. See
also the method setAttribute
on the Element
interface.
- getValue in interface Attr
isSupported
public boolean isSupported(String feature,
String version)
- isSupported in interface Node
setNodeValue
public void setNodeValue(String value)
- setNodeValue in interface Node
setPrefix
public void setPrefix(String value)
- setPrefix in interface Node
setValue
public void setValue(String value)
On retrieval, the value of the attribute is returned as a string.
Character and general entity references are replaced with their
values. See also the method getAttribute
on the
Element
interface.
On setting, this creates a Text
node with the unparsed
contents of the string. I.e. any characters that an XML processor
would recognize as markup are instead treated as literal text. See
also the method setAttribute
on the Element
interface.
- setValue in interface Attr