Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Few Questions about org.w3c.dom.Element

From: "Mike Schilling" <mscottschilling@-------.--->
To: NULL
Date: 4/10/2008 9:31:00 PM


"RC" <raymond.chui@n...> wrote in message 
news:ftm02s$ln2$1@n......
> In that org.w3c.dom.Element interface
>
> I can getTagName()
> But
> 1) How do I do know is it an empty tag or not?
>
> <tag ..... />
>
> 2) How do I know when will be a close tag?
>
> <tag1>
> <tag2>xxxx</tag2>
> <tag3 ..... />
> <tag4 ..... />xxxxx</tag4>
> ......
> </tag1>
>
> Thank Q very much in advance!

org.w3c.dom.Element doesn't represent the start tag; it represents the 
entire element.  Anything occuring between the start and end tag will beomce 
children of that element.  E.g.

<start>This is <i>italicized</i>text.</start>

resluts in five Nodes:

1. An Element with the tag name "start"
2. A Text with the node value "This is "
3. An Element with tag name "i"
4. A Text with the node value "italicized"
5. A Text with the node value "text."

2, 3, and 5 are (in that order) the child node of 1.  4 is the child of 3.

And in DOM, there's no way to distinugish between, say,

    <start></start>

and

    <start/>

In both case, you see an Element wth no children.




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent