all groups > dotnet xml > february 2007 >
You're in the

dotnet xml

group:

Need XSLT to throw Runtime Exception


Need XSLT to throw Runtime Exception IAMDkg NO[at]SPAM gmail.com
2/27/2007 2:09:06 PM
dotnet xml:
Hi there - Can somebody give me some pointers on how I can create a
XSLT which will compile fine but will thow a runtime exception during
runtime.

I tried to do the following but it doesn't throw any runtime
exception.

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/
Transform'>
<xsl:template match='/'>
<xsl:variable name='a' select='1 div 0'/>
<xsl:copy-of select ='$a'/>
</xsl:template>
</xsl:stylesheet>

Thanks,

David
Re: Need XSLT to throw Runtime Exception Dimitre Novatchev
2/27/2007 5:54:57 PM
[quoted text, click to view]


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:call-template name="loop-for-ever"/>
</xsl:template>

<xsl:template name="loop-for-ever">
<xsl:call-template name="loop-for-ever"/>
</xsl:template>
</xsl:stylesheet>


Cheers,
Dimitre Novatchev


[quoted text, click to view]

Re: Need XSLT to throw Runtime Exception Martin Honnen
2/28/2007 2:01:13 PM
[quoted text, click to view]

Look into xsl:message, see <http://www.w3.org/TR/xslt#message>
<xsl:message terminate="yes">Your exception</xsl:message>
Or is that not what you are looking for?

--

Martin Honnen --- MVP XML
Re: Need XSLT to throw Runtime Exception IAMDkg NO[at]SPAM gmail.com
2/28/2007 3:52:20 PM
[quoted text, click to view]

Thanks Martin. It works :)
AddThis Social Bookmark Button