You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Stuart Barker (JIRA)" <xe...@xml.apache.org> on 2015/06/25 10:51:05 UTC

[jira] [Created] (XERCESJ-1662) Xerces creates lazily initialized nodes in read-only DOMs that are not read-only

Stuart Barker created XERCESJ-1662:
--------------------------------------

             Summary: Xerces creates lazily initialized nodes in read-only DOMs that are not read-only
                 Key: XERCESJ-1662
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1662
             Project: Xerces2-J
          Issue Type: Bug
          Components: Other
            Reporter: Stuart Barker
            Priority: Minor


If you set a Document to be read-only with deep=true then it is possible for nodes to be created on later read operations that are not read-only.

This occurs in two cases we have observed:
* conversion of the string value of an attribute to a Text node when calling, for example, getFirstChild on the Attribute; the text node is not read-only and you can mutate its value
* creation of a NamedNodeMap when calling getAttributes on an Element where the attributes object is null (ie an element that has no attributes); the map is mutable, allowing you to add attributes to the read-only element

This is non-DOM functionality but nevertheless the current behaviour seems incorrect.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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