Strip CDATA with regex
- From: "Balaras" <not@home>
- Date: 07 Jun 2005 13:39:01 GMT
Hi,
Can sombody here please help me a bit with a regular expression.
I have a xml file where I need to strip the CDATA sections of any
contained data.
Eg.
<xml>
<tag><[CDATA[ some data ]]></tag>
<tag><[CDATA[ some more data ]]></tag>
</xml>
Should end up like this:
<xml>
<tag><[CDATA[]]></tag>
<tag><[CDATA[]]></tag>
</xml>
Now, I have the start and end of the range
(\[CDATA\[)
and
(\]\]>)
But I cannot figure out how I match any character that is not like the
end of the range.
That is > is ok, ] is ok
but ]]> is not ok.
Thanks in advance,
Balaras
.
Relevant Pages
- Re: TAPI 3.0 call attached data
... The format of the Call Attached Data is XML. ... XML file with CallAttchedData represents one or multiple data lists ... Root element is CallAttachedData. ... version CDATA #FIXED "1.0" ... (microsoft.public.win32.programmer.tapi) - Re: Determine if xml is malformed
... I'm really looking at how to easily check if the xml file is ... I have an xml file that looks like below. ... <!ATTLIST LIB version CDATA #REQUIRED> ... <!ATTLIST TEST Type CDATA #REQUIRED> ... (microsoft.public.dotnet.languages.vb) - Re: simplexml and CDATA
... element when parsing an xml file or string with simplexml. ... CDATA and what simplexml does. ... In CDATA sections, you can include e.g. ... (comp.lang.php) - Re: html in xml
... I need to contain some html tag, which is the body of an html email, in a ... I would use XML simple to retrieve the content of the xml file. ... If xml simple uses an xml parser, I would just put it into a CDATA element. ... (comp.lang.perl.misc) - Re: simplexml and CDATA
... element when parsing an xml file or string with simplexml. ... CDATA and what simplexml does. ... In CDATA sections, you can include e.g. ... (comp.lang.php) |
|