W3C home > Mailing lists > Public > www-xsl-fo@w3.org > November 2004

About XSL and CDATA HTML content management...

From: Patrick Gelin <patrick.gelin@rpn.ch>
Date: Fri, 26 Nov 2004 09:56:09 +0100
To: www-xsl-fo@w3.org
Message-ID: <co6r9a$quj$1@sea.gmane.org>


I want to manage new line into tags contents. I'm working with a PHP web
site, using a PHP-XMLRPC client and then the XML data received is parsed
with a XSL script. This is the input XML data:

<?xml version="1.0" encoding="UTF-8"?>
<requirement identifier="aaaaaaaa" name="aaaaaaaaa" priority="high"
  <revision date="2004-11-25 13:29:22" label="aaaaaaaa">
    <author id="gelinp">Patrick Gelin</author>
    <comment><![CDATA[aaaaaaaa aaaaaaa]]></comment>
  <description><![CDATA[aaaaaaa<br /><br />

So, Firstly I tried to use \n with <comment> tag but XML-RPC replaced it
with a space... 

Then, I tried with <br> tag, it's ok for PHP-XMLRPC but the XSL script
(below) modify the HTML content tag and '<BR>' to '&lt;br /&gt;'...

The XSL script:
<td colspan="2">
  <out:attribute xmlns:out="http://www.w3.org/1999/XSL/Transform"
  <out:value-of select="$CSSPrefix"/>FormData</out:attribute>
  <textarea name="req_description" cols="100" rows="10" style="width:100%">
    <out:if xmlns:out="http://www.w3.org/1999/XSL/Transform"
test="$ChangeHandler != ''">
      <out:attribute name="onChange">
        <out:value-of select="$ChangeHandler"/>
    <out:attribute xmlns:out="http://www.w3.org/1999/XSL/Transform"
    <out:value-of select="$CSSPrefix"/>FormControl</out:attribute>
    <out:value-of xmlns:out="http://www.w3.org/1999/XSL/Transform"

and the HTML result:
<td colspan="2" class="FormData">
<textarea name="req_description" cols="100" rows="10" style="width:100%"
class="FormControl">aaaaaaa&lt;br /&gt;&lt;br /&gt; bbbbbbbb</textarea>

So, I'm asking myself why XSL modified my CDATA HTML section ? 

Received on Friday, 26 November 2004 09:48:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:29 UTC