env: XBD731 early release candidate
prob/question: i have the following situation:
using EntireX XML wrapper gateway to get information from natural backend service. the xml document returned will be put into second payload message part with an user-defined content-id. now i like to use a transformer step to put this xml document or one information out of this second document into the original one using style sheet extensions like redirect. i got already two small examples but i am still confused. does anybody has simalar done already.
Hi Michael,
The answer is actually quite simple. I will draw it out for you… first the Message coming into the XSLT:
{
xbd.current.contentID= Mycontent1
xbd.current.contentID.URL = cid:Mycontent1
Content-ID = Mycontent1
Content-ID = Mycontent2
Content-ID = Mycontentn/>
<Mycontentn-xml message/>
}
The Mediator defines a “xbd.current.contentID” and a “xbd.current.contentID.URL” property itself based on the original message. Unless you change this, it will always remain the same. In your XSL you can retrieve XML nodes from whatever contentID you wish by using the document() function.
It looks like this:
<xsl:copy-of select=“document(‘cid:Mycontent2’)/"/>
This will select the Node, into my new document. In the event your transformation should create an entirely new content-ID you can yccomplish this with the cid-redirect extension. This might look like:
<cid-redirect:write cid=“MycontentX” content-type=“text/xml”>
<xsl:copy-of select="document(‘cid:Mycontent2’)/”/>
</cid-redirect:write>
Which would write the contents of contentID Mycontent2 into a newly created message part MycontentX.
I hope that helps some.
Regards,
Matthew
- Matthew G.