|
[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








