cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <coc...@lojjic.net>
Subject Re: [CFORMS] HTML in field
Date Thu, 03 Aug 2006 13:50:45 GMT
werner wrote:
> Jason Johnston wrote:
>> So what you're wanting is a way to take the String contents of a form
>> widget and have it parsed into SAX events and inserted into the SAX
>> stream, correct?  Note that it's not as simple as just disabling escaping
>> of XML characters, because that's just a serialization concern, whereas
>> you want to actually have it parsed into SAX.  AFAIK there is no way using
>> the standard <ft:widget> mechanism or XSLT to achieve this.
>>
>> I think JXTemplate is going to be your best bet.  I'm assuming you're
>> already using JXTemplateGenerator in your display pipeline; if you're
>> using FormsTemplateTransformer instead then I'd suggest switching to JX
>> (it's the preferred method nowadays).  Then you've got a couple choices:
>>
>> 1) If you're using the JX implementation from the 'template' block (cocoon
>> 2.1.9+ only), then you can use the xmlize="true" attribute of jx:out:
>>
>>   <jx:set var="xhtmlString"
>> value='${widget.getChild("myOutputWidget").getValue()}' />
>>   <jx:out value="${xhtmlString}" xmlize="true" />
>>
>>   
> Yes, I'm using 2.1.9 with the NewJXTemplategenerator. I didn't know of 
> the the xmlize feature. It looks like the right approach, but it does 
> not work because I use the widget in a repeater row. I get the following 
> errors:
> 
> org.xml.sax.SAXParseException: Content is not allowed in prolog.
> 
> *Fatal error parsing null (line 1 col. 1): Content is not allowed in 
> prolog.*
> context://forms/firmenEditIITemplate.xml - 349:72 	//
> 
> 
> *Fatal error parsing null (line 1 col. 1): Content is not allowed in 
> prolog.*
> resource://org/apache/cocoon/forms/generation/jx-macros.xml - 241:27 	//
> 
> 
> *{http://apache.org/cocoon/forms/1.0#template}repeater-rows: Fatal error 
> parsing null (line 1 col. 1): Content is not allowed in prolog.*
> context://forms/firmenEditIITemplate.xml - 336:29 	//
> 
> 
> *{http://apache.org/cocoon/forms/1.0#template}repeater-rows: Fatal error 
> parsing null (line 1 col. 1): Content is not allowed in prolog.*
> resource://org/apache/cocoon/forms/generation/jx-macros.xml - 232:23 	//
> 
> 
> *{http://apache.org/cocoon/forms/1.0#template}repeater: 
> {http://apache.org/cocoon/forms/1.0#template}repeater-rows: Fatal error 
> parsing null (line 1 col. 1): Content is not allowed in prolog.*
> context://forms/firmenEditIITemplate.xml - 324:38 

It looks like maybe your user-entered content isn't able to be parsed as 
XML?  I guess I assumed you'd be running some sort of cleanup on 
user-entered content to make sure it's well-formed and all.  Also, 
remember an XML document can contain only a single root element, so you 
may need to wrap those contents in a <div></div> or something before 
parsing.




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


Mime
View raw message