Thanks, Tom. That of course worked. Although I am confused as to why it was not done that way in the class. Does this being a CF server explain it?
Well on to the next level, wddx. andy -----Original Message----- From: tom dyson [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 08, 2001 12:37 PM To: [EMAIL PROTECTED] Subject: Re: [cf-xml] transformation problems (was 'no subject') Hi Andy You're almost there, but you're missing a crucial step. Simply browsing the XML file isn't enough: you'll need to write some code which specifies the XML and XSL files (and the parser to use), and then calls the transformation. This code can be run client-side (JScript) or server-side (ColdFusion, ASP etc). Here's a very basic (but working) example of the client-side code: <script type="JScript"> // Load the XML document var xmlDoc = new ActiveXObject("MSXML2.DOMDocument"); xmlDoc.async = false; xmlDoc.load('actor.xml'); // Load the XSL stylesheet var xslMain = new ActiveXObject("MSXML2.DOMDocument"); xslMain.async = false; xslMain.load('actor_simple.xsl'); // Call the transformation var result = xmlDoc.transformNode(xslMain); document.write(result); </script> This should run in IE 4+, with MSXML 3+ installed. With regard to your installation question, once MSXML 3 is installed on your computer it should be available to both the browser and the server. A common confusion with the MSXML install process is the difference between 'replace' and 'side-by-side' modes - see the following link for a previous discussion on this issue: http://pairlist.net/pipermail/cf-xml/Week-of-Mon-20011008/000145.html If you haven't done already, I'd recommend installing the parser in 'replace' mode, as this avoids the possibility that your code might be using the older, less compatible version. Hope this helps Tom -----------------+ tom dyson t: +44 (0)1608 811870 m: +44 (0)7958 752657 http://torchbox.com On Thursday, November 8, 2001, at 02:38 pm, Trusz, Andrew wrote: > Thanks Tom. It's good to know I can do "Hello World"; which is all I'm > trying to do at the moment. I'm building up to using CF but for now it's > just "can I do this at all" activities -- neophyte. > > I'm not getting any errors at all. I just get the html output without > the > "Humphrey". I simply browse the actor.xml page. If I use a "text/css" > call > with an appropriate "actor.css" file I do get the name. > > As I understand the process, both browser and server need a parser. MS > has > "improved" the 3.0 parser installation with a wizard. I can find no > indication of a separate install for the browser or server. I use the > server > as my desktop machine (it's a testing lab. I know we are behind the > curve > but at least I get the chance to catch up). So, I installed from a > different > source and have the SDK package which installed the parser, the > documentation, and made registry changes (the install order > recommended). > According to the instructor of the class I took (it's the parser package > used in the class), that should have installed both browser and server > versions. How would one check? > > If I can get past this, then I can ask annoyingly simple CF questions. > > Thanks again. > > andy > > -----Original Message----- > From: tom dyson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 08, 2001 8:41 AM > To: [EMAIL PROTECTED] > Subject: Re: [cf-xml] transformation problems (was 'no subject') > > > Hi Andy > > I can't test your configuration from here (at home with my Mac OS X > laptop) but your code looks fine and it runs perfectly in Java/Xalan: > > [localhost:] tomdyson% java xslt.Process -IN actor.xml -XSL > actor_simple.xsl -OUT actor.html > [localhost:] tomdyson% more actor.html > <html> > <head> > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > <title>Untitled</title> > </head> > <body> > <h2>Names</h2> > Name: Humphrey > </body> > </html> > > How are you calling the transformation? In ColdFusion? What error are > you getting? Perhaps we can solve your problem if you show us the > transformation code. > > Best wishes > > Tom > > On Wednesday, November 7, 2001, at 05:18 pm, Trusz, Andrew wrote: > >> This is a hopelessly neophyte question with the accompanying request >> for >> pity. >> >> Why doesn't this extract the "name" value? Running on win2k Advanced >> Server, >> IIS5.0, IE5.0, MSXLM parser ver3.0. >> >> dtd file (actor.dtd) <!ELEMENT actors (actor*)> >> <!ELEMENT actor (name*)> >> <!ELEMENT name (#PCDATA)> >> >> xsl file (actor_simple.xsl) >> >> <?xml version="1.0"?> >> <xsl:stylesheet >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> >> <xsl:template match="/"> >> >> >> <html> >> <head> >> <title>Untitled</title> >> </head> >> >> <body> >> >> <h2>Names</h2> >> Name: <xsl:value-of >> select="actors/actor/name" /> >> >> </body> >> </html> >> </xsl:template> >> </xsl:stylesheet> >> >> and xml file (actor.xml) >> >> <?xml version="1.0"?> >> >> <!DOCTYPE actors SYSTEM "actor.dtd"> >> <?xml-stylesheet type="text/xsl" >> href="actor_simple.xsl"?> >> <actors> >> <actor> >> <name>Humphrey >> </name> >> </actor> >> </actors> >> >> Thanks. >> >> andy -----------------------+ cf-xml mailing list list: [EMAIL PROTECTED] admin: [EMAIL PROTECTED] home: http://torchbox.com/xml -----------------------+ cf-xml mailing list list: [EMAIL PROTECTED] admin: [EMAIL PROTECTED] home: http://torchbox.com/xml
