XPath to return default value if node not present

后端 未结 5 1902
无人及你
无人及你 2020-12-05 05:53

Say I have a pair of XML documents


    
    mystring

and



        
5条回答
  •  感情败类
    2020-12-05 06:05

    If you are okay with printing an empty string instead of 'not-found' message then use:

    /Foo/concat(Baz/text(), '')
    

    Later, you can replace the empty strings with 'not-found'.

提交回复
热议问题