Subject: [xsl] Using XPath to combine text from multiple nodes?|
Date: Wed, 31 Aug 2005 16:41:52 +0200
Hi guys & girls, Is there any way to write an XPath expression that will combine the text within two nodes and return a text node that contains the combined strings. Maybe concat and do what I want, but I have been unable to think of a way to use the concat function to do what I am after. For an example: <Employee first="Mark" second="Allanson" /> What I would like to do in this case is to effectively return a node that contains the text "MarkAllanson". Although I don't think this would affect any solutions, the xpath processor is the .Net Framework v1.1. Another solution I guess would be to be able to write an XPath that could return node list, and I could then iterate the nodes in code to compile the string in code; This raises another question of can you use XPath to select nodes from two distinct areas of code. For example: <Work> <Employee first="Mark" last="Allanson" /> <Address> <City>London</City> </Address </Work> Is it possible to write an XPath to return a node list that contains both the first attribute of the employee and the City element of the address? Any idea's most welcome! Cheers, Mark This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.