Subject: Illustration of Different Node Trees for XML (W3C(XT)/IE5) From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 09 Apr 1999 11:09:03 -0700 |
I was asked to produce an IE5 version of my SHOWTREE free resource and I found the results were interesting. These reveal that alternate strategies are required with different products when accessing components of an XML document because the node structure interpreted by engines differ. Versions of SHOWTREE for both W3C(XT) and IE5 are available through the Resource Library link on our home page in my trailer below. The stylesheets produce a text file from XT and an HTML file from IE5 ... one can use the IE5 engine either directly viewing a file using an embedded stylesheet processing instruction, or use the DOS command line if you want to examine a file without changing it to include the PI (the command line invocation is another free resource in the library). I noted the following right away: (1) XT instantiates text nodes for new lines between elements where IE5 doesn't (2) XT regards the XML declaration as not being part of the content while IE5 does (3) IE5 exposes the namespace declaration attributes as attributes while XT doesn't (4) XT composes node names using the namespace URI while IE5 doesn't I haven't looked closely for other differences given some personal time constraints. I hope this is considered useful. ........... Ken T:\FTEMP>type short.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="showtree.msxsl"?> <?pi1 value of pi1?> <!--comment number 1--> <greeting pub-id="+//ISBN 1-894049::CSL::Samples::SHOWTREE//Document SHOWTREE Test//EN" attr2="Value of second attribute"> <purpose>To convey a greeting</purpose> <test1>A test<test2>of depth<test3>to three levels</test3></test2></test1> <!--comment number 2--> <prelude id="start" xmlns:info="http://www.CraneSoftwrights.com/resources/"> <?pi2 value of pi2?> <info:detail>Information about Greeting</info:detail> </prelude> <value>Hello world!</value> </greeting> T:\FTEMP>call xsl short.xml showtree.xsl short.w3c T:\FTEMP>call msxsl short.xml showtree.msxsl short.ms T:\FTEMP>type short.w3c SHOWTREE Stylesheet - http://www.CraneSoftwrights.com/resources/ Root: 1 Proc. Inst. 'xml-stylesheet' (): {type="text/xsl" href="showtree.msxsl"} 2 Proc. Inst. 'pi1' (): {value of pi1} 3 Comment (): {comment number 1} 4 Element 'greeting' (): 4.1 Attribute 'pub-id' (greeting): {+//ISBN 1-894049::CSL::Samples::SHOWTREE//Document SHOWTREE Test//EN} 4.2 Attribute 'attr2' (greeting): {Value of second attribute} 4.3 Text (greeting): { } 4.4 Element 'purpose' (greeting): 4.4.1 Text (greeting,purpose): {To convey a greeting} 4.5 Text (greeting): { } 4.6 Element 'test1' (greeting): 4.6.1 Text (greeting,test1): {A test} 4.6.2 Element 'test2' (greeting,test1): 4.6.2.1 Text (greeting,test1,test2): {of depth} 4.6.2.2 Element 'test3' (greeting,test1,test2): 4.6.2.2.1 Text (greeting,test1,test2,test3): {to three levels} 4.7 Text (greeting): { } 4.8 Comment (greeting): {comment number 2} 4.9 Text (greeting): { } 4.10 Element 'prelude' (greeting): 4.10.1 Attribute 'id' (greeting,prelude): {start} 4.10.2 Text (greeting,prelude): { } 4.10.3 Proc. Inst. 'pi2' (greeting,prelude): {value of pi2} 4.10.4 Text (greeting,prelude): { } 4.10.5 Element 'http://www.CraneSoftwrights.com/resources/#info:detail' (greeting,prelude): 4.10.5.1 Text (greeting,prelude,http://www.CraneSoftwrights.com/resources/#info:detail): {Information about Greeting} 4.10.6 Text (greeting,prelude): { } 4.11 Text (greeting): { } 4.12 Element 'value' (greeting): 4.12.1 Text (greeting,value): {Hello world!} 4.13 Text (greeting): { } T:\FTEMP>rem copy/paste from IE5 canvas to short.ms.txt T:\FTEMP>type short.ms.txt SHOWTREE Stylesheet file:///T:/FTEMP/short.xml http://www.CraneSoftwrights.com/resources Root: 1 Proc. Inst. 'xml' (): {version="1.0"} 2 Proc. Inst. 'xml-stylesheet' (): {type="text/xsl" href="showtree.msxsl"} 3 Proc. Inst. 'pi1' (): {value of pi1} 4 Comment (): {comment number 1} 5 Element 'greeting' (): 5.1 Attribute 'pub-id' (greeting): {+//ISBN 1-894049::CSL::Samples::SHOWTREE//Document SHOWTREE Test//EN} 5.2 Attribute 'attr2' (greeting): {Value of second attribute} 5.3 Element 'purpose' (greeting): 5.3.1 Text (greeting,purpose): {To convey a greeting} 5.4 Element 'test1' (greeting): 5.4.1 Text (greeting,test1): {A test} 5.4.2 Element 'test2' (greeting,test1): 5.4.2.1 Text (greeting,test1,test2): {of depth} 5.4.2.2 Element 'test3' (greeting,test1,test2): 5.4.2.2.1 Text (greeting,test1,test2,test3): {to three levels} 5.5 Comment (greeting): {comment number 2} 5.6 Element 'prelude' (greeting): 5.6.1 Attribute 'id' (greeting,prelude): {start} 5.6.2 Attribute 'xmlns:info' (greeting,prelude): {http://www.CraneSoftwrights.com/resources/} 5.6.3 Proc. Inst. 'pi2' (greeting,prelude): {value of pi2} 5.6.4 Element 'info:detail' (greeting,prelude): 5.6.4.1 Text (greeting,prelude,info:detail): {Information about Greeting} 5.7 Element 'value' (greeting): 5.7.1 Text (greeting,value): {Hello world!} T:\FTEMP>type short.ms <html> <head> <title>SHOWTREE Stylesheet - http://www.CraneSoftwrights.com/resources/</title> </head> <body> <h2>SHOWTREE Stylesheet</h2> <p>file:///T:/FTEMP/short.xml<br /> <a href="http://www.CraneSoftwrights.com/resources/">http://www.CraneSoftwright s.com/resources/</a></p> <samp> Root:<br /> 1 Proc. Inst. 'xml' (): {version="1.0"}<br /> 2 Proc. Inst. 'xml-stylesheet' (): {type="text/xsl" href="showtree.msxsl"}<br /> 3 Proc. Inst. 'pi1' (): {value of pi1}<br /> 4 Comment (): {comment number 1}<br /> 5 Element 'greeting' (): <br /> 5.1 Attribute 'pub-id' (greeting): {+//ISBN 1-894049::CSL::Samples::SHOWTREE//Document SHOWTREE Test//EN}<br /> 5.2 Attribute 'attr2' (greeting): {Value of second attribute}<br /> 5.3 Element 'purpose' (greeting): <br /> 5.3.1 Text (greeting,purpose): {To convey a greeting}<br /> 5.4 Element 'test1' (greeting): <br /> 5.4.1 Text (greeting,test1): {A test}<br /> 5.4.2 Element 'test2' (greeting,test1): <br /> 5.4.2.1 Text (greeting,test1,test2): {of depth}<br /> 5.4.2.2 Element 'test3' (greeting,test1,test2): <br /> 5.4.2.2.1 Text (greeting,test1,test2,test3): {to three levels}<br /> 5.5 Comment (greeting): {comment number 2}<br /> 5.6 Element 'prelude' (greeting): <br /> 5.6.1 Attribute 'id' (greeting,prelude): {start}<br /> 5.6.2 Attribute 'xmlns:info' (greeting,prelude): {http://www.CraneSoftwrights.com/resources/}<br /> 5.6.3 Proc. Inst. 'pi2' (greeting,prelude): {value of pi2}<br /> 5.6.4 Element 'info:detail' (greeting,prelude): <br /> 5.6.4.1 Text (greeting,prelude,info:detail): {Information about Greeting}<br /> 5.7 Element 'value' (greeting): <br /> 5.7.1 Text (greeting,value): {Hello world!}<br /> </samp> </body> </html> T:\FTEMP> -- G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) Website: XSL/XML/DSSSL/SGML services outline, XSL/DSSSL shareware, stylesheet resource library, conference training schedule, commercial stylesheet training materials, on-line XSL CBT. Next instructor-led XSL Training: WWW8:1999-05-11 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: xsl:copy, Keith Visco | Thread | Re: Illustration of Different Node , G. Ken Holman |
Re: xsl:copy, Keith Visco | Date | Re: Illustration of Different Node , G. Ken Holman |
Month |