• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

doubt in xpath

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i need to write an xpath which is similar to like in sql.any operator is there for it.suppose i need to fetch name starting with 'pra' or ending with 'bhu'.is there any option there in xpath,if not how to do??
thanx in advance,
regards,
prabhu
 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try looking at the XPath String functions.
contains() -> look for a pattern in a string
starts-with() -> starts with the specified string
I haven't had to use them in any of my XSL, but hopefully it will work for you.
HTH
Brian
 
prabhu palanisamy
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i want that function to be used in xpath,i think that those functions are used in xsl:value-of tag.will this work in xpath ie in xsl:for-each tag
regards
prabhu
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. However, you have to use the name() function to get the name of the element before you can compare the name using the two string functions suggested.
------------------
Khun Yee Fung
Author of XSLT: Working with XML and HTML
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!