Patan
Patan

Reputation: 17893

How to pass output of one XSLT TBB to another XSLT TBB in SDL Tridion 2011 SP1

I am using XSLT mediator from SDL Tridion World to create an XSLT TBB. Here my requirement is like, I want to pass output of one XSLTTBB to another XSLT TBB.

Say I have an XSLT TBB named "1" where in I output:

<aaa>
hi 
</aaa>
<bbb>
hello
</bbb>

I want to write another XSLT TBB which takes the first TBB's output and processes the data into

<ccc>hi hello</ccc>

Consider the example as very generic. I am using Template Builder to combine two TBBs. But I am not getting the exact result.

Is it necessary to configure the XSLT Mediator for Template Builder too? If yes, show me how to do that.

If there is any such way, let me know. Thank you in advance.

Upvotes: 2

Views: 247

Answers (2)

Dominic Cronin
Dominic Cronin

Reputation: 6201

I'd suggest that you look to see whether you can improve your design so that you don't need to do this. In general, it's pretty unusual to need more than one "templating" TBB in your pipeline. In principle, you should be doing enough preparation (in assembly building blocks) before you reach the templating layer, and then you should be able to do it all in one go.

Upvotes: 1

Quirijn
Quirijn

Reputation: 3547

This is possible by using the template parameters as follows:

  1. TBB 1 is configured with output 'Temp' and Output format type 'Xml'
  2. TBB 2 is configured with input 'Temp' and output 'Output'
  3. TBB 2 is configured to load the package items as parameters
  4. Add to the top of TBB 2 (so that you can use the variable from within the XSLT using something like )
  5. You can make the output of TBB 1 either a String or an XmlDocumnet. If you use an XmlDocument, you can perform XPath queries on the variable in TBB 2.

It is not necessary to configure anything on the Template Builder, since the mediator is hosted on the TCM server.

Upvotes: 5

Related Questions