XSL transformation question
- Hi all,
I would like to turn XML content into XSL-FO. A sample of the XML is
below. I want to transform this XML into XSL-FO that describes Hello
World in bold and italic. How can I accomplish the transformation?
It is easy to transform nested XML descriptions into inline FO
elements. For example:
Part of the XSL style sheet can defined as:
This matches a text element in the XML and applies a block. Within
the block the child elements are processed via the apply templates
call. The bold template is called because of this, which adds an
inline fo element to identify bold text. Within the bold fo element
apply templates is called which will write out the text, Hello
World. This is recursive, and each end tag is applied accordingly.
This type of logic applied to the actual XML document will not work
because using recursion to write out inline fo tags will not write
out the text Hello World within those tags. Hello World is found
after the formatting tags!
I think some sort of function needs to be written at the CONTENT
template level. But I am not sure on how to proceed.
What do you think about this scenario? How can I solve this?