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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top