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

template matching using namespace

Subject: template matching using namespace
From: "Nima Kaviani" <nkaviani@xxxxxx>
Date: Tue, 28 Nov 2006 22:54:13 -0800
name kaviani
Hi list,

Once again your help with my 2 questions will be highly appreciated.

First, I have a template in which I only use the namespace to filter
out the elements. But based on the content I want to behave in
different ways inside the template. So, let's say I have the snippet
below

<constraint:SimpleConstraint rdf:ID="ph_student">
	 <constraint:subject rdf:resource="#var1"/>
	 <constraint:predicate rdf:resource="&rdf;type"/>
	 <constraint:object rdf:resource="&univ;PhD"/>
	 <policy:desc>PhD student</policy:desc>
</constraint:SimpleConstraint>

<constraint:And rdf:ID="andedConstraints">
	 <constraint:firstt rdf:resource="#isPhdStudent"/>
	 <constraint:second rdf:resource="#isLivingInOurLab"/>	
</constraint:SimpleConstraint>

<constraint:SimpleConstraint rdf:ID="oredConstraints">
	 <constraint:firstt rdf:resource="#wasPhDStudent"/>
	 <constraint:second rdf:resource="#wasWorkingInOurLab"/>	
</constraint:SimpleConstraint>

and the following template:

<xsl:template match="constraint:*">
<!-- some code -->
</xsl:template>

if I apply my template to the XML file above then it will catch all
the three elements. is there any way I can find out which one is
currently being caught by the current template that the program
counter is in?

I know I could have 3 different templates defined, with the element
names explicitly written, but then I have to have redundant code that
I prefer to avoid.


My second question, is there any way I can identify and copy those parts of the code that have not been caught by any of the defined XSLT template, to the output?

thanks a lot,
-Nima

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-2011 All Rights Reserved.