Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parsing CDATA...
#1
Well, for some reason the text that I want to parse from the xml output of a program is put in a CDATA tag... :evil:

So how do I parse it:
Function Function6
Code:
Copy      Help
out
str s=
;<?xml version="1.0" encoding="ISO-8859-1"?>
;<nexgen_audio_export>
;
;<audio ID="id_2605880266_30030179">
;<type>Spot</type>
;<status>Playing</status>
;<title><![CDATA[Ekana Nursery & Landscaping/Fall Colors]]></title>
;<length>00:00:30.950</length>
;<played_time>14:58:50</played_time>
;<number>50104</number>
;<cut>6</cut>
;</audio>
;
;</nexgen_audio_export>

IXml x=CreateXml
x.FromString(s)

IXmlNode eType=x.Path("nexgen_audio_export/audio/type")
IXmlNode eTitle=x.Path("nexgen_audio_export/audio/title")
IXmlNode eLength=x.Path("nexgen_audio_export/audio/length")
IXmlNode eCart=x.Path("nexgen_audio_export/audio/number")
IXmlNode eCut=x.Path("nexgen_audio_export/audio/cut")

str Type=eType.Value;err
str Title=eTitle.Value;err
str Length=eLength.Value;err
str Cart=eCart.Value;err
str Cut=eCut.Value;err
,
out "%s - %s - %s - %s - %s" Type Title Length Cart Cut
#2
IXmlNode eTitle=x.Path("nexgen_audio_export/audio/title/![")

Look in qm help, in the table, Name column.
#3
Got it...used XmlOut and got the tag.
IXmlNode eTitle=x.Path("nexgen_audio_export/audio/title/![")
#4
Same time...JINX!


Forum Jump:


Users browsing this thread: 1 Guest(s)