Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1193

Re: Adding a CDATA section

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-Id <1854315.SyKVeVyVuy@PointedEars.de>
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <php@PointedEars.de>
Organization PointedEars Software (PES)
Date Tue, 19 Apr 2011 11:13:12 +0200
User-Agent KNode/4.4.7
Content-Transfer-Encoding 8Bit
Subject Re: Adding a CDATA section
Newsgroups comp.lang.php
References <f836e19a-0e5f-4962-8d3d-7b281f6ef629@o15g2000prn.googlegroups.com> <ioish6$hj6$1@lawngnome.eternal-september.org>
Followup-To comp.lang.php
MIME-Version 1.0
Lines 50
NNTP-Posting-Date 19 Apr 2011 11:13:13 CEST
NNTP-Posting-Host 64e6f47f.newsspool3.arcor-online.net
X-Trace DXC=lV98V@ZKefBE4ZB2flKORAMcF=Q^Z^V3H4Fo<]lROoRA8kF<OcfhCOKKNiIJLon_\EDZm8W4\YJNLT<8F<]0D<`IWB=c7`@?KXJ7Wl2HlOPGY@
X-Complaints-To usenet-abuse@arcor.de
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:1193

Followups directed to: comp.lang.php

Show key headers only | View raw


Adam Harvey wrote:

> JustWondering wrote:
>> What I'm expecting is:
>> 
>> <stocklist>
>>   <item type="fruit">
>>     <description><![CDATA[Apples are <b->yummy</b>]]></description>
>>   </item>
>>   <item type="vegetable">
>> </item></stocklist>
> 
> I'm not really sure why you'd expect that dash in <b->, but at any rate,
> running your code on a current PHP 5.3 build results in what I'd expect,
> which is:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <stockList>
>   <item type="fruit">
>     <description><![CDATA[Apples are <b>yummy</b>]]></description>
>   </item>
>   <item type="vegetable"/>
> </stockList>
> 
> What version of PHP are you running?

PHP is not the issue here, but that the OP has not understood what XML is 
(and how it is to be used), what a CDATA section is (that its content is 
*not* parsed except for `]]>', and so cannot possibly display bold because 
of <b>…</b> in it), and that Firebug's innerHTML-based Edit feature is shaky 
at best with XML documents served as text/html.

Something along

  header('Content-Type: text/xml; charset=UTF-8');

is missing after

  <?php

but that would still not display anything of the markup in bold.  (And that 
is good so.)


PointedEars
-- 
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Adding a CDATA section JustWondering <eastsidedev@gmail.com> - 2011-04-18 12:33 -0700
  Re: Adding a CDATA section Adam Harvey <usenet@adamharvey.name> - 2011-04-19 10:37 +0800
    Re: Adding a CDATA section Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-04-19 11:13 +0200
      Re: Adding a CDATA section JustWondering <eastsidedev@gmail.com> - 2011-04-19 08:13 -0700
        Re: Adding a CDATA section Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-04-20 10:51 +0200
          Re: Adding a CDATA section JustWondering <eastsidedev@gmail.com> - 2011-04-27 14:23 -0700
    Re: Adding a CDATA section JustWondering <eastsidedev@gmail.com> - 2011-04-19 07:50 -0700
  Re: Adding a CDATA section "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-04-19 09:40 +0200

csiph-web