473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Apply XSLT To XML File

I have an xml file in which I reference an xsl template file to convert the
xml to HTML. My system also has VSNET 2003 installed and when I open the xml
file in IE6 it opens the file in VSNET instead of processing the file with
the stylesheet.

How can I get the file to apply the stylesheet?

Wayne
Nov 12 '05 #1
2 4859
in code, you do it something like this:

System.Xml.XmlDocument doc= new System.Xml.XmlDocument();
doc.Load("MyXml.xml");
System.Xml.Xsl.XsltArgumentList xslArgs= null;
System.Xml.Xsl.XslTransform xsl= new System.Xml.Xsl.XslTransform();
xsl.Load("MyXsl.xsl"));
xsl.Transform(doc.CreateNavigator(), xslArgs, outputStream);

if you put that code into a console app, and specify System.Console.Out as
the output stream, you should get HTML on the console stdout.

I think loading the XML into an IE browser will also do this, automatically,
if the XSL reference is resolvable.

-D

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
I have an xml file in which I reference an xsl template file to convert the xml to HTML. My system also has VSNET 2003 installed and when I open the xml file in IE6 it opens the file in VSNET instead of processing the file with
the stylesheet.

How can I get the file to apply the stylesheet?

Wayne

Nov 12 '05 #2
Thanks for the reply - I'll try that.

Wayne

"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message
news:OH****************@TK2MSFTNGP09.phx.gbl...
in code, you do it something like this:

System.Xml.XmlDocument doc= new System.Xml.XmlDocument();
doc.Load("MyXml.xml");
System.Xml.Xsl.XsltArgumentList xslArgs= null;
System.Xml.Xsl.XslTransform xsl= new System.Xml.Xsl.XslTransform();
xsl.Load("MyXsl.xsl"));
xsl.Transform(doc.CreateNavigator(), xslArgs, outputStream);

if you put that code into a console app, and specify System.Console.Out as
the output stream, you should get HTML on the console stdout.

I think loading the XML into an IE browser will also do this, automatically, if the XSL reference is resolvable.

-D

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
I have an xml file in which I reference an xsl template file to convert

the
xml to HTML. My system also has VSNET 2003 installed and when I open the

xml
file in IE6 it opens the file in VSNET instead of processing the file with the stylesheet.

How can I get the file to apply the stylesheet?

Wayne


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stefan Siegl | last post by:
Hello, I am trying to learn XSLT to use it in another project. I start reading the book "Java and XSLT" and tried the examples and they are went quite fine (how suprising *g*). Then I tried...
1
by: Vijay singh | last post by:
Hi wonder if anybody can clear by doubt XML file : <score id="1"> <film>A Little Princess</film> <composer>Patrick Doyle</composer>
6
by: JJBean | last post by:
Hi Oleg and All, Is this correct? Can I do this? <code> XmlDocument doc=new XmlDocument(); XPathNavigator nav = doc.CreateNavigator(); //Load the xml file. Change path if needed...
0
by: marcum williams | last post by:
Below I'm generating an updategram via xslt and currently referencing schema via <updg:sync mapping-schema="hpXSD.xsd"> .... </updg:sync> But I would like to LOAD the .xsd schema into memory...
3
by: Blaise Garant | last post by:
Hi I've made a stylesheet to transform my data into XSL-FO. This stylesheet used to work with MSXSL 4.0 but I've got some issues in ..NET. First, I changed removed all the "node-set()" function...
3
by: TnaG | last post by:
Can someone answer this probably obvious question. I have an xmldocument that i want to apply an xslt file to. All the examples i find assume u are applying the xslt to an xml file you've read...
2
by: jimbo_vr5 | last post by:
Hey I think i've figured out the idea behind apply-templates. But going through the tutorial on <http://www.w3schools.com/xsl/xsl_apply_templates.asp> theres simply just something that i dont...
2
by: bill salkin | last post by:
I have an XML file that I want to validate against an XSD and then transforma using an XSLT. I have no problem doing this with external commercial tools but how it this done from VB.NET code? ...
3
by: abhishek.smu | last post by:
Given an XML like: <root> <node>8</node> <node>21</node> <node>-7</node> <node>13</node> <node>43</node> <node>2</node> </root>
2
by: RccH | last post by:
Beginner using xslt... So. I have an XML file which has a link into xslt file like following... <?xml version='1.0' encoding='utf-8' ?> <?xml-stylesheet type="text/xsl" href="transform.xsl"?>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.