Re: setting an element's value?

Tom is absolutely rightt. Given that XML is abstract markup, there really
is no single string that all XML-based languages will agree correctly
represents the element's content.   The desired string representation might
just as well be "[bold] statement, This is a" -- or even "783092389", that
being the order number for the "This is a statement" purchase (<p/>) with
the billing number (<b/>) "bold" and no attributes on either (which might
have affected how it was resolved).

The question isn't "independent text units". It's the fact that the
element's structure, as well as its text content, may have meaning to a
given application. That's true even in HTML; would you really want the
element's node value to include the content of <script> elements?

This isn't to say that get-all-contained-text is useless. It's a perfectly
reasonable operation which will _SOMETIMES_ be valuable, which is why
Ranges have a mechanism for retrieving that information, and there have
occasionally been proposals that we add a non-Range convenience function to
retrieve it. But it's up to the application to decide when that is and
isn't a useful view of this subtree.

Joe Kesselman  / IBM Research

Received on Monday, 9 July 2001 20:01:05 UTC