cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject Re: fp and attributes
Date Fri, 15 Dec 2000 13:14:20 GMT
Ok, I get you.
Hope? that Jeremi will implement this in the new version of FP if he didn't
do it yet.

----- Original Message -----
From: "Kjartan Müller" <kjartan.muller@usit.uio.no>
To: <cocoon-users@xml.apache.org>
Sent: 15 ??????? 2000 ?., ??????? 16:00
Subject: Re: fp and attributes


It's not a problem reading from attributes and elements with 'fp:read', or
writing to elements with 'fp:write'. The problem is that when you try to
write to an attribute using 'fp:write' and 'as string', fp assumes that the
node is an element, tries to cast it as such and append a textnode -- which
kind of excludes attributenodes. I've just added a quick check that rather
sets the attributevalue if the node is an attribute. What I haven't done,
and should be done if it really were to be considered a patch, is to make
sure fp also creates the necessary attribute as it does with elements today.

Kjartan

>I don't understand what was the problem.
>Could you please tell me what did you changed. Is that a problem with
>reading or writing with FP?
>Maybe your patch will be useful for others too.
>
>----- Original Message -----
>From: "Kjartan Müller" <kjartan.muller@usit.uio.no>
>To: <cocoon-users@xml.apache.org>
>Sent: 15 ??????? 2000 ?., ??????? 15:29
>Subject: Re: fp and attributes
>
>
>Thanks, but that doesn't really do the trick. I have these documents (SMIL
>1.0), and would like to be able to edit the html-like meta-elements through
>fp doing something like this:
>
>-----
><input name="title" type="text">
><xsp:attribute name="label"><fp:read select="title/label"
>from="metadata"/></xsp:attribute>
><fp:if-post>
><fp:write to="external-item" select="meta[@name='title']/@content"
>as="string">
><request:get-parameter name="title"/>
></fp:write>
></fp:if-post>
><fp:read select="meta[@name='title']/@content" from="external-item"
>as="string"/>
></input>
>-----
>
>Actually, I just looked into the code and made a fix that works for me. I
>don't know it it should be posted as a patch or something.
>
>Kjartan
>
>At 13:36 15.12.00 +0300, you wrote:
>>You can do it like this:
>>
>><xsp:attribute name="att-name"><fp:read select="your-xpath"
>>.../></xsp:attribute>
>>or with XSL <xsl:attribute ... and so on.
>>
>>Kot.
>>
>>----- Original Message -----
>>From: "Kjartan Müller" <kjartan.muller@usit.uio.no>
>>To: <cocoon-users@xml.apache.org>
>>Subject: fp and attributes
>>
>>
>>Hi!
>>I've been doing different things with the fp-taglib lately, and think its
>>rather cool. But one thing I'm really missing, is the posibility to also
>>write strings directly to attributes -- not just textnodes. Would that be
>>stretching the intention with fp, or should that be fixed?
>>
>>Kjartan


_______________________________________________
Kjartan Müller
kjartan.muller@usit.uio.no
tlf: (47) 22 84 01 15
mobil: (47) 99 35 79 49
privat: (47) 22 38 44 46

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message