[xsl] [XSL] Controlling Output Based on XML Processing Instructions

Subject: [xsl] [XSL] Controlling Output Based on XML Processing Instructions
From: Matthew Jaquish <mjaquish@xxxxxxxxx>
Date: Fri, 18 Jan 2002 13:30:37 -0800
Dear fellow list members;

Question: Is it possible to use XML processing instructions from the source XML document to control what is included in the output tree?

Example:
<xmlRoot>
  <parent>
    <child1/>
    <?insertStart?>
    <child2/>
    <?insertEnd?>
    <?deleteStart?>
    <child3/>
  </parent>
</xmlRoot>

Now, since XML processing instructions are not considered part of the XML node hierarchy, is it possible to use them in XSL to control things such as whether anything between the <?insertStart?> and <?insertEnd?> is included in the XSL output and anything between the <?deleteStart?> and <?deleteEnd?> is not included in the output?

I know that it is possible to use the processing-instruction() function to get the name and text values of the content, but it seems that it would be difficult to use this to control the output. Has anyone done anything like this before?

I appreciate your input,

...Matt


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread