xml - xsl:for-each test a wildcard element -
i trying loop through xml until find element contains string of text.
take simple xml example.
<document> <item> <thing1>fee</thing1> <thing2>fi</thing2> <thing3>fo</thing3> <some blah="thingy">fum</some> <another>i smell</another> <other>someone</other> </item> </document>
i want able search through element/s contains "thing", have seen done before attribute so...
<xsl:for-each test="contains(@blah,'thingy')"></xsl:for-each>
but want search "thing1, thing2, thing3" , obtain <xsl:value-of select"." />
fee, fi, , fo. need exclude other elements aren't going contain string "thing"
try:
<xsl:for-each select="*[contains(name(), 'thing')]">
or, better fit given example:
<xsl:for-each select="*[starts-with(name(), 'thing')]">
both called context of item
.