You are here

Import non standart xml

3 posts / 0 new
Last post
martos
Offline
Donator
Joined: 10 years
Last seen: 3 months
Import non standart xml

Hi guys,

I have some non-standart xmltv that I want to import to my guide.xml. The format is:

 

<?xml version="1.0" encoding="windows-1251"?>
<?xml-stylesheet type="text/xsl" href="http://d57e32cb.static.ziggozakelijk.nl/epg.xsl"?>
<channel name="some channel" lang="bul" encoding="cyrillic">
  <event start="06/10/2015 01:40:00" duration="01:50:00">
    <description>
      <name>name</name>
      <text>full name</text>
    </description>
    <longdescription>
      <text>bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla </text>
    </longdescription>
  </event>
  <event start="06/10/2015 03:30:00" duration="02:00:00">
    <description>
      <name>name</name>
      <text>full name</text>
    </description>
    <longdescription>
            <text>bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla </text>

    </longdescription>
  </event>
</channel>

Is there an easy way to do this? Or I have to write some bash or perl script to do this for me?

francis
Offline
francis's picture
Has donated long time agoWG++ Team member
Joined: 11 years
Last seen: 2 weeks
Is the support helpful?
support us

Well,

Because it is non-standard xmltv, it will not be recognized. It's the same thing as feeding with an excel sheet. We only understand the language we know.
And the file you refer to, is not an xmltv file, but just a xml file. And xml files have no fixed structure!.

 

The simplest thing you could do (if the xml format is fixed) is write a siteini that takes this file and grabs all the info in int. So that would convert the xml you have into a correct xmltv format.

Just use

url_index {url|file:\\c:\path_to_the_xml_file}

in the siteini to take the file instead of a normal url.

And for example, the showsplit would be:

index_showsplit.scrub         {regex||(<event .*?</event>)||}
martos
Offline
Donator
Joined: 10 years
Last seen: 3 months

Thank you, Francis! But my knowledge in WebGrab Plus is far from enough and I can not complete this siteini. I will appreciate if you find time to help.

Thank you in advance!

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl