xsl-list
[Top] [All Lists]

[xsl] template matching using namespace

2006-11-28 23:54:32
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

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>