(forwarding to the list, I didn't noticed the reply-to header)

-------- Original Message --------
Objet: Re: [C2] : <xsp:attribute> not really OK !!
Date: Mon, 11 Jun 2001 16:42:57 +0200
De: Sylvain Wallez <[EMAIL PROTECTED]>
Société: Anyware Technologies
A: [EMAIL PROTECTED]
Références: <[EMAIL PROTECTED]>



Samuel ARNOD-PRIN a écrit :
> 
> It is maybe not a bug... but xsp:attribute are difficult to handle using
> C2...
> 
> for example :
> 
> <mytag>
> <xsp:logic>String text="here is my value";</xsp:logic>
> <xsp:attribute
> name="myattribute"><xsp:expr>text</xsp:expr></xsp:attribute>
> </mytage>
> 
> is ... WRONG !
> 

The change from DOM (C1) to SAX (C2) has put additional constraints on
<xsp:attribute> :
- in DOM, attributes are added on an element _after_ the element is
created, and so intermixed <xsp:logic> and <xsp:attribute> inside the
element are evaluated in document order.
- in SAX, attributes must be known _before_ the beginning of the
element, because they are parameters of startElement(). So the C2 XSP
engine evaluates all xsp:attributes prior to starting the element, and
evaluates its content after, including <xsp:logic> tags.

So your example should be written
<xsp:logic>
  String text="here is my value";
  <mytag>
    <xsp:attribute
name="myattribute"><xsp:expr>text</xsp:expr></xsp:attribute>
  </mytag>
</xsp:logic>

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to