XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
arvind viswanathanSubject: arguements that can be passed to template match attribute
Author: arvind viswanathan
Date: 15 Mar 2007 07:01 PM
Hi,
I am trying to process 2 xml documents at the same time in xslt. I get one of the documents by specifying the scenario.I try to create a variable for the other document and manipulate it and here is my situation.

I am creating a variable to refer to the document

e.g.,

<xsl:variable name="master" select="document('C:\Documents\op.xml')"/>

I try to apply templates in the following manner:

<xsl:apply-templates select="$master/foaf:Person/foaf:name">

Now I have a problem when I try to specify the pattern for the template match attribute. since I cannot use the variable name inside the match pattern, I tried to create a key and use it.

<xsl:key name="x" match="/foaf:Person/foaf:name" use="@*"/>

I try to get all the <foaf:name> tags.

now how do I mention the pattern in <xsl:template match="?">, to scan through all the foaf:name in the document.

Thanks
Arvind

Posttop
(Deleted User) Subject: arguements that can be passed to template match attribute
Author: (Deleted User)
Date: 16 Mar 2007 05:09 AM
Hi Arvind,
the match attribute of a template only looks at nodes, it doesn't care where that node comes from. So a simple <xsl:template match="foaf:name"> should be enough.

Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.