W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 2002

Copy node and sub-node in HTML hidden field

From: Benoit Segaert <benoit.segaert@uniway.be>
Date: Wed, 17 Apr 2002 17:36:28 +0200
Message-ID: <3CBD967C.E37837BB@uniway.be>
To: xsl-editors@w3.org
I need to copy a XHTML node and subnode in an attribute.

If I want to copy
in an attribute, I receive an error from my XSLT parser:
    Cannot write an attribute when there is no open start tag.

I have try the following codes:
    <xsl:template match="tag">
        <xsl:variable name = "content" ><xsl:copy-of
        <input type="hidden" value="{$content}"/>

    <xsl:template match="tag">
         <xsl:element name="input">
              <xsl:attribute name="type">hidden</xsl:attribute>
              <xsl:attribute name="name"><xsl:value-of
              <xsl:attribute name="value"><xsl:copy-of

But if I put the content in a textarea, I have any problem:

 <TEXTAREA  rows="{$lineNumber}" name="{$id}" style="width: 100%">
      <xsl:copy-of select="node()|@*"/>

Can you help me?
Received on Wednesday, 17 April 2002 11:36:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:22 UTC