Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Contains Function!!! Please Help me (XPath)

Contains Function!!! Please Help me (XPath)

Scheduled Pinned Locked Moved XML / XSL
databasequestionxmlhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Masterhame
    wrote on last edited by
    #1

    I want to make a query that works like 'LIKE' in SQL I want to retrive nodes that starts with 'X' or any starting string Or containg 'X' I write this XPath: Message[Contains(@Title,'5')] But it's wrong!! how can I do?? plz help me <code> <Message MessageID="1" Title="Title1" Icon="Information" Buttons="Ok"> <Parts Part="part333333" /> <Parts Part="part333333" /> <Parts Part="part333333" /> </Message> <Message MessageID="2" Title="Title2" Icon="Information" Buttons="Ok"> <Parts Part="part333333" /> </Message> <Message MessageID="3" Title="Title3" Icon="Information" Buttons="Ok"> <Parts Part="part33XXXX3333" /> <Parts Part="YYpart53" /> </Message> <Message MessageID="4" Title="Title4" Icon="Information" Buttons="Ok"> <Parts Part="YYpart53" /> </Message> </code>

    L 1 Reply Last reply
    0
    • M Masterhame

      I want to make a query that works like 'LIKE' in SQL I want to retrive nodes that starts with 'X' or any starting string Or containg 'X' I write this XPath: Message[Contains(@Title,'5')] But it's wrong!! how can I do?? plz help me <code> <Message MessageID="1" Title="Title1" Icon="Information" Buttons="Ok"> <Parts Part="part333333" /> <Parts Part="part333333" /> <Parts Part="part333333" /> </Message> <Message MessageID="2" Title="Title2" Icon="Information" Buttons="Ok"> <Parts Part="part333333" /> </Message> <Message MessageID="3" Title="Title3" Icon="Information" Buttons="Ok"> <Parts Part="part33XXXX3333" /> <Parts Part="YYpart53" /> </Message> <Message MessageID="4" Title="Title4" Icon="Information" Buttons="Ok"> <Parts Part="YYpart53" /> </Message> </code>

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Masterhame wrote:

      how can I do??

      Well you can only do what XPath supports. Also you might find that the latest XPath standards are not fully supported by many of the XPath implementations so you need to check the specific engine you are using to determine what standard it supports.

      led mike

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups