Xquery attribute value test with wildcard

J

jule

Hi

I am trying to build an xquery that should give all div-element with
class attribute which value is starting with "post". Something like
this:

/div[@class="post*"]

Any help? Thanks, Jule
 
M

Martin Honnen

jule said:
I am trying to build an xquery that should give all div-element with
class attribute which value is starting with "post". Something like
this:

/div[@class="post*"]

//div[matches(@class, '^post')]
 
M

Martin Honnen

Martin said:
jule said:
I am trying to build an xquery that should give all div-element with
class attribute which value is starting with "post". Something like
this:

/div[@class="post*"]

//div[matches(@class, '^post')]

For your simple requirement
//div[starts-with(@class, 'pos')]
should suffice but in general matches with regular expression support is
more powerful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,268
Messages
2,571,096
Members
48,773
Latest member
Kaybee

Latest Threads

Top