Dale,

Considering that this is valid:

<x>200<!-- commment in the middle of a value -->00</x>

even for a valid document (which I think you meant to say) you can't assume
that. This is just one example. I can think of at least a few others which
break your assumption.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"EXT-Pennington, Dale K" <[EMAIL PROTECTED]> wrote on 09/21/2007
12:10:11 PM:

> Folks,
>
> I want to know if the following is a reasonable assumption :
>
> Given an element specified in a schema as
>
> <xs:element name="x" type="xs:long">
>
> And decoding an XML document into a DOM using that schema as the
> validation rule.
>
> If I find the Element Node in the DOM tree with name x, can I safely
> assume it only has one Child Node which is a text node containing X's
> value.
>
> Obviously, assuming such would make my code simpler, but I do not want
> to insert bugs by making wrong assumptions.
>
> Thanks
>
> Dale Pennington

Reply via email to