Click to See Complete Forum and Search --> : Default XML stylesheet for IE
Tom S
02-24-2003, 12:16 PM
I'm using the WebBrowser control in a VB6 application to display an XML doc
as it is being created. I am using the transformNode method of the document
to convert to an HTML string. I would like the XML to be displayed in the
WebBrowser the same way it would in IE6. I found a stylesheet on my system
in Windows/System32 named "xml.xsl" that works pretty well. Only difference
is it does not provide the "+" and "-" characters for expanding and collasping
the XML sturcture.
Is there a stylesheet available for download somewhere that I can use to
completely emulate the default XML style of IE6?
Marian Olteanu
03-07-2003, 05:46 AM
The default stylesheet used by IE is found in msxml.dll
It is the resource named DEFAULTSS.XSL
To get it, open the dll using Visual C++ 6, "Open As Resource".
But the stylesheet uses the old Microsoft version of XSLT (pre-XSLT 1.0):
http://www.w3.org/TR/WD-xsl
I think that it will be no problem for you.
I also recomand you to look at http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20301558.html
"Tom S" <mail@home.net> wrote:
>
>I'm using the WebBrowser control in a VB6 application to display an XML
doc
>as it is being created. I am using the transformNode method of the document
>to convert to an HTML string. I would like the XML to be displayed in the
>WebBrowser the same way it would in IE6. I found a stylesheet on my system
>in Windows/System32 named "xml.xsl" that works pretty well. Only difference
>is it does not provide the "+" and "-" characters for expanding and collasping
>the XML sturcture.
>Is there a stylesheet available for download somewhere that I can use to
>completely emulate the default XML style of IE6?
Marcus Tucker
03-08-2003, 09:32 PM
Or even easier, copy & paste this into IE's URL bar:
res://msxml.dll/DEFAULTSS.XSL
Then simply File-->Save and you're done! ;)
Regards,
Marcus Tucker
www.marcustucker.com
"Marian Olteanu" <marianolteanu@ya.nospam.hoo.com> wrote:
>
>The default stylesheet used by IE is found in msxml.dll
>It is the resource named DEFAULTSS.XSL
>To get it, open the dll using Visual C++ 6, "Open As Resource".
>But the stylesheet uses the old Microsoft version of XSLT (pre-XSLT 1.0):
>http://www.w3.org/TR/WD-xsl
>I think that it will be no problem for you.
>I also recomand you to look at http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20301558.html
>
>"Tom S" <mail@home.net> wrote:
>>
>>I'm using the WebBrowser control in a VB6 application to display an XML
>doc
>>as it is being created. I am using the transformNode method of the document
>>to convert to an HTML string. I would like the XML to be displayed in the
>>WebBrowser the same way it would in IE6. I found a stylesheet on my system
>>in Windows/System32 named "xml.xsl" that works pretty well. Only difference
>>is it does not provide the "+" and "-" characters for expanding and collasping
>>the XML sturcture.
>
>>Is there a stylesheet available for download somewhere that I can use to
>>completely emulate the default XML style of IE6?
>
Sergio Pereira
03-10-2003, 11:29 AM
Actually, file--> save is probably not enabled.
As the XSL will be displayed using itself to format the XML, you'll have to
copy/paste and fix the result.
The best solution is really to open the resource.
I used VS.NET to open the file "winnt\system32\msxml.dll" and open the
resource named "DEFAULTSS.XSL" under the HTML section of the DLL resources.
Here's the file for you:
<?xml version="1.0" ?>
<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
-left:.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
-left:.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")>0)
fix(e,"cb");}
if (e.className=="di"){if (e.children(0).innerText.indexOf("\n")>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<e.children.length;i++)
e.children(i).style.display="block";
}
else if (mark.innerText=="-"){
mark.innerText="+";
for (var i=1;i<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="block";
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"><!DOCTYPE <x:node-name /><I>(View Source for full
doctype...)</I>></SPAN>
</SPAN></DIV>
</x:template>
<x:template match="pi()">
<DIV class="e">
<SPAN class="b">
<x:entity-ref name="nbsp" />
</SPAN>
<SPAN class="m"><?</SPAN><SPAN class="pi"><x:node-name />
<x:value-of />
</SPAN><SPAN class="m">?></SPAN>
</DIV>
</x:template>
<x:template match="pi('xml')">
<DIV class="e">
<SPAN class="b">
<x:entity-ref name="nbsp" />
</SPAN>
<SPAN class="m"><?</SPAN><SPAN class="pi">xml <x:for-each
select="@*"><x:node-name />="<x:value-of />" </x:for-each></SPAN><SPAN
class="m">?></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"><!--</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">--></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"><![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">]]></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"><</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"> /></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"><</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">></SPAN></DIV>
<DIV><x:apply-templates />
<DIV><SPAN class="b"><x:entity-ref name="nbsp" />
</SPAN>
<SPAN class="m"></</SPAN><SPAN><x:attribute name="class"><x:if
match="x:*">x</x:if>t</x:attribute>
<x:node-name />
</SPAN><SPAN class="m">></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"><</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">></SPAN><SPAN class="tx"><x:value-of />
</SPAN><SPAN class="m"></</SPAN><SPAN><x:attribute name="class"><x:if
match="x:*">x</x:if>t</x:attribute>
<x:node-name />
</SPAN><SPAN class="m">></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"><</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">></SPAN></DIV>
<DIV><x:apply-templates />
<DIV><SPAN class="b"><x:entity-ref name="nbsp" />
</SPAN>
<SPAN class="m"></</SPAN><SPAN><x:attribute name="class"><x:if
match="x:*">x</x:if>t</x:attribute>
<x:node-name />
</SPAN><SPAN class="m">></SPAN></DIV>
</DIV>
</DIV>
</x:template>
</x:stylesheet>
--
_________________________________________
TJoker, MCSD
Chicago-based .NET developer
mailto:sergio_pereira@msn.com
-----------------------------------------
"Marcus Tucker" <me@marcustucker.com> wrote in message
news:3e6a9994$1@tnews.web.devx.com...
>
> Or even easier, copy & paste this into IE's URL bar:
> res://msxml.dll/DEFAULTSS.XSL
> Then simply File-->Save and you're done! ;)
>
>
> Regards,
>
> Marcus Tucker
> www.marcustucker.com
>
>
>
> "Marian Olteanu" <marianolteanu@ya.nospam.hoo.com> wrote:
> >
> >The default stylesheet used by IE is found in msxml.dll
> >It is the resource named DEFAULTSS.XSL
> >To get it, open the dll using Visual C++ 6, "Open As Resource".
> >But the stylesheet uses the old Microsoft version of XSLT (pre-XSLT 1.0):
> >http://www.w3.org/TR/WD-xsl
> >I think that it will be no problem for you.
> >I also recomand you to look at
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20301558.html
> >
> >"Tom S" <mail@home.net> wrote:
> >>
> >>I'm using the WebBrowser control in a VB6 application to display an XML
> >doc
> >>as it is being created. I am using the transformNode method of the
document
> >>to convert to an HTML string. I would like the XML to be displayed in
the
> >>WebBrowser the same way it would in IE6. I found a stylesheet on my
system
> >>in Windows/System32 named "xml.xsl" that works pretty well. Only
difference
> >>is it does not provide the "+" and "-" characters for expanding and
collasping
> >>the XML sturcture.
> >
> >>Is there a stylesheet available for download somewhere that I can use to
> >>completely emulate the default XML style of IE6?
> >
>
Tom S
03-10-2003, 04:00 PM
Thanks for posting the file contents. I was able to get it using the methods
in the other posts too. I guess there's something else I have to figure out
because when I use that XSL to transform XML into HTML and display in a
WebBrowser control in VB, it still doesn't appear the way the the XML would
if displayed in IE6. On the other hand, if I save the XML to a file, and
then give the WebBrowser control the path the file, it displays just the
same as in IE6.
For now I'll have to just accept it the way it is and keep making progress
on the rest of the project. Thank you everyone for your input.
devx.com
Copyright WebMediaBrands Inc. All Rights Reserved