I know xmlstarlet fails when I pass that var containing an apostrophe.

It produces an XPATH error: Invalid Expression

The output shows an arrow pointing to the first character after the apostrophe.
In this case the variable contained "He's Just Not That Into You" and the arrow (a carat) was below the first "s"

The whole error output echoed back the variable name in single quotes, so perhaps when xmlstarlet sees its passed parameters from bash it's seeing them in single quotes? This would then obviously cause the first open quote to be closed by the apostrophe.

_________________________
Bruno
Twisted Melon : Fine Mac OS Software