need test expression for all "unhandled" text

K

KJ

My xslt has xsl:templates that match a large majority of the xml in our
xml files.

What I would like to do is create a test expression that matches any of
the tags or text that these templates have missed.

This is so I can flag the missed items and display them with a visually
loud sytle, so they stand out until I create templates that match them
all.

Any suggestions as to how to do this are appreciated!

-KJ
 
M

Martin Honnen

KJ said:
My xslt has xsl:templates that match a large majority of the xml in our
xml files.

What I would like to do is create a test expression that matches any of
the tags or text that these templates have missed.

This is so I can flag the missed items and display them with a visually
loud sytle, so they stand out until I create templates that match them
all.

You can use
<xsl:template match="node()">
to match any kind of node.
Then add other templates with a higher priority.
 
K

KJ

Thank you. For priority, should I use the priority attribute of
xsl:template (and thus create my own priority scheme) or just rely on
the default priority?

Also will <xsl:template match="node()"> be fired only for those nodes
not already matched by other templates, or will it fire for all
regardless?
 
M

Martin Honnen

KJ said:
Thank you. For priority, should I use the priority attribute of
xsl:template (and thus create my own priority scheme) or just rely on
the default priority?

Also will <xsl:template match="node()"> be fired only for those nodes
not already matched by other templates, or will it fire for all
regardless?

It will be called for those nodes where there is no template with higher
priority so you need to make sure you have more specific templates for
the nodes you want to treat.
 
D

Dimitre Novatchev

Martin Honnen said:
You can use
<xsl:template match="node()">
to match any kind of node.
Then add other templates with a higher priority.


Warning: Be aware that if you import other stylesheets module in the
stylesheet that contains the node() - matching template, *any* templates in
the imported stylesheets will never be selected for processing, as the
node() - matching template has a higher import precedence.


Cheers,
Dimitre Novatchev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,247
Members
46,844
Latest member
JudyGvh32

Latest Threads

Top