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

RE: checck if external xml is valid with xsl/javascrip

Subject: RE: checck if external xml is valid with xsl/javascript?
From: "bryan" <bry@xxxxxxxxxx>
Date: Mon, 28 Jul 2003 12:40:29 +0200
javascrip if
Well if you don't need to handle xml over http for that you can just get
have an extension function that does the typical load xml into dom,
check if there is an error, if error return value1 if not error return
value2, then check which it was before you go to document. 

If you do need to get xml over http you would do something like
<msxsl:script language="JScript" implements-prefix="jsc">

function GetRest(xmldoc)
  {    
var async = false;

    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
    xmlhttp.Open("Get", xmldoc, async);
    xmlhttp.send(null);
    return xmlhttp.responseXML;

  }
</msxsl:script>
adding in appropriate error handling, with 

<xsl:template match="testxhttp">
<value><xsl:copy-of select="jsc:GetRest('your http url here')"/></value>
</xsl:template>







-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Armand
Datema
Sent: Monday, July 28, 2003 11:03 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  checck if external xml is valid with xsl/javascript?

Hi

Thanks for your reply

We are using msxml4

Armand

-----Original Message-----
From: bryan [mailto:bry@xxxxxxxxxx] 
Sent: Monday, July 28, 2003 10:51 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  checck if external xml is valid with xsl/javascript?


><xsl:for-each select="document($vacature_url)//vacature">

>However, since this external xml is not in our control sometimes its
not
>valid and screws up the rest of the page.

Unfortunately you would have to use an extension function for this,
which processor are you using?


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


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



 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.