Hi Andy,

The difficulty that you're having here is related to your last problem:
namely that while it's possible to call transformations from IE without
explicitly calling the MSXML object, it's very restrictive. That's because
the default transformation engine in IE uses the old, non-compliant
Microsoft XSL specification, which doesn't mesh well with the correct
namespace (which you've used - 'http://www.w3.org/1999/XSL/Transform').

Therefore, only the simplest XSL transformations will succeed unless you
call the MSXML object, either via client-side scripting or CFOBJECT in
ColdFusion. In most situations server-side transformations are more useful,
as the results are not restricted to a particular browser. I'd recommend
that you try out your XSL experiments in ColdFusion - it's surprisingly
easy. You could start with the CF_XMLTransform tag in the Toolkit:

<CF_XMLDatasource name="myXML">
  Your XML document goes here...
</CF_XMLDatasource>

<CF_XSLStyleSheet Name="myXSL">
   and your XSL Stylesheet goes here...
</CF_XSLStyleSheet>

<CF_XMLTransform 
    XMLDatasource="myXML"
    XSLStyleSheet="myXSL">

And then start looking at the code to see how it all works.

Good luck!

Tom

-----------------+
tom dyson
t: +44 (0)1608 811870
m: +44 (0)7958 752657
http://torchbox.com

> I'm still trying to work my way through the basics. In an earlier attempt,
> Tom Dyson was kind enough to provide a JScript for transformation. Now I'm
> attempting to use data islands in an HTML page using the transformNode()
> method.. Once again, I can't make it work. What have I missed?
> 
> andy
> 
> IIS5; msxml 3.0, win2k advanced server, IE5.5
> 
> Transformation/data island page:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> 
> <html>
> <head>
> <title>Actor list</title>
> 
> <xml id="actors" src="actor.xml"></xml>
> <xml id="style" src="actor_simple2.xsl"></xml>
> 
> </head>
> 
> <body onload="dataTarget.innerHTML=actors.transformNode(style.XMLDocument)">
> 
> <div id="dataTarget"></div>
> 
> </body>
> </html>
> 
> 
> XML page:(actor.xml)
> 
> <?xml version="1.0"?>
> 
> <!DOCTYPE actors SYSTEM "actor.dtd">
> 
> <?xml-stylesheet type="text/xsl" href="actor_simple2.xsl"?>
> 
> <actors>
> <actor>
> <name>Humphrey
> </name>
> <films>
> <film>
> <title>Casablanca</title>
> </film>
> <film>
> <title>African Queen</title>
> </film>
> </films>
> <name>Susan
> </name>
> <films>
> <film>
> <title>Dead</title>
> </film>
> <film>
> <title>T and L</title>
> </film>
> </films>
> </actor>
> </actors>
> 
> 
> 
> xsl page (actor_simple2.xsl)
> 
> <?xml version="1.0"?>
> <xsl:stylesheet  version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> 
> <xsl:template match="/">
> 
> 
> <html>
> <head>
> <title>Untitled</title>
> 
> </head>
> 
> <body>
> <div style="font:verdanna; font-size:12pt">
> <h2>Names</h2>
> Name: <xsl:apply-templates select="/actors/actor/name" /><br />
> Films:<xsl:apply-templates select="/actors/actor/films/film/title"
> />
> </div>           
> </body>
> </html>
> </xsl:template>
> <xsl:template match="name">
> <xsl:value-of select="." />
> </xsl:template>
> <xsl:template match="title">
> <xsl:value-of select="." />
> </xsl:template>
> </xsl:stylesheet>
> 
> 
> actor dtd:
> 
> <!ELEMENT actors (actor*)>
> <!ELEMENT actor (name,films)>
> <!ELEMENT name (#PCDATA)>
> <!ELEMENT films (film+)>
> <!ELEMENT film (title)>
> <!ELEMENT title (#PCDATA)>
> 
> 
> Any help is greatly appreciated.




-----------------------+
cf-xml mailing list
list: [EMAIL PROTECTED]
admin: [EMAIL PROTECTED]
home: http://torchbox.com/xml

Reply via email to