OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cgmo-webcgm message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: QUESTION: where are Text Nodes in the WebCGM DOM tree?


I remember that Text Nodes were discussed and added to the WebCGM DOM model at Cologne.  At one point, there was a WebCGMText interface (that inherited from WebCGMNode), but it didn't add anything useful that wasn't available on the WebCGMNode interface (nodeType equals TEXT_NODE).  So it was removed.

I don't remember exactly where Text Nodes apply in our document tree.  They certainly apply to the content of a metadata node.  For example, if this were in an XCF,

<grobject ...>
    <model:part-longdesc>Here is a verbose description of the
        AJX-20054321-B part, complete with source and replacement
        instructions.  Blah...blah...
    </model:part-longdesc>

then after the XCF was applied, model:part-longdesc would be a child of the grobject, and it would have a Text Node child whose value is "Here is a verbose ...blah...". 

Correct so far? 

And model:part-longdesc would be the parentNode of that Text Node?  (Text Node has no children, and since we can't have additional markup within application-specific metadata elements, there will be no siblings, as there might be if part-longdesc could have child elements that split the text node into sibling-level pieces.)

Correct?

Is there anywhere else in the WebCGM DOM model that Text Nodes appear?  DOM2 suggests they might represent the content of Attr nodes:

[Interface Text, p.60]
The Text interface inherits from CharacterData [p.47] and represents the textual content
(termed character data in XML) of an
Element [p.52] or Attr [p.51] . If there is no markup inside
an element’s content, the text is contained in a single object implementing the
Text interface that is
the only child of the element. If there is markup, it is parsed into the information items [p.98]
(elements, comments, etc.) and
Text nodes that form the list of children of the element.
Interface Attr [p.51]
The
Attr interface represents an attribute in an Element [p.52] object. Typically the allowable
values for the attribute are defined in a document type definition.
Attr objects inherit the Node [p.34] interface, but since they are not actually child nodes of the
element they describe, the DOM does not consider them part of the document tree. Thus, the
Node
attributes parentNode, previousSibling, and nextSibling have a null value for Attr
objects. The DOM takes the view that attributes are properties of elements rather than having a
separate identity from the elements they are associated with; this should make it more efficient to
implement such features as default attributes associated with all elements of a given type.
[...]
In XML, where the value of an attribute can contain entity references, the child nodes of the
Attr
node may be either Text [p.60] or EntityReference [p.65] nodes (when these are in use; see
the description of
EntityReference for discussion). Because the DOM Core is not aware of
attribute types, it treats all attribute values as simple strings, even if the DTD or schema declares
them as having tokenized [p.99] types.

Consider the following example,
...
<grobject apsid="someId" screentip="this object has a screentip" name="someName" model:part-number="AJX-20054321-B">
    <model:part-longdesc>Here is a verbose description of the
        AJX-20054321-B part, complete with source and replacement
        instructions.  Blah...blah...
    </model:part-longdesc>
</grobject>

One reasonable interpretation of the DOM2 text suggests that there would be several more text nodes in the example now, the strings:  "this object has a screentip", "someName", "AJX-20054321-B", "Here is a verbose description ...". 

So the final question is:  are these considered to be Text Nodes in the WebCGM DOM model?

Regards,
-Lofton.
  
  

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]