[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Embedded bold,italic,anchors etc.
Methinks you are thinking of XSLT as some sort of procedural language. It
is a declarative language - and you don't need to "program" it do do the
basic built in functionality.
This seems to be a hard thing for my students with a programming background to realize. They feel a compelling need to "program something". The XSLT processor will process your entire XML document, creating an in-memory tree of nodes. It is a hierarchical tree structure that is isomorphic to the structure of your document. Hence if you have have a structure <para><bold><italic>text</italic></bold></para>, then in the resulting tree, the node named para will have a child node named bold, that has a child node named italic, that has a child text node. It then traverses that tree of nodes, in document order, and at each node checks to see if you provided a template matching on that node. If you didn't - it executes a default template. If it does find a match, it executes that template. If the template has an apply-templates in it - it will continue processing all the children of that node, applying templates as it goes. You merely have to provide a template for para, bold, italic and anchors - and the processor will trigger the correct template at the correct place. You don't have to call anything - it is an automatic part of the XSLT processor. Cheers...Hugh CyberSpace Industries 2000 Inc. Multimedia Promotion XML Training and Consulting http://cyberspace-industries-2000.com ----- Original Message ----- From: "Craig Riley" <craig@xxxxxxxxxxxxxxxxxx> To: "Martin Honnen" <Martin.Honnen@xxxxxx> Cc: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, June 11, 2008 8:00 AM Subject: Re: Embedded bold,italic,anchors etc. Hi thanks for the reply, I have tried using the templates but the problem I had was where to call them from? I don't know how to get the replace to work within the body of text so to speak. -------------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG. Version: 8.0.100 / Virus Database: 270.2.0/1495 - Release Date: 6/10/2008 5:11 PM
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|