Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / February 2007

Tip: Looking for answers? Try searching our database.

Need XSLT to throw Runtime Exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
IAMDkg@gmail.com - 27 Feb 2007 22:09 GMT
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
Dimitre Novatchev - 28 Feb 2007 01:54 GMT
> 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: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

> 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
[quoted text clipped - 15 lines]
>
> David
Martin Honnen - 28 Feb 2007 13:01 GMT
> 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?

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

IAMDkg@gmail.com - 28 Feb 2007 23:52 GMT
> IAM...@gmail.com wrote:
> > Hi there - Can somebody give me some pointers on how I can create a
[quoted text clipped - 9 lines]
>         Martin Honnen --- MVP XML
>        http://JavaScript.FAQTs.com/

Thanks Martin.  It works :)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.