xsl-list
[Top] [All Lists]

RE: [xsl] Identity transform on node-set loaded with document()

2007-08-02 01:10:22
Template rules use a match pattern to identify nodes, and unless you try
really hard to prevent it, they will match nodes in any document. For
example, <xsl:template match="*"> will match any element in any document. So
if you've have written an identity transformation, you can apply it to your
document simply by applying it - <xsl:apply-templates
select="document('abc.xml')/head"/>, for example. 

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Matt Poff [mailto:matt(_dot_)poff(_at_)headfirst(_dot_)co(_dot_)nz] 
Sent: 02 August 2007 01:27
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Identity transform on node-set loaded with document()

Hi,

I've been away from XSLT a while and am stumbling on how to 
implement the following:

My transform imports, using document(), an HTML snippet 
contain a populated <head></head> tag. I want to copy this 
into one of several result trees I am outputting  as is 
*except*  the <title/> tag needs to be populated with a  value.

Initially I created a named template and sent the loaded 
node-set to it, then realised I probably needed an identity 
transform but all of the identity transform examples I've 
found seem to be set-up to operate on the master document 
only. What's the best way to carry out this task? 
Can I do an identity transform with a named template?

I'm sure there's a fairly simple solution but it's passing me by.

Thanks,
Matt

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--