OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Tree view from IE5

[ Lists Home | Date Index | Thread Index ]
  • From: "Steve Muench" <SMUENCH@us.oracle.com>
  • To: bckman@ix.netcom.com
  • Date: 22 Mar 99 10:42:30 -0800

IE5 uses a built-in stylesheet for this. It's not  
something that's meant to be encrypted in any way or 
hard to "capture". :-) 
 
>From Microsoft Reference material on IE5, you 
find: 
 
|  When using an XSL style sheet, you can access the 
|  XML source through the XML Document Object Model 
|  (DOM). Two additional properties are exposed on 
|  the document object from DHTML: 
| 
|  document.XMLDocument 
|  document.XSLDocument 
| 
|  The XMLDocument property returns the root of the 
|  XML source tree, and the XSLDocument property 
|  returns the root of the XSL style sheet. 
 
By creating a two-frame frameset with an XML file 
being browsed in the left frame and some Javascript 
in the righ frame, you can write out the value of: 
 
  parent.leftframe.document.XSLDocument.xml 
 
to a text file. A little cryptic, but a definitely 
learning tool. See below... 
 
Have fun. 
 
____________________________________________________________ 
Steve Muench, Consulting Product Manager & XML Evangelist 
Java Business Objects Dev't Team - http://www.oracle.com/xml 
 
=/ Include /= 
 
<x:stylesheet xmlns:x="http://www.w3.org/TR/WD-xsl" 
              xmlns:dt="urn:schemas-microsoft-com:datatypes" 
              xmlns:d2="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">  
