[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Put Xpath in variable
Hi Matteo,
Not sure how your xml looks like. Here's a guess: <field id="ViewState.desktop.content.runningActivities.activities.ShowTabs.tabItem.Show.content.ShowFncState.uxToShow.finder.currentFinder.ShowBasicSearchFinder.searchCriteria.criteria.subj.provMetadata.classMetadata" type="text" value="PROVINCIA" mode="read" /> Here's another guess: <field> <id>ViewState.desktop.content.runningActivities.activities.ShowTabs.tabItem.Show.content.ShowFncState.uxToShow.finder.currentFinder.ShowBasicSearchFinder.searchCriteria.criteria.subj.provMetadata.classMetadata</id> <type>text</type> <value>PROVINCIA</value> <mode>read</mode> </field> In both scenario's it is quite straightforward to use a variable, depending on what your needs are. For instance: <xsl:variable name="provider" select=" '.provMetadata.classMetadata' " /> In the XPath you could do the following: <xsl:value-of select=" field / id [ contains ( . , $provider ) ] " /> which will select all id nodes having a text content that contains the string part as set in the variable. The next variant will do the same for the attribute version: <xsl:value-of select=" field [ contains ( @id , $provider ) ] " /> HtH, Abel Braaksma http://www.nuntia.nl m.core@xxxxxxxxxxxxxxxx wrote: Hi all, this is a piece of my xml tree (node name: field with ( instead of < )
|
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
|