Subject: [xsl] template matching using namespace From: "Nima Kaviani" <nkaviani@xxxxxx> Date: Tue, 28 Nov 2006 22:54:13 -0800 |
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>
<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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] invoking nodes from multi, Florent Georges | Thread | Re: [xsl] template matching using n, James A. Robinson |
RE: [xsl] transform from flat to hi, Ken Tam | Date | Re: [xsl] template matching using n, James A. Robinson |
Month |