Re: [Xsltforms-support] CDATA in subforms
Brought to you by:
alain-couthures
|
From: Alain C. <ala...@ag...> - 2015-07-07 19:24:11
|
Tim,
I have now committed CDATA support:
* script content is "escaped" with CDATA for "text/javascript" and
"text/turtle"
* @cdata-section-elements in submission is supported for all major
browsers
Thank you for your feedback!
--Alain
Le 06/07/2015 20:00, Tim Thompson a écrit :
> Alain,
>
> I think adding the proposed CDATA encapsulations to script elements
> would be a great solution.
>
> Regarding @cdata-section-elements, I do need this functionality, in
> some form, for the application I'm working on. But my first preference
> would be to output the CDATA sections on the server using XQuery.
> Unfortunately, eXist does not currently support cdata-section-elements
> as a serialization parameter either, so I was considering the
> @cdata-section-elements submission attribute as a temporary
> workaround. I do think this would be a good feature to have, but for
> now, just adding the CDATA encapsulations would make a big difference.
>
> Thanks again!
> Tim
>
>
> --
> Tim A. Thompson
> Metadata Librarian (Spanish/Portuguese Specialty)
> Princeton University Library
>
>
> On Mon, Jul 6, 2015 at 1:08 PM, Alain Couthures
> <ala...@ag... <mailto:ala...@ag...>>
> wrote:
>
> Tim,
>
> XSLT does not preserve CDATA nodes but treats them into text
> nodes. It is still possible to treat script elements according to
> their type attributes. I can modified the XSLT stylesheet
> accordingly: for "text/javascript", the script value can be
> encapsulated with "/* <![CDATA[ */" and "/* ]]> */", and, for
> "text/turtle", with "# <![CDATA[" and "# ]]>". What do you think?
>
> For submission, adding support for @cdata-section-elements is not
> difficult for non-IE browsers because serialization is performed
> with Javascript instructions. For IE, because serialization is
> still based on an XSLT transformation, the stylesheet source would
> have to be adapted according to @cdata-section-elements value. Do
> you already need this?
>
> --Alain
>
>
> Le 05/07/2015 04:10, Tim Thompson a écrit :
>> Alain,
>>
>> I am trying to load a subform that contains a <script
>> type="text/turtle"> tag with RDF data serialized as Turtle.
>>
>> This data is enclosed in a CDATA section (per
>> http://www.w3.org/TR/turtle/#h3_xhtml). However, when I load the
>> subform (as XHTML), the CDATA is ignored and all <> characters
>> are escaped, which causes the Turtle parser I am using to break.
>> Shouldn't CDATA contents be ignored when a subform is loaded?
>>
>> As a related question, does XSLTForms support the
>> @cdata-section-elements attribute on <xf:submission>? I see some
>> reference to it in the code, but wasn't sure whether it had been
>> fully implemented. This could be very useful for dealing with
>> non-XML formats in hybrid applications.
>>
>> Many thanks,
>> Tim
>>
>> --
>> Tim A. Thompson
>> Metadata Librarian (Spanish/Portuguese Specialty)
>> Princeton University Library
>>
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>>
>>
>> _______________________________________________
>> Xsltforms-support mailing list
>> Xsl...@li...
>> <mailto:Xsl...@li...>
>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support
>
>
|