<x:template match="/"> 
<HTML> 
<HEAD> 
<STYLE> 
BODY{font:x-small 'Verdana';margin-right:1.5em} 
.c{cursor:hand} 
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none} 
.e{margin-left:1em;text-indent:-1em;margin-right:1em} 
.k{margin-left:1em;text-indent:-1em;margin-right:1em} 
.t{color:#990000} 
.xt{color:#990099} 
.ns{color:red} 
.dt{color:green} 
.m{color:blue} 
.tx{font-weight:bold} 

.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-le
ft:.3em;border-left:1px solid #CCCCCC;font:small Courier} 
.di{font:small Courier} 
.d{color:blue} 
.pi{color:blue} 

.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-le
ft:.3em;font:small Courier;color:#888888} 
.ci{font:small Courier;color:#888888}PRE{margin:0px;display:inline}</STYLE>    
<SCRIPT> 
<x:comment> 
function f(e){if (e.className=="ci"){if 
(e.children(0).innerText.indexOf("\n")&gt;0) fix(e,"cb");} 
if (e.className=="di"){if (e.children(0).innerText.indexOf("\n")&gt;0) 
fix(e,"db");} 
e.id="";} 
function 
fix(e,cl){e.className=cl;e.style.display="block";j=e.parentElement.children(0);
j.className="c";k=j.children(0);k.style.visibility="visible";k.href="#";} 
function ch(e){mark=e.children(0).children(0);if 
(mark.innerText=="+"){mark.innerText="-";for (var 
i=1;i&lt;e.children.length;i++)e.children(i).style.display="block";} 
else if (mark.innerText=="-"){mark.innerText="+";for (var 
i=1;i&lt;e.children.length;i++)e.children(i).style.display="none";} 
} 
function ch2(e){mark=e.children(0).children(0);contents=e.children(1);if 
(mark.innerText=="+"){mark.innerText="-";if 
(contents.className=="db"||contents.className=="cb")contents.style.display="blo
ck";else contents.style.display="inline";} 
else if 
(mark.innerText=="-"){mark.innerText="+";contents.style.display="none";} 
} 
function cl(){e=window.event.srcElement;if 
(e.className!="c"){e=e.parentElement;if (e.className!="c"){return;} 
} 
e=e.parentElement;if (e.className=="e") ch(e);if (e.className=="k") ch2(e);} 
function ex(){} 
function h(){window.status=" ";} 
document.onclick=cl;</x:comment></SCRIPT>   </HEAD>   <BODY class="st"> 
<x:apply-templates/> 
</BODY> 
</HTML>  
</x:template>  
<x:template match="node()[nodeType()=10]">  <DIV class="e"><SPAN>    <SPAN 
class="b"><x:entity-ref name="nbsp"/></SPAN>    <SPAN class="d">&lt;!DOCTYPE 
<x:node-name/><I> (View Source for full doctype...)</I>&gt;</SPAN>   
</SPAN></DIV>  
</x:template>  
<x:template match="pi()">  <DIV class="e">   <SPAN class="b"><x:entity-ref 
name="nbsp"/></SPAN>   <SPAN class="m">&lt;?</SPAN><SPAN 
class="pi"><x:node-name/>    <x:value-of/></SPAN><SPAN class="m">?&gt;</SPAN>  
</DIV>  
</x:template>  
<x:template match="pi('xml')">  <DIV class="e">   <SPAN 
class="b"><x:entity-ref name="nbsp"/></SPAN>   <SPAN 
class="m">&lt;?</SPAN><SPAN class="pi">xml <x:for-each 
select="@*"><x:node-name/>="<x:value-of/>" </x:for-each></SPAN><SPAN 
class="m">?&gt;</SPAN>  </DIV>  
</x:template>  
<x:template match="@*" xml:space="preserve"><SPAN><x:attribute 
name="class"><x:if match="x:*/@*">x</x:if>t</x:attribute> 
<x:node-name/></SPAN><SPAN class="m">="</SPAN><B><x:value-of/></B><SPAN 
class="m">"</SPAN> 
</x:template>  
<x:template match="@xmlns:*|@xmlns|@xml:*"><SPAN class="ns">   
<x:node-name/></SPAN><SPAN class="m">="</SPAN><B 
class="ns"><x:value-of/></B><SPAN class="m">"</SPAN> 
</x:template>  
<x:template match="@dt:*|@d2:*"><SPAN class="dt">   <x:node-name/></SPAN><SPAN 
class="m">="</SPAN><B class="dt"><x:value-of/></B><SPAN class="m">"</SPAN> 
</x:template>  
<x:template match="textnode()">  <DIV class="e">   <SPAN 
class="b"><x:entity-ref name="nbsp"/></SPAN>   <SPAN 
class="tx"><x:value-of/></SPAN>  </DIV>  
</x:template>  
<x:template match="comment()">  <DIV class="k">   <SPAN><A class="b" 
onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A>    <SPAN 
class="m">&lt;!--</SPAN></SPAN>   <SPAN id="clean" 
class="ci"><PRE><x:value-of/></PRE></SPAN>   <SPAN class="b"><x:entity-ref 
name="nbsp"/></SPAN>   <SPAN class="m">--&gt;</SPAN>   
<SCRIPT>f(clean);</SCRIPT></DIV>  
</x:template>  
<x:template match="cdata()">  <DIV class="k">   <SPAN><A class="b" 
onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A>    <SPAN 
class="m">&lt;![CDATA[</SPAN></SPAN>   <SPAN id="clean" 
class="di"><PRE><x:value-of/></PRE></SPAN>   <SPAN class="b"><x:entity-ref 
name="nbsp"/></SPAN>   <SPAN class="m">]]&gt;</SPAN>   
<SCRIPT>f(clean);</SCRIPT></DIV>  
</x:template>  
<x:template match="*">  <DIV class="e"><DIV 
STYLE="margin-left:1em;text-indent:-2em">    <SPAN class="b"><x:entity-ref 
name="nbsp"/></SPAN>    <SPAN class="m">&lt;</SPAN><SPAN><x:attribute 
name="class"><x:if match="x:*">x</x:if>t</x:attribute><x:node-name/></SPAN>    
<x:apply-templates select="@*"/><SPAN class="m"> /&gt;</SPAN>   </DIV></DIV>  
</x:template>  
<x:template match="*[node()]">  <DIV class="e">   <DIV class="c"><A href="#" 
onclick="return false" onfocus="h()" class="b">-</A>    <SPAN 
class="m">&lt;</SPAN><SPAN><x:attribute name="class"><x:if 
match="x:*">x</x:if>t</x:attribute><x:node-name/></SPAN><x:apply-templates 
select="@*"/>    <SPAN class="m">&gt;</SPAN></DIV>   <DIV><x:apply-templates/> 
   <DIV><SPAN class="b"><x:entity-ref name="nbsp"/></SPAN>     <SPAN 
class="m">&lt;/</SPAN><SPAN><x:attribute name="class"><x:if 
match="x:*">x</x:if>t</x:attribute><x:node-name/></SPAN><SPAN 
class="m">&gt;</SPAN></DIV>   </DIV></DIV>  
</x:template>  
<x:template match="*[textnode()$and$$not$(comment()$or$pi()$or$cdata())]">  
<DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">    <SPAN 
class="b"><x:entity-ref name="nbsp"/></SPAN>    <SPAN 
class="m">&lt;</SPAN><SPAN><x:attribute name="class"><x:if 
match="x:*">x</x:if>t</x:attribute><x:node-name/></SPAN><x:apply-templates 
select="@*"/>    <SPAN class="m">&gt;</SPAN><SPAN 
class="tx"><x:value-of/></SPAN><SPAN class="m">&lt;/</SPAN><SPAN><x:attribute 
name="class"><x:if 
match="x:*">x</x:if>t</x:attribute><x:node-name/></SPAN><SPAN 
class="m">&gt;</SPAN>   </DIV></DIV>  
</x:template>  
<x:template match="*[*]">  <DIV class="e">   <DIV class="c" 
STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" 
onfocus="h()" class="b">-</A>    <SPAN class="m">&lt;</SPAN><SPAN><x:attribute 
name="class"><x:if 
match="x:*">x</x:if>t</x:attribute><x:node-name/></SPAN><x:apply-templates 
select="@*"/>    <SPAN class="m">&gt;</SPAN></DIV>   <DIV><x:apply-templates/> 
   <DIV><SPAN class="b"><x:entity-ref name="nbsp"/></SPAN>     <SPAN 
class="m">&lt;/</SPAN><SPAN><x:attribute name="class"><x:if 
match="x:*">x</x:if>t</x:attribute><x:node-name/></SPAN><SPAN 
class="m">&gt;</SPAN></DIV>   </DIV></DIV>  
</x:template> 
</x:stylesheet>


  • From: "Frank Boumphrey" <bckman@ix.netcom.com>
  • To: "Lippmann, Jens" <LippmannJ@MICROMODELING.COM>
  • Date: 22 Mar 99 09:04:11
Hi Jens,
is this what you want?

You can get it by intercepting the stream that your server sends to your
client. This is IE5 beta 2's script and style sheet. I havn't looked at the
IE5 release yet, but I suspect that MS have somehow made it more difficult
to intercept the stream.

the document I sent was <xdoc>some simple text</xdoc>, and this is how it
comes wrapped!


Frank

<HTML><HEAD>
<STYLE>
BODY{font:10pt Verdana}
.c{cursor:hand}
.b{color:red;font-family:FixedSys}
.e{margin-left:1em;text-indent:-1em;margin-bottom:3px}
.k{margin-left:1em;text-indent:-1em;margin-bottom:3px}
.t{color:#444444}
.a{color:#444444}
.tx{font-weight:bold}

.db{text-indent:0px;margin-left:2em;margin-top:0px;margin-bottom:0px;font:9p
t Courier;color:#0044BB}
.di{font:9pt Courier;color:#0044BB}
.d{color:#0044BB}
.pi{color:#0044BB}

.cb{text-indent:0px;margin-left:2em;margin-top:0px;margin-bottom:0px;font:9p
t Courier;color:#0044BB}
.ci{font:9pt Courier;color:#0044BB}
PRE{margin:0px;display:inline}
</STYLE>
<SCRIPT>
<!--
function initState()
{
var pres=document.all.tags("PRE");
for (var i=0;i<pres.length;i++)
{
var cparent=pres(i).parentElement;
if (cparent.className=="ci")
{
if (cparent.children(0).innerText.indexOf("\n")>0)
{
cparent.className="cb";
cparent.style.display="block";
cparent.parentElement.children(0).className="c";
cparent.parentElement.children(0).children(0).innerText="-";
}
}

if (cparent.className=="di")
{
if (cparent.children(0).innerText.indexOf("\n")>0)
{
cparent.className="db";
cparent.style.display="block";
cparent.parentElement.children(0).className="c";
cparent.parentElement.children(0).children(0).innerText="-";
}
}
}
}

function changeState(e)
{
mark=e.children(0).children(0);

if (mark.innerText=="+")
{
for (var i=1;i<e.children.length;i++)
e.children(i).style.display="block";
mark.innerText="-";
}
else if (mark.innerText=="-")
{
for (var i=1;i<e.children.length;i++)
e.children(i).style.display="none";
mark.innerText="+";
}
}

function changeChunkState(e)
{
mark=e.children(0).children(0);
contents=e.children(1);

if (mark.innerText=="+")
{
if (contents.className=="db"||contents.className=="cb")
contents.style.display="block";
else
contents.style.display="inline";
mark.innerText="-";
}
else if (mark.innerText=="-")
{
contents.style.display="none";
mark.innerText="+";
}
}

function document_click()
{
e=window.event.srcElement;
if (e.className!="c")
{e=e.parentElement;if (e.className!="c")
{
return;
}
}

e=e.parentElement;
if (e.className=="e") changeState(e);
if (e.className=="k") changeChunkState(e);
}
document.onclick=document_click;
--></SCRIPT>
<SCRIPT FOR="window" EVENT="onload">initState();</SCRIPT>
</HEAD>
<BODY class="st"><DIV class="e">
<DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b">&nbsp;</SPAN>
<SPAN class="t">&lt;xdoc</SPAN><SPAN class="t">&gt;</SPAN><SPAN
class="tx">some simple text</SPAN><SPAN class="t">&lt;/xdoc&gt;</SPAN>
</DIV></DIV>
</BODY>
</HTML>


----- Original Message -----
From: Lippmann, Jens <LippmannJ@MICROMODELING.COM>
To: <xml-dev@ic.ac.uk>
Sent: Monday, March 22, 1999 9:01 AM
Subject: Tree view from IE5


>Is there a way to "borrow" the stylesheet that creates the XML tree in IE5
>for XML files without an attached stylesheet, or is the tree hardcoded into
>the msxml.dll?
>
>Jens
>
>
>
>xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
>Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on
CD-ROM/ISBN 981-02-3594-1
>To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
>(un)subscribe xml-dev
>To subscribe to the digests, mailto:majordomo@ic.ac.uk the following
message;
>subscribe xml-dev-digest
>List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
>
>



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)







 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS