logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Distinguishing default attribute value from absent attribute: msg#00008

Subject: Distinguishing default attribute value from absent attribute
Suppose you're using the DOM setup and you have an attribute
for an element, defined in the .dtd file with a default value.
When parsing, how can you distinguish the situation where the .xml file
did not have that attribute specified for that attribute, from
the situation where the default value was specified explicitly?

The docs claim that DOMElement::getAttrNode returns
  The DOMAttr node with the specified name (nodeName) or null if there is no 
such attribute.
However this does not seem to be true, unless by "there is no such attribute"
they mean that there is no such attribute even in the .dtd file.



<Prev in Thread] Current Thread [Next in Thread>