[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: MSXML 3.0 XSLT. Does it work?
Ok, considering Jeni's remarks, I changed you your "SearchSet" opening tag from: <SearchSet xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:plss="urn:ctl.com:plss"> into: <SearchSet xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:plss="urn:ctl.com:plss"> By removing the namespace declaration without prefix. Then I get: <MIFFile 5.0> <MIFFile 4.0> <MIFFile 3.0> This looked to be a cohabitation problem between IE5 and MSXML3. It makes no sense. I am sure the "xsl:for-each" element works. Anyway, I decided to make a little VbScript to check the real text output. I called it "testss.vbs" and it generates a "testss.html" file. Here goes the script: sub Main() dim xmlDom dim xslDom dim res Dim fso Dim ftxt Set xmlDom = CreateObject("MSXML2.DOMDocument") Set xslDom = CreateObject("MSXML2.DOMDocument") Set fso = CreateObject("Scripting.FileSystemObject") xmlDom.load "testss.xml" xslDom.load "testss.xsl" res = xmlDom.transformNode(xslDom) Set ftxt = fso.CreateTextFile("testss.html", True) ftxt.Write res ftxt.Close ' MsgBox res end sub call Main If you have MS Scripting installed you can run it by typing: WScript testss.vbs at the DOS Prompt. The programm is also simple to convert to any language supporting COM, especially VB. But be aware that if you may not have the Microsoft Scripting RunTime - for the "Scripting.FileSystemObject" object that is used to write the resulting text to the file - installed in your machine, if you do not have the MS Scripting Host. You will have to write the text resulting from the transformation in another way then. The ouput of this program shows like: <MIFFile 5.0><MIFFile 4.0>PL000009901<MIFFile 3.0><MIFFile 4.0>PL000009901<MIFFile 3.0> in Internet Explorer 5. The text is: <MIFFile 5.0><MIFFile 4.0>PL000009901<MIFFile 3.0><MIFFile 4.0>PL000009901<MIFFile 3.0> If you replace <xsl:text disable-output-escaping="no"><MIFFile 4.0></xsl:text> <xsl:apply-templates/> with <xsl:text disable-output-escaping="no"><MIFFile 4.0></xsl:text> <xsl:apply-templates select="ItemRecord"/> you get the desired <MIFFile 5.0><MIFFile 4.0><MIFFile 3.0><MIFFile 4.0><MIFFile 3.0> The numbers where showing up due to the default template action. You should use this kind of technique to debug your transformations in the future. Have fun, Paulo Gaspar > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of sotiris@xxxxxxxxxx > Sent: Wednesday, July 12, 2000 10:32 > To: xsl-list@xxxxxxxxxxxxxxxx > Subject: Re: MSXML 3.0 XSLT. Does it work? > > > > Hi everyone, > > here is an example of my XML code and style sheet and the results in > produces using MSXML 3.0. > The stylesheet is: > > <xsl:stylesheet version="1.0" xmlns:xsl > ="http://www.w3.org/1999/XSL/Transform"> > <xsl:output method="html" indent="yes"/> > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> > <xsl:template match="SearchSet"> > <xsl:apply-templates/> > </xsl:template> > <xsl:template match="SearchResults"> > <xsl:text disable-output-escaping="no"><MIFFile > 5.0></xsl:text> > <xsl:for-each select="RowSet"> > <xsl:text disable-output-escaping="no"><MIFFile > 4.0></xsl:text> > <xsl:apply-templates/> > </xsl:for-each> > </xsl:template> > <xsl:template match="ItemRecord"> > <xsl:text disable-output-escaping="no"><MIFFile > 3.0></xsl:text> > </xsl:template> > </xsl:stylesheet> > > The XML Code is: > > <?xml-stylesheet type="text/xsl" href="testss.xsl"?> > <SearchSet xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt > ="urn:schemas-microsoft-com:datatypes" xmlns:plss="urn:ctl.com:plss"> > <SearchResults> > <RowSet plss:linkref="PL00000990" plss:linktype="xml"> > <serno dt:dt="string">PL00000990</serno> > <hitcount dt:dt="string">1</hitcount> > <ItemRecord> > <SerNo>PL00000990</SerNo> > </ItemRecord> > </RowSet> > <RowSet plss:linkref="PL00000990" plss:linktype="xml"> > <serno dt:dt="string">PL00000990</serno> > <hitcount dt:dt="string">1</hitcount> > <ItemRecord> > <SerNo>PL00000978</SerNo> > </ItemRecord> > </RowSet> > </SearchResults> > </SearchSet> > > and the resultant output is: > > PL000009901PL00000990PL000009901PL00000978 > > What I would have expected is: > > <MIFFile 5.0><MIFFile 4.0><MIFFile 3.0><MIFFile4.0><MIFFile 3.0> > > Can anyone tell why the above is happening? I have installed MSXML 3.0 in > "replace" mode. > > Kind regards > Sotiris, CTL, Cyprus > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|