Alex Rivera | Logout

Can I create a value for a missing tag in XPath?

Asked 2008-09-02T19:25:38.793
10

I have an application which extracts data from an XML file using XPath. If a node in that XML source file is missing I want to return the value "N/A" (much like the Oracle NVL function). The trick is that the application doesn't support XSLT; I'd like to do this using XPath and XPath alone.

Is that possible?

Edit
Report

1 Answer

3

Short answer: no. Such a function was considered and explicitly rejected for version 2 of the XPath spec (see the non-normative Illustrative User-written Functions section).

answered 2008-09-02T20:01:25.993

Your Answer