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
Post a Comment