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 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Yama KamyarSubject: msxml script
Author: Yama Kamyar
Date: 28 Mar 2005 05:02 PM
Hi,

I have a windows application that makes use of a XSLT to parse XML data.

1. Would msxml:script execute if IE has javascript disabled?
2. Would msxml:script execute if IE is not the default browser?

The code uses C#'s XslTranform() function to write the output.

Thanks,

~yamazed

Postnext
Ivan PedruzziSubject: msxml script
Author: Ivan Pedruzzi
Date: 28 Mar 2005 09:03 PM

XslTranform supports script extensions written in C#, Visual Basic, and Jscript.
The extensions are not affected by the IE settings.

Posttop
Yama KamyarSubject: msxml script
Author: Yama Kamyar
Date: 28 Mar 2005 09:32 PM
Thanks for the reply.

So if I had an XML file

*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-

<?xml version="1.0" encoding="ISO-8859-1" ?>

<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
</CATALOG>

*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-

And a XSLT file with:

*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:regExp="http://exslt.org/regular-expressions" extension-element-prefixes="regExp msxsl">
<msxsl:script language="JavaScript" implements-prefix="regExp">
<![CDATA[
/** Some scripting code **/
]]>
</msxsl:script>
<!-- Some XSLT code here -->
</xsl:stylesheet>

*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-

Then I use in C#

*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-

//Create a new XslTransform object.
XslTransform xslt = new XslTransform();

//Load the stylesheet.
xslt.Load(xslFilePath); //the path the XSLT file is saved on PC (i.e. "C:\myScriptXSLT")

// Read the string into the xmltext reader
XmlTextReader xr = new XmlTextReader(new StringReader(xmlData)); //xml string such as above


//Create a new XPathDocument and load the XML data to be transformed.
XPathDocument _data = new XPathDocument(xr);

System.IO.MemoryStream aMemStr = new System.IO.MemoryStream();

//Create an XmlTextWriter which outputs to the console.
XmlWriter writer = new XmlTextWriter(aMemStr, null);

//Transform the data and send the output to the console.
xslt.Transform(_data, null, writer, null);

writer.Close();

*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-*_*-


So the settings of IE won't care about the written javascript script in the XSLT file?

Is there a place that will testify this (Microsoft or W3C link)?

Once again thanks,

~yamazed

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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.