Re: [xsl] Display an Xml file in a window

Subject: Re: [xsl] Display an Xml file in a window
From: "Dimitar Peikov" <mitko@xxxxxxx>
Date: Thu, 13 Sep 2001 14:02:04 +0300
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="";><xsl:output method="html"/>
<xsl:template match="root"><xsl:value-of select="item"/></xsl:template>

   var result = objA.transformNode(objB);
   if (result.indexOf("xml") == -1)
        xsl = "yes";
   return true;
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 

 XSL-List info and archive:

Current Thread