Showing posts with label XSL-TEXT. Show all posts
Showing posts with label XSL-TEXT. Show all posts

Tuesday, 8 July 2008

BIP XSL-TEXT Templates : Part 2

Not much changes in Birmingham.

It seems like an eternity ago that I was at university there - but after only a couple of hours and a fine Balti in a BYOB restaurant, I felt like I'd never left.

Anyway, enough of my weekend! Let's get back to XSL-TEXT templates.

Excluding XSL-FO, there are 3 different types of XSLT script templates available in BI Publisher. These are currently not greatly documented in the BIP User Guide. However, the difference between them is the format of the output created by the XSLT script i.e.:

XSL-HTMLA XSLT script to transform an XML document into a HTML file
XSL-XMLA XSLT script to transform an XML document into another XML document
XSL-TEXTA XSLT script to transform an XML document into a TEXT file


Note: The XSL element used to set the output type is:



Generally, it is a lot simpler to use an RTF or eText template to create the report layout - and I would ALWAYS recommend using an RTF or eText template where possible for this reason.

However, there comes a time when it may be easier to write XSL and XPATH directly rather than live with any shortcomings of the RTF or eText template type.

One such example of this is to add blank lines and additional formatting logic into eText templates.

In a previous blog on R12 Payments and eText templates, I built the following text file using an eText template:



Here is a XSL-TEXT template to build the same text file using the same R12 Payments XML data source:



A simple XSLT example... however, the point is that I can reference any XSL element, XPATH or extended SQL function directly. I have complete control over the layout of the text file being created.

Here are the source files:

Sample XML Data File
XSL-TEXT template

I built and tested this example using the BIP Enterprise Server (but this works equally well from Oracle E-Business Suite.)

To test this example using the BIP Server:

1) Create a new report and register the XML file as a data source:



2) Upload the XSL-TEXT layout template:



3) View the final transformed output:

Friday, 4 July 2008

BIP XSL-TEXT Templates : Part 1

Just a quick one from me today as I am of to sunny Birmingham for the weekend.

I've blogged a lot recently about ETEXT Templates and how they are used in BI Publisher to generate text files for EDI and EFT:

ETEXT Part 1


ETEXT templates are a great way of creating simple fixed or delimited text files and the Oracle Payments team have delivered loads of predefined ETEXT templates for Payments processing.

However, they are not the only way to generate text files from BI Publisher!

It is also worth considering XSL-TEXT templates.

I've found that XSL-TEXT templates are really just XSLT scripts that transform the XML into text output only.

Note:
xsl:text is actually an element or command of XSLT to write literal text strings, entity references and #PCDATA to the output file.

If you are scratching your head over what XSLT is... then, a great reference to get you up and running quickly is the W3schools tutorial.

In my next post, I'll walk through some examples of XSL-TEXT templates - but first, I have to go and join the queues of traffic trying to leave London. No fun at 5pm on a Friday night!