I created a xml document (say ram.xml) as a XML document utility resource in OSB sbconsole.
I want to refer this in message flow with fn:doc. Unlike xquery i can't assign ram.xml to a variable.
I tried fn:doc("/home/osbuser/user_projects/domains/domain_name/osb/config/core/ram.xml") and fn:doc("file:////home/osbuser/user_projects/domains/domain_name/osb/config/core/ram.xml") it didn't work!
I know if i store this xml as a xquery, it will get assigned to a variable. But i am just curious to see how fn:doc works!
The reason for this is to eliminitate each assign action for each of XMLs that I use. Each assign gets converted into a xml bean and thats overhead.
If this fn:doc() works, what i am planning is to use fn:doc() inside my xquery transformations directly, without using assign action to load XML.
Also message flow will become somewhat cleaner.
fn:doc() has to be used in a way that it uses relative path to access xml and not complete path (starting from /home/user_doamains/..) because development and production environment domain names are different. Using relative path, code can migrate without any change across environments.