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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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
(Deleted User) Subject: msxml 6 and scripts
Author: (Deleted User)
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
(Deleted User) Subject: msxml 6 and scripts
Author: (Deleted User)
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

   
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.