Need XSLT to throw Runtime Exception

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • IAMDkg@gmail.com

    #1

    Need XSLT to throw Runtime Exception

    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:styleshe et 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

  • Dimitre Novatchev

    #2
    Re: Need XSLT to throw Runtime Exception

    <IAMDkg@gmail.c omwrote in message
    news:1172614146 .355065.290670@ 8g2000cwh.googl egroups.com...
    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.

    <xsl:styleshe et 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


    <IAMDkg@gmail.c omwrote in message
    news:1172614146 .355065.290670@ 8g2000cwh.googl egroups.com...
    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:styleshe et 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
    >

    Comment

    • Martin Honnen

      #3
      Re: Need XSLT to throw Runtime Exception

      IAMDkg@gmail.co m wrote:
      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.
      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
      http://JavaScript.FAQTs.com/

      Comment

      • IAMDkg@gmail.com

        #4
        Re: Need XSLT to throw Runtime Exception

        On Feb 28, 5:01 am, Martin Honnen <mahotr...@yaho o.dewrote:
        IAM...@gmail.co m wrote:
        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.
        >
        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
        http://JavaScript.FAQTs.com/
        Thanks Martin. It works :)

        Comment

        Working...