XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Steve GriseSubject: msxml 6 and scripts
Author: Steve Grise
Date: 28 May 2007 03:28 PM
I dug up an old example from this site for handling xml fragments of escape-outputted text.

I need to use msxml 6, and I get an error message "C# is not a scripting language". I tried to switch to Javascript but I can't seem to get the syntax right - get error messages like "can't find 'System' etc. Can someone throw me a bone in JScript?

<ms:script language="C#" implements-prefix="cs"><![CDATA[

XPathNodeIterator parse(String strXML)
{
System.IO.StringReader rdr = new System.IO.StringReader(strXML);
XPathDocument doc = new XPathDocument(rdr);
XPathNavigator nav = doc.CreateNavigator();

XPathExpression expr;
expr = nav.Compile("/");

XPathNodeIterator iterator = nav.Select(expr);

return iterator;
}
]]>
</ms:script>


Postnext
Alberto MassariSubject: msxml 6 and scripts
Author: Alberto Massari
Date: 29 May 2007 03:43 AM
Hi Steve,
msxml 6 doesn't support C# (or VB.NET) as a scripting language; it supports JavaScript and VBScript, but in this case you should convert the code to use the JavaScript syntax...

Alberto

Postnext
Steve GriseSubject: msxml 6 and scripts
Author: Steve Grise
Date: 29 May 2007 11:30 AM
ok, but I'm really stumped on how to write the javascript, and trolling through almost useful web search results is not helping much.

I try to change the first line to:
var rdr = new StringReader(strXml);
or
StringReader rdr = new StringReader(strXml)
or
System.IO.StringReader...

but none of these approaches work.

All I can find on the web and on this board are C# examples which are not helpful, and I can find anything useful for javascript syntax anywhere for msxml. I don't mind going off and learning how to do this, but I'm really stumped for an example.

Steve

Posttop
Alberto MassariSubject: msxml 6 and scripts
Author: Alberto Massari
Date: 31 May 2007 08:00 AM
Hi Steve,
if you don't want to learn JavaScript, you should probably switch to use the .NET XSL processor, that can process C# scripts.

Hope this helps,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.