[xsl] Select all heading tags

Subject: [xsl] Select all heading tags
From: "Graeme Kidd" <coolkidd3@xxxxxxxxxxx>
Date: Tue, 30 Dec 2008 05:06:16 -0000
Hi

I was wondering how I would be able to pick up headings from <sect> when I don't know what heading numbers will be used. What would be nice is to simply be able to say "select the tag which starts with a 'h' and ends in a number". Any idea how you would do this?

An example that obviously wont work is this:
XSL
...
<xsl:apply-templates select="h*" />
...
<xsl:template match="h*">
   <title>
	<xsl:value-of select="h*"/>
   </title>
</xsl:template>
...
XML Input
<root>
<sect>
   <h1>Heading 1</h1>
   <part>text</part>
</sect>
<sect>
   <h4>Heading 4</h4>
   <part>text</part>
</sect>
<sect>
   <h9>Heading 9</h9>
   <part>text</part>
</sect>
</root>

XML Output
<root>
<sect>
<title>Heading 1</title>
</sect>
<sect>
<title>Heading 4</title>
</sect>
<sect>
<title>Heading 9</title>
</sect>
</root>


Current Thread