You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andreas Hochsteger <e9...@student.tuwien.ac.at> on 2004/02/08 17:20:21 UTC
[cforms] XML Binding with HTMLArea
Hi,
how can I use a string which can be edited by the HTMLArea widget in an
XML binding?
The problem is, that the XHTML content which should be edited is only
shown with the tags removed.
Any ideas?
Thanks,
Andreas
Re: [cforms] XML Binding with HTMLArea
Posted by Stefano Mazzocchi <st...@apache.org>.
On 9 Feb 2004, at 03:12, Ugo Cei wrote:
> Andreas Hochsteger wrote:
>> how can I use a string which can be edited by the HTMLArea widget in
>> an XML binding?
>
> I'm afraid you'll have to do parsing/serialization by hand in your
> code. An HTMLArea is just a textarea with some DHTML and there is no
> support in CForms, AFAIK, for binding an XML document to a widget. It
> would be a welcome addition, though.
>
> HTMLArea should only produce well-formed XHTML, though, so there is no
> need to filter it with JTidy or such before parsing.
there is code in the linotype block that does that if you want to give
it a try (editor.js)
--
Stefano.
Re: [cforms] XML Binding with HTMLArea
Posted by Ugo Cei <u....@cbim.it>.
Andreas Hochsteger wrote:
> how can I use a string which can be edited by the HTMLArea widget in an
> XML binding?
I'm afraid you'll have to do parsing/serialization by hand in your code.
An HTMLArea is just a textarea with some DHTML and there is no support
in CForms, AFAIK, for binding an XML document to a widget. It would be a
welcome addition, though.
HTMLArea should only produce well-formed XHTML, though, so there is no
need to filter it with JTidy or such before parsing.
Ugo
Re: [cforms] XML Binding with HTMLArea
Posted by Andreas Hochsteger <e9...@student.tuwien.ac.at>.
Joerg Heinicke wrote:
> On 08.02.2004 18:45, Andreas Hochsteger wrote:
>
>> Hi!
>>
>> Thanks for your reply.
>> Do you mean the file woody-field-styling.xsl?
>>
>> I just had a look at it:
>> <!--
>> wi:field with @type 'htmlarea'
>> -->
>> <xsl:template match="wi:field[wi:styling[@type='htmlarea']]">
>> <textarea id="{@id}" name="{@id}" title="{wi:hint}">
>> <xsl:apply-templates select="." mode="styling"/>
>> <!-- remove carriage-returns (occurs on certain versions of IE
>> and doubles linebreaks at each submit) -->
>> <xsl:copy-of select="translate(wi:value/node(), ' ', '')"/>
>
>
> translate() must not be used here as it operates on /returns a
> string(s), no nodeset(s). But from reading Ugo's message I don't know if
> this solves the core of your problem.
translate() is part of the original woody-field-styling.xsl, so perhaps
it should be changed there?
Concerning my problem I think the best solution would be to implement
something like an XML datatype and some converters for Woody.
But first I have to dig into the internals of Woody I guess ;-)
Or is there a better way?
> Joerg
Andreas
Re: [cforms] XML Binding with HTMLArea
Posted by Joerg Heinicke <jo...@gmx.de>.
On 08.02.2004 18:45, Andreas Hochsteger wrote:
> Hi!
>
> Thanks for your reply.
> Do you mean the file woody-field-styling.xsl?
>
> I just had a look at it:
> <!--
> wi:field with @type 'htmlarea'
> -->
> <xsl:template match="wi:field[wi:styling[@type='htmlarea']]">
> <textarea id="{@id}" name="{@id}" title="{wi:hint}">
> <xsl:apply-templates select="." mode="styling"/>
> <!-- remove carriage-returns (occurs on certain versions of IE and
> doubles linebreaks at each submit) -->
> <xsl:copy-of select="translate(wi:value/node(), ' ', '')"/>
translate() must not be used here as it operates on /returns a
string(s), no nodeset(s). But from reading Ugo's message I don't know if
this solves the core of your problem.
Joerg
Re: [cforms] XML Binding with HTMLArea
Posted by Andreas Hochsteger <e9...@student.tuwien.ac.at>.
Yes, but without success.
Can you give me some hints or keywords what I should search for?
Thanks.
Nicolas Toper wrote:
> Have you looked in the archives? I know someone had a
> similar problem...
> --- Andreas Hochsteger
> <e9...@student.tuwien.ac.at> a écrit : > Hi!
>
>>Thanks for your reply.
>>Do you mean the file woody-field-styling.xsl?
>>
>>I just had a look at it:
>> <!--
>> wi:field with @type 'htmlarea'
>> -->
>> <xsl:template
>>match="wi:field[wi:styling[@type='htmlarea']]">
>> <textarea id="{@id}" name="{@id}"
>>title="{wi:hint}">
>> <xsl:apply-templates select="."
>>mode="styling"/>
>> <!-- remove carriage-returns (occurs on
>>certain versions of IE
>>and doubles linebreaks at each submit) -->
>> <xsl:copy-of
>>select="translate(wi:value/node(), '
>
> ', '')"/>
>
>> </textarea>
>> <xsl:apply-templates select="." mode="common"/>
>> <script
>>
>
> language="JavaScript">HTMLArea.replace('<xsl:value-of
>
>>select="@id"/>',htmlareaconfig);</script>
>> </xsl:template>
>>
>>It seems that there is already xsl:copy-of in use.
>>Is it possible to signal the binding framework, that
>>it should treat the
>>string as XML?
>>
>>Thanks,
>>
>>Andreas
>>
>>Nicolas Toper wrote:
>>
>>
>>>Hi,
>>>
>>>I just had the same problem with my own CMS. The
>>>problem is using xsl:copy-of instead of value-of.
>>>
>>>Hope it helps :=)
>>>
>>>nicolas
>>> --- Andreas Hochsteger
>>><e9...@student.tuwien.ac.at> a écrit : > Hi,
>>>
>>>
>>>>how can I use a string which can be edited by the
>>>>HTMLArea widget in an
>>>>XML binding?
>>>>The problem is, that the XHTML content which
>>
>>should
>>
>>>>be edited is only
>>>>shown with the tags removed.
>>>>
>>>>Any ideas?
>>>>
>>>>Thanks,
>>>>
>>>>Andreas
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>Yahoo! Mail : votre e-mail personnel et gratuit
>>
>>qui vous suit partout !
>>
>>>Créez votre Yahoo! Mail sur
>>
>>http://fr.benefits.yahoo.com/
>>
>>>
>
>
>
>
>
>
>
> Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
>
Re: [cforms] XML Binding with HTMLArea
Posted by Nicolas Toper <nt...@yahoo.fr>.
Have you looked in the archives? I know someone had a
similar problem...
--- Andreas Hochsteger
<e9...@student.tuwien.ac.at> a écrit : > Hi!
>
> Thanks for your reply.
> Do you mean the file woody-field-styling.xsl?
>
> I just had a look at it:
> <!--
> wi:field with @type 'htmlarea'
> -->
> <xsl:template
> match="wi:field[wi:styling[@type='htmlarea']]">
> <textarea id="{@id}" name="{@id}"
> title="{wi:hint}">
> <xsl:apply-templates select="."
> mode="styling"/>
> <!-- remove carriage-returns (occurs on
> certain versions of IE
> and doubles linebreaks at each submit) -->
> <xsl:copy-of
> select="translate(wi:value/node(), '
', '')"/>
> </textarea>
> <xsl:apply-templates select="." mode="common"/>
> <script
>
language="JavaScript">HTMLArea.replace('<xsl:value-of
>
> select="@id"/>',htmlareaconfig);</script>
> </xsl:template>
>
> It seems that there is already xsl:copy-of in use.
> Is it possible to signal the binding framework, that
> it should treat the
> string as XML?
>
> Thanks,
>
> Andreas
>
> Nicolas Toper wrote:
>
> > Hi,
> >
> > I just had the same problem with my own CMS. The
> > problem is using xsl:copy-of instead of value-of.
> >
> > Hope it helps :=)
> >
> > nicolas
> > --- Andreas Hochsteger
> > <e9...@student.tuwien.ac.at> a écrit : > Hi,
> >
> >>how can I use a string which can be edited by the
> >>HTMLArea widget in an
> >>XML binding?
> >>The problem is, that the XHTML content which
> should
> >>be edited is only
> >>shown with the tags removed.
> >>
> >>Any ideas?
> >>
> >>Thanks,
> >>
> >>Andreas
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Mail : votre e-mail personnel et gratuit
> qui vous suit partout !
> > Créez votre Yahoo! Mail sur
> http://fr.benefits.yahoo.com/
> >
> >
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Re: [cforms] XML Binding with HTMLArea
Posted by Andreas Hochsteger <e9...@student.tuwien.ac.at>.
Hi!
Thanks for your reply.
Do you mean the file woody-field-styling.xsl?
I just had a look at it:
<!--
wi:field with @type 'htmlarea'
-->
<xsl:template match="wi:field[wi:styling[@type='htmlarea']]">
<textarea id="{@id}" name="{@id}" title="{wi:hint}">
<xsl:apply-templates select="." mode="styling"/>
<!-- remove carriage-returns (occurs on certain versions of IE
and doubles linebreaks at each submit) -->
<xsl:copy-of select="translate(wi:value/node(), ' ', '')"/>
</textarea>
<xsl:apply-templates select="." mode="common"/>
<script language="JavaScript">HTMLArea.replace('<xsl:value-of
select="@id"/>',htmlareaconfig);</script>
</xsl:template>
It seems that there is already xsl:copy-of in use.
Is it possible to signal the binding framework, that it should treat the
string as XML?
Thanks,
Andreas
Nicolas Toper wrote:
> Hi,
>
> I just had the same problem with my own CMS. The
> problem is using xsl:copy-of instead of value-of.
>
> Hope it helps :=)
>
> nicolas
> --- Andreas Hochsteger
> <e9...@student.tuwien.ac.at> a écrit : > Hi,
>
>>how can I use a string which can be edited by the
>>HTMLArea widget in an
>>XML binding?
>>The problem is, that the XHTML content which should
>>be edited is only
>>shown with the tags removed.
>>
>>Any ideas?
>>
>>Thanks,
>>
>>Andreas
>
>
>
>
>
>
>
> Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
>
Re: [cforms] XML Binding with HTMLArea
Posted by Nicolas Toper <nt...@yahoo.fr>.
Hi,
I just had the same problem with my own CMS. The
problem is using xsl:copy-of instead of value-of.
Hope it helps :=)
nicolas
--- Andreas Hochsteger
<e9...@student.tuwien.ac.at> a écrit : > Hi,
>
> how can I use a string which can be edited by the
> HTMLArea widget in an
> XML binding?
> The problem is, that the XHTML content which should
> be edited is only
> shown with the tags removed.
>
> Any ideas?
>
> Thanks,
>
> Andreas
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/