Problem with Z tag (1 Viewer)

Khurram

Portal Pro
May 12, 2008
211
5
Home Country
Pakistan Pakistan
I have the following grabber
Code:
<?xml version="1.0" encoding="utf-8"?>
<Grabber>
	<Info availableDays="7" timezone="South Africa Standard Time" version="2.0"/>
	<Channels>
		<Channel id="mneteast@mnetafrica.com" siteId="229"/>
		<Channel id="mm1@mnet.co.za" siteId="225"/>
	</Channels>
	<Listing type="Html">
		<Site url="http://beta.mnetafrica.com/Schedule.aspx?channel=[ID]&amp;days=1" post="" external="false" encoding=""/>
		<Html>
			<Template name="default" start="&lt;table cellspacing=&quot;0&quot; border=&quot;0&quot; id=&quot;ctl00_body_ctl00_dg1&quot; style=&quot;border-collapse:collapse;&quot;&gt;" end="&lt;/table&gt;">
				<SectionTemplate tags="TS">
					<TemplateText>
&lt;td class=&quot;txt_time&quot; style=&quot;width:60px;&quot;&gt;&lt;#START&gt;&lt;/td&gt;&lt;td class=&quot;txt_descrip&quot; valign=&quot;top&quot; style=&quot;height:40px;width:690px;&quot;&gt;&lt;span class=txt_showTitle&gt;&lt;#TITLE&gt;&lt;/span&gt;&lt;br/&gt;&lt;z(&gt;'S&lt;#SEASON&gt;/E&lt;#EPISODE&gt; - &lt;#SUBTITLE&gt;'. &lt;/z)?&gt;&lt;#DESCRIPTION&gt;&lt;/td&gt;&lt;td title=&quot;Age Restriction&quot; class=&quot;link_rating&quot; style=&quot;width:43px;&quot;&gt;&lt;a href=# onclick=OpenAgeRestriction(1);return false; class=link_rating&gt; PG/13                                            &lt;/a&gt;&lt;/td&gt;
          </TemplateText>
				</SectionTemplate>
			</Template>
		</Html>
	</Listing>
</Grabber>
The Z tag in the template does not work. The html for the description is sometimes preceeded by season/episode/subtitle information. I thought I could capture this information using a Z tag as this information is always in the same format and enclosed in single quotes, for example:

'S1/E1 - Part I'. description starts from here

But WebEPG is always including the season/episode/subtitle information in the description. What am I doing wrong?
 

Khurram

Portal Pro
May 12, 2008
211
5
Home Country
Pakistan Pakistan
I am generally confused about the Z tag. From what I understand, it is supposed to match 0 or 1 occurrances of the enclosing html. So for example, if the templates contains the following:
Code:
<z(><dt>Starring</dt>
	<dd>name 1, name 2</dd></z)?>
				 
<z(><dt>Director</dt>
	<dd>some name</dd></z)?>
	 
       <dt>Description</dt>
	<dd><#Description></dd>
Then the code will match the following:

1) One dt/dd pair, "Description" in the dt tag.
2) Two dt/dd pairs, either "Starring" or "Director" in first dt tag and "Description" in second dt tag.
3) Three dt/dd pairs, "Starring" in first dt tag, "Director" in second dt tag and "Description" in third dt tag.

Is this reasoning correct?
 

James

Retired Team Member
  • Premium Supporter
  • May 6, 2005
    1,385
    67
    Switzerland
    Hi Khurram,

    Generally that would but the idea. However, the Z tag builds a Regular Expression, so it could depend a little on what comes before and after. See the concept of greediness (Regex Tutorial - The Question Mark Makes the Preceding Token Optional). Also WebEPG does not make a difference between these two tags <dt> and <dd>.


    if <dt> or <dd> = d
    and </dt> or </dd> = D

    Then the regex looks like "(dDdD)?(dDdD)?dDdD" and this is going to be matched to a long string from the HTML source using the same system.

    /James
     

    Khurram

    Portal Pro
    May 12, 2008
    211
    5
    Home Country
    Pakistan Pakistan
    The Regex Tutorial - The Question Mark Makes the Preceding Token Optional site is very useful. If I am not mistaken, the site's link is in the wiki also where you talk about the z-tag.

    Lets say I have the following 2 pages:
    HBO South Asia | Hollow Man 2. The HTML containing the information is
    Code:
    </ul>
    </div>
    <dl class="info">
        <dt>Starring</dt>
        <dd>Christian Slater, Peter Facinelli, Laura Regan</dd>
        <dt>Genre</dt>
        <dd>Action, Adventure</dd>
        <dt>Duration</dt>
        <dd>1 hr 22 min</dd>
    </dl>
    </div>
    <div class="synopsis">
        <p>some description.</p>
    </div>
    <div class="legal">
    and
    HBO South Asia | Single White Female. The HTML containing the information is
    Code:
    </ul>
    </div>
    <dl class="info">
        <dt>Starring</dt>
        <dd>Jennifer Jason Leigh, Bridget Fonda, Steven Weber</dd>
        <dt>Directed</dt>
        <dd>Barbet Schroeder</dd>
        <dt>Genre</dt>
        <dd>Suspense, Thriller</dd>
        <dt>Duration</dt>
        <dd>1 hr 35 min</dd>
    </dl>
    </div>
    <div class="synopsis">
        <p>some description</p>
    </div>
    <div class="legal">
    My grabber template is
    Code:
    <Template name="Details" start="Add to MyHBO</a></li>" end="<div class="legal">">
    	<SectionTemplate tags="UDP">
    		<TemplateText>
    			</ul>
    				</div>
    				<dl class="info">
    					<z(><dt><*MATCH></dt>
    						<dd><*VALUE></dd></z)?>
    					<z(><dt><*MATCH></dt>
    						<dd><*VALUE></dd></z)?>
    					<dt><*MATCH></dt>
    					<dd><*VALUE></dd>
    					<dt><*MATCH></dt>
    					<dd><*VALUE></dd>
    				</dl>
    			</div>
    			<div class="<*MATCH>">
    				<p><*VALUE></p>
    			</div>
    		</TemplateText>
    		<MatchList>
    			<Match field="#ACTORS" match="Starring" />
    			<Match field="#DIRECTOR" match="Directed" />
    			<Match field="#GENRE" match="Genre" />
    			<Match field="#DURATION" match="Duration" />
    			<Match field="#DESCRIPTION" match="synopsis" />
    		</MatchList>
    	</SectionTemplate>
    </Template>
    As far as I can tell, the page tagMap has 1 match with the template tagMap, but I get wierd behavior with the #DESCRIPTION token. If there is a match with 1 of the z-tags, #DESCRIPTION is ok. But if there are no matches with either of the z-tags, #DESCRIPTION is blank. I have tried debugging it but got the sqlite.dll error again even though sqlite.dll is in the proper folder (...mediaportal\WebEPG\WebEPG-xmltv\bin\Debug).
     

    Users who are viewing this thread

    Top Bottom