xsl-list
[Top] [All Lists]

RE: xalan <xsl:element name="name()">

2003-10-10 07:31:01
From: David(_dot_)Pawson(_at_)rnib(_dot_)org(_dot_)uk 
[mailto:David(_dot_)Pawson(_at_)rnib(_dot_)org(_dot_)uk]
Sent: Friday, October 10, 2003 7:25 AM
Subject: [xsl] xalan <xsl:element name="name()">


A recent stylesheet I came across used
<xsl:template match ="elname">
<xsl:element name="name()">
  .....

Saxon spotted this as an error.
The author told me that xalan hadn't reported this as an error.

Any xalan users around to check this please?

Not sure what version of Xalan your correspondent used, but on v2.5.1d it
does return an error, as it should.  (How the error is handled is up to the
processor--it may simply report it, or leave the element out of the result
tree, but copy any child nodes.)

The value of the name attribute by definition is an AVT returning a valid
QName, so it should be written as:

<xsl:template match="elname">
<xsl:element name="{name()}">
  ...

hth,
b.

| brian martinez                           
brian(_dot_)martinez(_at_)cendant(_dot_)com |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

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



<Prev in Thread] Current Thread [Next in Thread>