Marc, himself, his blogs, and you reading them.

November 28, 2003
Radio UserLand Template
Hm, looks like the custom template I used on the previous blog (pls vote if you liked it so much that you would want me to get it over here as well) is the biggest reason why this import/export needs to be tweaked to personal needs anyway.

This seems to be my pattern to dig for (hm, SAX processing exercise!)

<div class="date">
  <a href="{RADIO_ROOT_URL}/{year}/{month}/{day}.html">
    <img ... /></a>&nbsp;{date in ddd dd mmmm yyyy}
</div>

<div class="newsItems">
  <a name="{entry_id}"></a>

  <table width="100%" cellpadding="1">
    <tr>
      <td valign="top">
        <br><b>{Title}</b>
{Body}
        <font class="small" size="-1" color="gray">
          {time in hh:mm:ss am/pm}&nbsp;&nbsp;
          <a href="{RADIO_ROOT_URL}/{year}/{month}/{day}.html#{entry_id}">
            <img .../></a>&nbsp;&nbsp;
        </font>
      </td>
      <td valign="top" align="right" nowrap></td>
    </tr>

  </table>
</div>

Observations:
  1. The fun doesn't start until there is a //div[@class=newsItems]
  2. In this diff one entry is a group of ./a and ./table
  3. I could use the ./a/@name for some silly check, and to clear some buffers for the new entry.
  4. The title is over at ./table/tr/td/b[1]
  5. After that there is the Body up until some font[@class=small and @size="-1" and color="gray"
  6. Which is holding the parts of the date inside its nested content and a/@href
  7. This looks like Date stuff could be done with just some simple string manipulation (rather then convert to actual Date object)
  8. I will need to hold onto the accumulated body untill the date is available since movable wants them in the different order. (Beware of the passed-event-syndrome in SAX :-))
  9. I have to dig up some sample with an image to check up on the relative URI's there
# Posted by mpo at 10:47 AM | TrackBack
Comments
Post a comment









Remember personal info?





Please enter the security code you see here