All pastes #165894 Raw Edit

Someone

public text v1 · immutable
·published 2006-09-10 09:27 UTC
rendered paste body
I have the following block of xml 

<somenode>
	<content id="1">
           <heading>Hello</heading>
           <text>This is just some random text</text>
        </content>
        <foo>
           <bar>more text</bar>
           <bar>more text2</bar>
        </foo>
</somenode>


I have the following xsl

<xsl:template match="/somenode" >
     <h2>
          <xsl:value-of select="/content/heading" />
     </h2>
     <p>
          <xsl:value-of select="/content/text" />
     </p>
</xsl:template>

which should output
<h2>Hello</h2>
<p>This is just some random text</p>

however if the system then prints out the 
"more text"
"more text"

Ideally i would like it to only print what I have matched and nothing else
as it may add other xml to the bottom of it which may be used in some xslt templates but not in others. i.e not every xslt template will take advantage of all of the xml which is output on a page.

Is there a way to do this with out doing a <xsl:template match="*" /> ..is there a reason why this is a bad idea ?