[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Matching text nodes with only whitespaces
> I need to write a template matching text nodes, which just consit of > multiple whitespaces (tabs in most cases). > I cant't use normalize-space since I need leading and tailing > whitespaces in some cases. > I suppose matches() would help me here, but I actually don't > know how to > formulate the regular expression for that. Perhaps I've misunderstood, but... If you want to match a text node that consists entirely of whitespace you can use xsl:template match="text()[normalize-space()='']" The value of "." inside the template rule will still be the original text node; testing its value using normalize-space does not modify the contents of the node. Michael Kay http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|