[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

JScript error handling in msxsl ?

Subject: JScript error handling in msxsl ?
From: Dave Carlson <dcarlson@xxxxxxxxxxxxxx>
Date: Sun, 08 Mar 1998 19:30:23 -0700
jscript error
Is there a way to handle JScript errors in msxsl?  When using JavaScript in
a browser, you can define an error handler for the window, but I can't find
an equivalent object for handing errors in MSXSL.

See the example below.  In Microsoft's MSXSL processor, the getAttribute()
function throws an error and aborts processing of the stylesheet if the
attribute is not present.  I have a document element with several optional
attributes, and I want to print those that are present.  I can't find any
way to make this work, short of creating a whole bunch of alternative rules
that check for all permutations of  attribute presence in the rule condtion.
e.g.

  <target-element type="Field">
    <attribute name="name" has-value="yes"/>

Any suggestions would be greatly appreciated!

<define-script><![CDATA[
  function testAttribute(e, name) {
    if(e.getAttribute(name) != null) return e.getAttribute(name);
    else return "";
  }
]]></define-script>


<rule>
  <target-element type="Field"/>

  <TR>
  <TD><eval>getAttribute("name")</eval></TD>
  <TD><eval>testAttribute(this, "type")</eval></TD>
  <TD><eval>testAttribute(this, "default")</eval></TD>
  <TD><eval>testAttribute(this, "enum")</eval></TD>
  </TR>
</rule>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.