[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl]

Subject: [xsl] <div id=$xslvar and document.getElementById($xslvar)
From: "meidan" <asafmei@xxxxxxxxxxxx>
Date: Sun, 26 Oct 2003 12:04:46 +0200

Hi,
I am trying to make id=$var and later on get that id with CDATA -
document.getElementById($var) so I can alter the position top left etc.
but I have a definition problem.
The relevant code:
<msxsl:script implements-prefix="ext" language="javascript">
  <![CDATA[
    function xsltoscript(xsltname){
       return xsltname;
   }
  ]]>
   </msxsl:script>
 <xsl:variable name="xslvar" select="//xmlelem"/>
<div Id="$xslvar"
   style="position:absolute; top:{$yposition - 20}; left:{$xposition}">
    <script language="JavaScript" >
         <![CDATA[
    document.getElementById(]]><xsl:value-of
select="ext:xsltoscript(string($xslvar))"/><![CDATA[).style.left=800;
    ]]>
    </script>
The xml file:
<xmlelem>sometext</xmlelem>
While processing that I get :'sometext' is not defined
While giving a variable that is not connected with an xml file
like:<xsl:variable="xslvar" select=" 'anything ' "/> it goes
with no problem.
Do you have any idea whats wrong here?
Udi




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml