|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using XPath to combine text from multiple nodes?
>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" /> Perhaps I'm going to bring up a stupid question and avoid a possibly interesting discussion about XPath, but in the entire grouping of similar emails from the past couple days I have to wonder why is it necessary to do this in one XPath? Why not: <xsl:value-of select='@first'/><xsl:value-of select='@second'/> or more generically (I'd actually put it in a template) <xsl:for-each select="@*"><xsl:value-of select="." /></xsl:for-each> Of course, a second glance tells me you might not even be using XSL....but since this is a mailing list for it I think my examples aren't too out of scope. You should be able to apply something similar. I don't see why concat wouldn't work, but without any more details there isn't much to go on... without playing with the xpath too much something like concat(string(@first),string(@second)) should work, if the objects aren't automatically converted to string. If they are, concat(@first,@second) should work just dandy, I'd imagine. > 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? Ummm, you can make an Xpath that unions the two by using the Union operator. See the second line in the section 3.3 Node Sets in the XPath specs http://www.w3.org/TR/xpath Jon Gorman
|
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
|

Cart








