[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Identity transform on node-set loaded with documen

Subject: RE: Identity transform on node-set loaded with document()
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 2 Aug 2007 09:10:00 +0100
RE:  Identity transform on node-set loaded with documen
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.poff@xxxxxxxxxxxxxxx] 
> Sent: 02 August 2007 01:27
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.