Is it possible to select all XmlTextNodes in a XmlDocument with SelectNodes() ? How does such xpath look like? Don't want any XmlElements, only XmlTextNodes.
* Anonymous wrote in microsoft.public.xml: >Is it possible to select all XmlTextNodes in a XmlDocument with >SelectNodes() ? >How does such xpath look like? Don't want any XmlElements, only >XmlTextNodes. Use text() to address text nodes, http://www.w3.org/TR/xpath#node-tests -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Anonymous wrote: > Is it possible to select all XmlTextNodes in a XmlDocument with > SelectNodes() ? > How does such xpath look like? Don't want any XmlElements, only > XmlTextNodes. //text() selects all text nodes in the XPath data model. If you operate on a DOM model you can run into slight differences between the XPath data model and the DOM model as DOM can have adjacent text nodes and distinguishes between normal text nodes and CDATA section nodes which the XPath data model does not. These are edge cases however and in lots of scenarios selecting //text() on a DOM model should give you the XmlTextNodes in the document. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/