OSB Xquery function if-absent example

17 Mar

Since I’m on a roll with Xquery functions let’s add an addition. Especially since the earlier example is a bit large for people looking for a simple example.

So maybe this helps better to get an understanding. After working with Tibco BusinessWorks for some years I used a lot off the internal tib:functions supplied out-of-the-box and always found it a disappointment that Oracle (read BEA here) didn’t offer such a nice catalog to help you out. So over time I added a lot off these functions to my own library.

For example the function if-absent helps me to prevent all these “is-value1-there-then-use-it-and-if-not-i-want-you-to-use-value2” checks.

declare function funcRBX:if-absent($arg as item()* , $value as item()* ) as item()*
  if (exists($arg)) then $arg else $value

Works like a charm … ;-)

Leave a comment

Posted by on 17-03-2011 in Oracle, OSB, XQuery


Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: