Ambarish Mitra <[EMAIL PROTECTED]> writes: > <ObDirectMemberOfGroups> > <ObGroup> > </ObGroup> > <ObGroup> > </ObGroup> > </ObDirectMemberOfGroups> > > That is, the tags on separate lines. Now, the code prints the number of > children as "5". Upon investigation, I found that the 3 extra tags are > coming as "Text" tags with values as "#text", and they are inter-leaved with > the 2 expected Element tags "ObGroup".
Those are not tags, they are text nodes that represent newlines. > How can I tell the parser to treat the same as a stream, and not to consider > the newlines or the white-spaces as text tags? The only way that I am aware of is to use a grammar (e.g., XML Schema) and set the DOMWhitespaceInElementContent feature to false in order to instruct the parser to remove ignorable whitespaces from the document (whether a whitespace is ignorable or not is determined from the schema). Boris -- Boris Kolpackov Code Synthesis Tools CC http://www.codesynthesis.com Open-Source, Cross-Platform C++ XML Data Binding
