> Hi all,
> I've basically written a small method that parses all elements of my XML
> document. For each element, it prints out its name, value and type. I
> retrieve the root node, then I retrieve its childs. Recursively I parse
> childs of childs etc.
>
> I've made it parse this very simple doc:
> <?xml version='1.0' encoding='ascii'?>
> <dsi:Information xmlns='http://www.w3.org/2001/XMLSchema'
>  xmlns:dsi='http://www'>
> <dsi:Alarm>toto</dsi:Alarm>
> </dsi:Information>
>
> I'm surprised it returns two nodes with name #text and no value... I'm
> sure this is a pretty basic question, but what do those nodes represent
> ? what are they for ?

They do have a value -- they have whitespace-only text, which is considered
significant unless there is a DTD or schema that says it's not.  Try
parsing this document to understand the difference:

<?xml version='1.0' encoding='ascii'?>
<dsi:Information xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:dsi='http://www'><dsi:Alarm>toto</dsi:Alarm></dsi:Information>

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to