Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Template Matching the Root Node

Status
Not open for further replies.

montek

Programmer
Jun 13, 2000
27
0
0
US
I am trying some XSLT transformations and barely know what I'm doing. =) That being said, I have had some luck, but am having a problem (mostly with understanding) something specific.

First off, I am using ASP (and the MS XML object: Server.CreateObject("Microsoft.XMLDOM")) to process *part* of an SMIL document into HTML. The first thing I'm doing in ASP is grabbing a particular node and its subtree (because I don't want the whole document). I'm accomplishing this with the following code:
Code:
Set oNodeList = xmlDoc.getElementsByTagName("say")
set oPanel = oNodeList(panel) 'To get a particular "say" panel
This gives me this SMIL node:
Code:
<say end=&quot;submit&quot;>
	<p>
		To begin with, how likely are you to <font color=&quot;#ff0000&quot;><b>visit Internet sites</b></font>?
	</p>
	<input type=&quot;group&quot; name=&quot;int&quot; title=&quot;Internet Visitation&quot;/>
		<input type=&quot;radio&quot; name=&quot;int&quot; value=&quot;1&quot;/>Regularly<br/>
		<input type=&quot;radio&quot; name=&quot;int&quot; value=&quot;2&quot;/>Occasionally<br/>	
		<input type=&quot;radio&quot; name=&quot;int&quot; value=&quot;3&quot;/>Seldom<br/>	
		<input type=&quot;radio&quot; name=&quot;int&quot; value=&quot;4&quot;/>Never<br/>	
		<input type=&quot;radio&quot; name=&quot;int&quot; value=&quot;5&quot;/>Don't Know<br/>	
	<p>
		<input type=&quot;submit&quot;/>
	</p>
</say>

Then I use this code to transform the document and print it ou:
Code:
set xsl = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
xsl.async = false
xsl.load(Server.MapPath(&quot;script.xsl&quot;))
Response.Write oPanel.transformNode(xsl)

And all is lovely, for the most part. Here's the XSL:
Code:
<?xml version=&quot;1.0&quot;?>
<xsl:stylesheet xmlns:xsl=&quot;[URL unfurl="true"]http://www.w3.org/TR/WD-xsl&quot;>[/URL]

<xsl:template match=&quot;/&quot;>
	<hr /> <h1>HELLO WORLD</h1>
     <xsl:apply-templates/>
</xsl:template>

<xsl:template match=&quot;* | text() | @*&quot;>
     <xsl:copy>
          <xsl:apply-templates select=&quot;@*&quot;/>
          <xsl:apply-templates/>
     </xsl:copy>
</xsl:template>

<xsl:template match=&quot;input[@type = 'group']&quot;>
	<h1>INPUT TYPE = GROUP OMITTED</h1>
    <xsl:apply-templates/>
</xsl:template>

<xsl:template match=&quot;input[@type = 'submit']&quot;>
	<h1>BUTTON</h1>
    <xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

The problem is I can actually accomplish the omission of the input type=&quot;group&quot; tag and the button, but I can't seem to get the match of &quot;/&quot; to match the document root. I thought it *had* to match this no matter what, but I don't seem to be seeing that HELLO WORLD.

Any ideas would be . . . most helpful. TIA! Monte Kalisch
Brainbench MVP for ASP

Anti-Spam Email: montek at montekcs dot com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top