escaping characters in predicate expressions
  • i am trying to use single quotes inside a predicate expression because for some items, size = 5'9"

    however, when I use a char entity or when I escape it with a slash, I get zero results.


    <v:collection path="products[options/size='5'10']">
    </v:collection

    results in an error


    <v:collection path="products[options/size='5\'10']">
    </v:collection


    <v:collection path="products[options/size='5'10']">
    </v:collection



    Gives me zero results

  • 2 Answers sorted by
  • This one is a bit tricky because there's already a quote being used in the HTML. What does work is this:

    <v:set_default name="dummy" value="5'10" />
    <v:collection path="products[options/size=$dummy]">


    A bit verbose, but hey, it does work!

  • Sweet! Thanks

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