XPath - Contains function
  • I'm trying to match a partial value to something in my Vae collection using the following XPath function contains:
    path = rings[contains(sku,'ME')]
    rings is my collection, sku is the field in the collection I want to search and "ME" is what I'm searching for.

    But Vae shoots me back an error: http://cl.ly/f152885e8ae89059f6d6

    Don't know if this helps, but here is a link to the moz dev forums: https://developer.mozilla.org/en/XPath/Functions/contains about the function.

  • 4 Answers sorted by
  • Question, would this work:

    path = rings[contains(sku,'ME')=1]

    I don't know enough about XPath to answer that question, but that might work around some of the VaeQL weirdness. Give it a try.

  • Currently we don't support boolean XPath functions. This is honestly the first case I've ever seen someone trying to use them. I'd be up for trying to add this capacity, but I can't project a date when it would be available. Watch this thread for announcements.

  • Scott, if you are using VaeML you can try using the "filter" attribute:

    <v:collection path="/your_path" filter="your_query">

  • FYI, Kevin's solution worked for me

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion