Project

Profile

Help

Valid Conditional stop of xslt transform

Added by Anonymous almost 16 years ago

Legacy ID: #6113370 Legacy Poster: saul simhon (saulsim)

Hi, I have an xml document that I need to 'partly' process. I have implemented all the handlers for the elements using <template match="xxx">. Now the question is, can we stop the process in an arbitrary location under certain conditions. For example, when we match a particular node, I'd like transformer to stop the tree recursion, pop the stack and close all the existing elements and end the processing. Here is a case or criteria that i am attempting to implement: "transform the document as per the defined rules, up until the fist element called 'list'. The output should be the transformed document excluding the content from any element that is 'after' the first occurrence of the <list> tag. If there is no way to do this by stopping the process. Any suggestions how to accomplish this? If we had global variables, I can add a conditional in each template to check if the global variable is true. And i would set it to false in the template that matches <list>. But that will not work. Any tricks?


Replies (1)

RE: Valid Conditional stop of xslt transform - Added by Anonymous almost 16 years ago

Legacy ID: #6122139 Legacy Poster: Michael Kay (mhkay)

This is an XSLT coding question, nothing specific to Saxon, so I would suggest you ask it on the xsl-list at mulberrytech.com. Be sure to say whether you are using XSLT 1.0 or 2.0, and to make it clear what you need, include a specimen source document and your desired output.

    (1-1/1)

    Please register to reply