XQuery looking for text with 'single' quote

后端 未结 6 565
轻奢々
轻奢々 2020-12-03 18:33

I can\'t figure out how to search for text containing single quotes using XPATHs.

For example, I\'ve added a quote to the title of this question. The following line<

6条回答
  •  庸人自扰
    2020-12-03 19:12

    In XPath 2.0 and XQuery 1.0, the delimiter of a string literal can be included in the string literal by doubling it:

    let $a := "He said ""I won't"""
    

    or

    let $a := 'He said "I can''t"'
    

    The convention is borrowed from SQL.

提交回复
热议问题