Re: hiding some of the source

Subject: Re: hiding some of the source
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Sun, 11 Apr 1999 15:48:04 -0400
At 11:52 AM 4/11/99 -0300, Matthew MacKenzie wrote:
>Hi,
>  I beleive someone else asked a question along these lines, but I don't
>think there was an answer.
>I have some xml data, which I am displaying in IE5 using xsl, it is
>script generated, as it is translating from a native database format to
>xml, and it is being used as part of a multi-user system, so I figured
>that a good way to customize the resultant output for each user was
>through adding a section in the xml which specifies some options, like
>this:
>
><PRODUCTS>
><XSLCONTROL>
	[....]
></XSLCONTROL>
>
>    <PRODUCT>
>        <PLINK
	[....]
>    </PRODUCT>
></PRODUCTS>
>
>Now, the problem is that the contents of <XSLCONTROL>* always display,
>when all they are there for is so that the style sheet can import
>formatting and other info dynamically.  I don't want them to show up
>unless I tell them to.  

Matt, I'm the one that asked about suppressing source-tree elements before.
Since then, I've found that one thing that works is to establish empty
template rules (i.e., containing only the pattern and no template) for the
content you want to suppress. Using your above example, something like this:

	<xsl:template match="XSLCONTROL">
	</xsl:template>

	<xsl:template match="PRODUCT">
		<xsl:apply-templates/> <!-- other template stuff, if any -->
	</xsl:template>

The absence of a template for XSLCONTROL works to suppress it, and all its
descendants, while the presence of a template for PRODUCT copies the
contents of the PRODUCT element (and its descendants) to the result.

Btw, I'm using XT as an XSL processor. I don't know if IE5 behaves the same
way.

==========================================================
John E. Simpson            | The secret of eternal youth
simpson@xxxxxxxxxxx        | is arrested development.
http://www.flixml.org      |  -- Alice Roosevelt Longworth


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


Current Thread