P
Phantom
I'm wondering if anyone knows a trick to iterate a FLWR expression
across a literal string that is delimited by spaces.
e.g.
for $x in ("apple orange banana blueberry")
obviously, this doesn't work, since the string is delimited by a space
rather than being well-formed XML.
how would one get around this? I have no control over the incoming XML,
so I can't enforce proper encoding... I have to work across the string.
it did occur to me just to slice apart the string and do a for $index
in (1 to $wordCount) , but I couldn't figure out how to count words
within Xpath.
thanks in advance.
p
across a literal string that is delimited by spaces.
e.g.
for $x in ("apple orange banana blueberry")
obviously, this doesn't work, since the string is delimited by a space
rather than being well-formed XML.
how would one get around this? I have no control over the incoming XML,
so I can't enforce proper encoding... I have to work across the string.
it did occur to me just to slice apart the string and do a for $index
in (1 to $wordCount) , but I couldn't figure out how to count words
within Xpath.
thanks in advance.
p