You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XML elements can have several different kinds of child nodes. According to the documentation, that includes Element, Text, Comment, ProcessingInstruction, CDATA, and EntityReference. Always sorting the child nodes can break the content, since the order can be important. For example:
<text>Click on <urltarget="/home" /> to return to the home page.</text>
Simply sorting this results in
<text>Click on to return to the home page.<urltarget="/home" /></text>
which is most probably not wanted.
Thus, only when the child nodes are all elements themselves should sorting occur.
However, this is very strict, so comments should be allowed as well. Since there is no sure way to tell where the comments should be sorted (they may belong to the element above, below, at the start or end of all children or only of the same type, ...), the easiest way is to sort them as well.
The text was updated successfully, but these errors were encountered:
XML elements can have several different kinds of child nodes. According to the documentation, that includes Element, Text, Comment, ProcessingInstruction, CDATA, and EntityReference. Always sorting the child nodes can break the content, since the order can be important. For example:
Simply sorting this results in
which is most probably not wanted.
Thus, only when the child nodes are all elements themselves should sorting occur.
However, this is very strict, so comments should be allowed as well. Since there is no sure way to tell where the comments should be sorted (they may belong to the element above, below, at the start or end of all children or only of the same type, ...), the easiest way is to sort them as well.
The text was updated successfully, but these errors were encountered: