[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

libxml and CDATA

Thomas Mueller

12/13/2006 8:27:00 AM

Hi,

I need to add a CDATA element to an XML document.

The libxml API documentation says that I can use Node.new_cdata, but
this doesn't work here for some reason (Ubuntu with libxml-ruby
0.3.4-4): "undefined method 'new_cdata' for XML::Node::Class"

How can I create a CDATA element using libxml?

I was looking at REXML but didn't like the API at all and would very
much prefer using libxml.

Regards,
Thomas

3 Answers

Ross Bamford

12/13/2006 10:24:00 AM

0

On Wed, 13 Dec 2006 08:27:19 -0000, Thomas Mueller =

<thomasmueller76@googlemail.com> wrote:

> Hi,
>
> I need to add a CDATA element to an XML document.
>
> The libxml API documentation says that I can use Node.new_cdata, but
> this doesn't work here for some reason (Ubuntu with libxml-ruby
> 0.3.4-4): "undefined method 'new_cdata' for XML::Node::Class"
>

Wow, that's a fairly old version you have there :)

> How can I create a CDATA element using libxml?
>
> I was looking at REXML but didn't like the API at all and would very
> much prefer using libxml.
>

You just need to upgrade your libxml-ruby installation (or pester ubuntu=
=

to upgrade theirs). new_cdata was added in the 0.3.8 branch:

require_gem 'libxml-ruby', '>=3D 0.3.8'
# =3D> true

require 'xml/libxml'
# =3D> true

XML::Node.new_cdata('cdata foo')
# =3D> <![CDATA[cdata foo]]>


-- =

Ross Bamford - rosco@roscopeco.remove.co.uk

aesthete8

3/26/2012 8:51:00 AM

0

On Mar 25, 8:58 pm, mandryka >
> Why did you mention Tilson Thomas's La Mer, aesthete8? I've never
> heard it but I can easily access it on spotify.

According to CLASSICAL MUSIC: THE LISTENER'S COMPANION:

- Tilson Thomas and the Philharmonia open I with a very effective
sunrise and are very exciting, if not as thrilling as Munch. They end
memorably with cymbals that are literally allowed to drown out the
rest of the orchestra--and you can just see the waves crashing agains
the rocks...

http://books.google.com/books?id=ayT5T59ckzIC&pg=PA253&lpg=PA253&dq=%22if+not+as+thrilling+as+Munch%22&source=bl&ots=VMLGayw3or&sig=8YjzEps8Gup_RvTeaxvVwU4gJHY&hl=en&sa=X&ei=7ixwT63DO4fhiAK1u8CUBQ&ved=0CCIQ6AEwAA#v=onepage&q=%22if%20not%20as%20thrilling%20as%20Munch%22&a...

herman

3/26/2012 6:50:00 PM

0

On 26 mar, 10:50, aesthete8 <art...@gmail.com> wrote:
> On Mar 25, 8:58 pm, mandryka >
>
> > Why did you mention Tilson Thomas's La Mer, aesthete8? I've never
> > heard it but I can easily access it on spotify.
>
> According to CLASSICAL MUSIC: THE LISTENER'S COMPANION:
>
> - Tilson Thomas and the Philharmonia open I with a very effective
> sunrise and are very exciting, if not as thrilling as Munch.  They end
> memorably with cymbals that are literally allowed to drown out the
> rest of the orchestra--and you can just see the waves crashing agains
> the rocks...
>
> http://books.google.com/books?id=ayT5T59ckzIC&pg=PA253&lpg=PA25......

So that's _your_ thought?