Re: How to parsing a XML file which having CDATA tag
"Xinzhi Zhao" <[email protected]> Wed, 17 Dec 2003 10:49:28 +0000
| Newsgroups | gmane.comp.web.zope.parsed-xml |
|---|---|
| Message-ID | <[email protected]> |
I'm shy to my last description, the example is not a whole, however, it should include CDATA section, and portions of the text enclosed in CDATA marked sections is my wish to get, which just likes "Please help me." I'll show a entire XML file to you, it is well-formed. Please tell me how can I get the string "Please Help me". Thanks. -------------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <!-- A problem to get value in CDATA block --> <problem> <title>My problem</title> <content>How can I get the string shown in the CDATA marked sections?</content> <![CDATA[ "Please help me." ]]> </problem> -------------------------------------------------------------------------------------------------- ==========Last Message===================== >From: "Fred L. Drake, Jr." <[email protected]> >To: "Xinzhi Zhao" <[email protected]>,[email protected] >Subject: Re: [Parsed-XML-Dev] How to parsing a XML file which having CDATA >tag >Date: Tue, 16 Dec 2003 11:03:11 -0500 > >On Tue, 16 Dec 2003 15:19:03 +0000 > "Xinzhi Zhao" <[email protected]> wrote: > > How to parsing a XML file which having CDATA tag? > > please tell me the way to get the value in the tags. > > > > My example XML file is shown as below, > > ------------------------------------------------------ > > <?xml version="1.0" standalone="yes"?> > > <![CDATA[Please help me!]]> > > ----------------------------------------------------- > >This is not a well-formed XML document at all. "CDATA" is >not a tag at all. > >You probably want something like this: > ><?xml version="1.0" standalone="yes"?> ><doc>Please help me!</doc> > > > -Fred > >-- >Fred L. Drake, Jr. <fred at zope.com> >PythonLabs at Zope Corporation _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail