RE: [xsl] Thinking Out loud - XML or XSL for boiler messages

Subject: RE: [xsl] Thinking Out loud - XML or XSL for boiler messages
From: "Jim Fuller" <jim.fuller@xxxxxxxxxxxxxx>
Date: Sun, 29 Feb 2004 23:18:07 -0000

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Karl J. Stubsjoen
> Sent: 29 February 2004 21:45
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] Thinking Out loud - XML or XSL for boiler messages
> Precisely what I was looking for...
> I've asked similar question before, but because the data I 
> was retrieving was wrapped within an attribute this sort of 
> template processing would not work.  At this point, I do not 
> have this trouble, the XML source is 100% my conception (the 
> other is an ADO XML recordset).

A more elegant way would be to have a separate xml file with lookup

xml file
<?xml version="1.0" ?>
<para>Dr <firstname/>, Please read this letter</para>

Lookup xml file ( lookup.xml )
<?xml version="1.0" ?>

xsl file
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
	<xsl:output method = "html"/>
	<xsl:variable name="lookup-data"
	<xsl:template match="resource">	
			<xsl:apply-templates select="para"/>
	<xsl:template match="para">
	<xsl:template match="*">
	<xsl:variable name="currentname" select="local-name()"/>

This lets u generate a lookup file to refer to, without generating a
whole bunch of xsl:templates...though u could use this technique with
xsl:param. This assumes though that you have no useful markup embedded
in your text other then tokens to be replaced, though you could easily
handle this by either using a namespace on the elements and a general
matching template for those, for example html:* elements could be
embedded in text with a matching xsl:template to just process them
normally...up to you.

Once again there are other methods.

gl, Jim

 XSL-List info and archive:

Current Thread