[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: msxml stylesheet for displaying xml tree question

Subject: RE: msxml stylesheet for displaying xml tree question
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Mon, 05 Jan 2004 13:53:26 +0000
defaultss.xsl
From: "bryan" <bry@xxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  msxml stylesheet for displaying xml tree question
Date: Mon, 5 Jan 2004 14:22:01 +0100


This is really sort of off-topic, I was thinking I might like to improve my defaultss.xsl version I have, to do some of the things I want I need to add some extension functions, one of which would be a function that finds where the xml document that the xslt is displaying is located at (remember that defaultss.xsl is a resource in the .dll) anyone have suggestions on the best way to do this? Perhaps there's some hidden objects/methods/properties exposed to the scripting environment for extension functions in msxml that someone out there knows about?



Not sure what sort of things you need. I wrote a couple of trivial extensions for IE for looking at source code etc. They are both use a skeleton provided by Microsoft. They don't modify the default stylesheet though. They might give you some ideas...
Run this reg file after copying the two files to the folders specified.


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Show XML]
@="C:\\WINNT\\Web\\ShowXml.htm"
"contexts"=hex:01

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Show XSL]
@="C:\\WINNT\\Web\\ShowXsl.htm"
"contexts"=hex:01

The two files are:
<!-- ShowXml.htm -->
<html>
<body>
<script language="JavaScript" defer>
<!--
// specific to context menu extensions
var win = external.menuArguments;
// the document object the user right-clicked on
var doc = win.document;
var sXml;
var sTitle;
// make sure our debugging window is a unique window
var wincounter = 0;

var mywin = window.open("about:blank", "source" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes");
while (mywin == null)
{
mywin = window.open("about:blank", "source" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes");
} // if (mywin == null)


var myDoc = mywin.document;

myDoc.open("text/plain");
if (doc.XMLDocument)
{
 sXml = doc.XMLDocument.xml;
 sTitle = "XML for: " + win.location.href;
}
else
{
 sXml = "No XML data found for document.";
 sTitle = "No XML for: " + win.location.href;
}
myDoc.write(sXml);
myDoc.close();
myDoc.title = sTitle;

// -->
</script>
</body>
</html>

AND

<!-- ShowXsl.htm -->
<html>
<body>
<script language="JavaScript" defer>
<!--
// specific to context menu extensions
var win = external.menuArguments;
// the document object the user right-clicked on
var doc = win.document;
var sXsl;
var sTitle;
// make sure our debugging window is a unique window
var wincounter = 0;

var mywin = window.open("about:blank", "source" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes");
while (mywin == null)
{
mywin = window.open("about:blank", "source" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes");
} // if (mywin == null)


var myDoc = mywin.document;

myDoc.open("text/plain");
if (doc.XSLDocument)
{
 sXsl = doc.XSLDocument.xml;
 sTitle = "XSL for: " + win.location.href;
}
else
{
 sXsl = "No stylesheet found for document.";
 sTitle = "No XSL for: " + win.location.href;
}
myDoc.write(sXsl);
myDoc.close();
myDoc.title = sTitle;


// --> </script> </body> </html>

--

Joe

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.