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

?MSXML transformNode

Subject: ?MSXML transformNode
From: Serg Stone <serg_stone@xxxxxxxxx>
Date: Wed, 9 Aug 2000 08:32:46 +0400
msxml transformnode
Hello, All

Can anybody help me with MS XSLT???

I have XML file and XSLT file that converts it into HTML. The result
is simple HTML table. It has <COL> specifications for all columns. For
some columns <COL align="right"> is used.
When I apply transformNode() function to the table right align is
changed by simple left align. Is it a bug or feature of MSIE?

Can anyone test if it is problem of mine?
Following is an example.
=============
XML-file:
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="test.xsl" ?>
<tbl>
 <tbl_head>
  <tbl_row>
        <c0>Col0</c0>
        <c1>Col1</c1>
  </tbl_row>
 </tbl_head>
 <tbl_col>
  <tbl_row>
        <c0 />
        <c1 />
  </tbl_row>
 </tbl_col>
 <tbl_body>
  <tbl_row>
        <c0>4</c0>
        <c1>1</c1>
  </tbl_row>
  <tbl_row>
        <c0>2</c0>
        <c1>3</c1>
  </tbl_row>
 </tbl_body>
</tbl>
=========================
XSL file:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="/">
<HTML>
<SCRIPT><xsl:comment><![CDATA[
function on_head_click(){
//alert('sdfg');
        tbl.innerHTML=source.documentElement.transformNode(stylesheet);
}
]]></xsl:comment></SCRIPT>
<SCRIPT for="window" event="onload"><xsl:comment><![CDATA[
        stylesheet=document.XSLDocument;
        source=document.XMLDocument;
]]></xsl:comment></SCRIPT>
<BODY bgcolor="threedface"  topmargin="0" leftmargin="0">
  <DIV id="tbl"><xsl:apply-templates select="tbl" /></DIV>
</BODY>
</HTML>
</xsl:template>
<!--==-->
<xsl:template match="tbl">
<span style='background-color:#777777'>
<TABLE id="lines" border="1" align="center" bordercolor="#bbbbbb" cellpadding="0" cellspacing="1">
  <xsl:apply-templates select="tbl_head" />
  <xsl:apply-templates select="tbl_col" />
  <xsl:apply-templates select="tbl_body" />
</TABLE>
</span>
</xsl:template>

<xsl:template match="tbl_head">
  <xsl:apply-templates select="tbl_row" />
</xsl:template>

<xsl:template match="tbl_head/tbl_row">
<TR>
  <xsl:for-each select="*">
    <TH>
        <xsl:attribute name="onClick">on_head_click()</xsl:attribute>
        <xsl:value-of select="." />
    </TH>
  </xsl:for-each>
</TR>
</xsl:template>

<xsl:template match="tbl_col">
  <xsl:apply-templates select="tbl_row" />
</xsl:template>

<xsl:template match="tbl_col/tbl_row">
<TR>
  <xsl:for-each select="*">
    <COL align="right">
        <xsl:value-of select="." />
    </COL>
  </xsl:for-each>
</TR>
</xsl:template>

<xsl:template match="tbl_body">
  <xsl:apply-templates select="tbl_row" />
</xsl:template>

<xsl:template match="tbl_body/tbl_row">
<TR>
  <xsl:for-each select="*">
    <TD>
        <xsl:value-of select="." />
    </TD>
  </xsl:for-each>
</TR>
</xsl:template>

</xsl:stylesheet>
==============================
-- 
Best regards,
 Serg                            mailto:serg_stone@xxxxxxxxx



 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.