xpath - Specify default value in case of an empty nodeset -


using xpath 2.0, how can specify default value in case of empty node set? i'd able tune of $datatypes/type[@key="somevalue"] or "default value" have default value returned if key not found.

may not looking for, think need have conditional expressions.

therefore try this:

if ($datatypes/type[@key="somevalue"])  $datatypes/type[@key="somevalue"]  else "default value" 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -