BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XSLT
Padding with XSLT
Preceding-subling XSL
Basic Shapes to Paths with TinyLine
XML to CSV using XSLT
Cross-Browser display of XML/XSL
Cross Reference Lookup in XSLT using XML file as Xref table
Recursion reminds me of Recursion (9 XSLT Recursion examples)
XSLT Sort - output entire xml file with new sort order
Variable Variables
Cross Reference Lookup in XSLT using embedded XML
XTrans 1.0
XML Explorer 2.5
Create an N-Column Table from XML node-set
XSLT Select Option Example
XSLT Date filtering, sorting, comparing, and evaluating
XSLT Template for HTML INPUT Tag
XSLT Template for HTML IMG Tag
XSLT Search and Replace Template
Word wrap and text replace templates for XSLT
nxslt 1.3


 
 

<< XQuery.NET and XML >>


By Conor Ryan
First Posted 04/09/2003
Times viewed 788

Whitespace-stripping


Summary This XSLT loops sorts a nodeset and identifies any node which matches a parameter value passed to the stylesheet.

This was actually done as a response to a question posed on the XSL-Talk list hosted by TopXML. The original poster wanted to match certain nodes based on a parameter passed to the stylesheet but wasn't getting all the required nodes due to surplus whitespace in the node value. The XSLT is particular to the attached source document but may be easily changed to suit any source document.

The key to it is the normalize-space() function which strips leading and trailing whitespace from a string. This ensures that the strings 'X' and 'X   ' both get matched. The xsl:sort element sorts the matched nodes according to the Id element value in ascending order.


 

Additional information

Further additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XQuery.NET and XML >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML