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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I put ASP in an XSLT file?

Status
Not open for further replies.

gdrenfrew

Programmer
Aug 1, 2002
227
GB
Hello,

If I can put raw HTML into my XSL files, is it possible to put ASP in their too?

Graeme
 
hi,

It is possible through saxon, I tested with a xml file, it works fine

the XML file is

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;asp_xslt.xsl&quot;?>
<xml>
<books>
<book>ASP Unleashed</book>

</books>
</xml>


the xslt file is
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; xmlns:fo=&quot;<xsl:eek:utput method=&quot;text&quot; omit-xml-declaration=&quot;yes&quot;/>

<xsl:template match=&quot;/&quot;>

<xsl:variable name=&quot;asp&quot;>

<xsl:text>Response.write &#34;</xsl:text>

</xsl:variable>



<p>
<xsl:text disable-output-escaping=&quot;yes&quot;>&lt;%</xsl:text>

<xsl:value-of select=&quot;concat($asp, //books/book)&quot;/>&#34;%>
</p>

</xsl:template>

</xsl:stylesheet>


transform the xml file into asp file using saxon version 6(which is installed in my machine), that is by

saxon asp_xml.xml asp_xslt.xsl > test.asp

which generates test.asp file.
 
thanks for this, I think i had my syntax wrong so I'll give it another try.

graeme
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top