How can I use the document() function in BW 5.x to return an XML shared resource as an XML string?Why is this behavior different than 2.x?

How can I use the document() function in BW 5.x to return an XML shared resource as an XML string?Why is this behavior different than 2.x?

book

Article ID: KB0086634

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
If you use a document() function, as in: document("tibcr://myXMLFile.xml"), the XSLT engine should return the XML as a node, or parsed XML.  This is why you can XPath over it, like: document("tibcr://myXMLFile.xml")/root/child.
  
If you use document("tibcr://myXMLFile.xml") as the formula for a text field, the correct output should be just the values of the elements, not the XML with the markup (element names).

In 2.x, the output was the XML as a string, including the markup.  

In 5.x, the behavior has been changed to be more standards-compliant.  If you need an XML string, there is a TIBCO function that will give that result:   tib:render-xml(document("tibcr://myXMLFile.xml"))

The tib:render-xml() function will take a node set and render it as a string with the markup intact.

Issue/Introduction

How can I use the document() function in BW 5.x to return an XML shared resource as an XML string?Why is this behavior different than 2.x?