This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Display an Xml file in a window
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Display an Xml file in a window
- From: "Dimitar Peikov" <mitko at rila dot bg>
- Date: Thu, 13 Sep 2001 14:02:04 +0300
- Reply-To: xsl-list at lists dot mulberrytech dot com
In order to use dynamic content you must first create object like this :
var obj = CreateObject("MSXML.DOMDocument");
and to maintain XML using this object. This is in case you use this in M$
Windows environment, because this object is taken from the registry.
The following code is slightly modified from the MSXML4 documentation. See
this document for further info.
-------------------------------
<script language="javascript">
function transformIt() {
var objWithPrefixes = document.all['transformedXSL'];
var objA = new ActiveXObject('MSXML.DOMDocument');
var objB = new ActiveXObject('MSXML.DOMDocument');
objA.loadXML('<?xml version="1.0"?><root><item>yes</item></root>');
objB.loadXML('<?xml version="1.0"?><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html"/>
<xsl:template match="root"><xsl:value-of select="item"/></xsl:template>
</xsl:stylesheet>');
var result = objA.transformNode(objB);
if (result.indexOf("xml") == -1)
xsl = "yes";
return true;
}
</script>
-------------------------------
--
Dimitar Peikov
Programmer Analyst
Globalization Group
"We Build e-Business"
RILA Solutions
27 Building, Acad.G.Bonchev Str.
1113 Sofia, Bulgaria
phone: (+359 2) 9797320
phone: (+359 2) 9797300
fax: (+359 2) 9733355
http://www.rila.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list