473,569 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Feb 27 '07 #1
3 4644
<IA****@gmail.c omwrote in message
news:11******** **************@ 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
<IA****@gmail.c omwrote in message
news:11******** **************@ 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

Feb 28 '07 #2
IA****@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/
Feb 28 '07 #3
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 :)

Mar 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2157
by: Moogy | last post by:
I'm pulling my hair out here. First, I'm new to XML, so that doesn't help, but none of this makes any sense to me. All I'm trying to do is take a simple source XML file and translate it with an XSLT to produce HTML code. The problem I have is that no matter what translation it runs through, it ALWAYS includes data that I don't match in...
0
2339
by: Christopher M. Lauer | last post by:
I have done my best to answer this question but can not find the proper set of commands. I would like to transform an xml file (in code behind) and display its output in a specific html tag, such as a div with a runat=server. I can somewhat do this if I create a server control and include the control within the html div tag but this...
9
13176
by: Bill Borg | last post by:
Hello, I call a function recursively to find an item that exists *anywhere* down the chain. Let's say I find it five layers deep. Now I've got what I need and want to break out of that whole stack and continue execution at the point of the initial call. Is that possible? Thanks, Bill
1
2726
by: Nick | last post by:
I am working on a website for a client and one of their requirements was to have a mailing list. I decided to XSLT to transform "templates" to HTML so that editing was very easy and less time consuming. I keep getting the following error when I submit my email to their site. System.Xml.Xsl.XslTransformException: Cannot find the script or...
17
3396
by: Phlip | last post by:
C++ers: I have this friend who thinks C++ cannot throw from a destructor. I think throwing from a destructor is bad Karma, and should be designed around, but that C++ cannot strictly prevent the actual event. (One compiler-oriented reason is a compiler might not be able to detect that the call-tree from a destructor leads to a throw.)
4
4300
by: =?Utf-8?B?REZC?= | last post by:
Within an XSLT transformation, I'm trying to switch the default namespace within a section of the generated XML document to a shared namespace. This way, the content of this section does not have to use a prefix for the shared namespace, thus making the document smaller and easier to read. This worked in .NET 1.1 with no problem, but now...
2
2784
by: ranadhirnag | last post by:
We test a particular constriant in our XSLT and throw a custom exception on failure: <xsl:when test="......"> <xsl:value-of select="exception:throwException('Recording failed')"/> </xsl:when> Here exception is defined as: xmlns:exception="http://..../util.exception.ValidationExceptionThrower" The problem is that this kind of exception...
1
2373
by: killy971 | last post by:
I am using the following syntax, with Xalan, to process xml transformations in java: StreamSource xml = new StreamSource(xmlFile); StreamSource xsl = new StreamSource(xslFile); StreamResult out = new StreamResult(outputFile); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer =...
2
1979
Dormilich
by: Dormilich | last post by:
Hi, I'm testing my classes for a web page and I stumble upon an error I don't have a clue what it means: Error: Fatal error: Can't use method return value in write context in "output.php" on line 142 (line 12 in snippet) the error is caused by this call: empty($inSeite_inp->getValue('PAR_NAME')) method definition see second snippet,...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.