SV: SV: [thelist] Namespace

Marcus Andersson marcan at home.se
Wed Dec 10 05:20:32 CST 2003


I would do like the following to get (what I guess) your target output:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:mytree="http://sometreenamespaceurl">

<xsl:template match="/">
  <html>
  
    <xsl:variable name="test" select="document( '../test.xml' )/"/>

    <xsl:processing-instruction name="IMPORT">
      <xsl:text>namespace="mytree"
implementation="../treeviewDiv/treeview.htc"</xsl:text>
    </xsl:processing-instruction>

    <body bgcolor="#ffffff" onload="PopulateMyTreeView();">
      <div
style="position:absolute;top:0px;left:0px;overflow-Y:auto;overflow-X:aut
o;height:100%;width:110%;scrollbar-base-color:#D6D3CE;scrollbar-darkshad
ow-color:#ffffff;scrollbar-face-color:#D6D3CE;scrollbar-highlight-color:
#D6D3CE;scrol#664;bar-track-color:#ffffff;unselectable:yes;">
        <mytree:treeview id="oTree"/>
      </div>
    </body>
  </html>
</xsl:template>

</xsl:stylesheet> 

I have removed usage of the xsl:element and xsl:attribute since I think
it's much simpler to do like I did here. Note also that I declared
mytree as a prefix in the stylesheet element which gives me the
possibility to use it everywhere in the stylesheet (without additional
declarations). The XSLT processor will then put it wherever needed in
the output document. You would also need to change how you create your
PI according to the example I provided.

/Marcus



More information about the thelist mailing list