[XML-SIG] xbel.

Dave Pawson dpawson@nildram.co.uk
Wed, 02 Oct 2002 20:14:35 +0100


I'm in a m$ environment.

After using html tidy, 
  -config file is:
write-back:yes
indent: auto
indent-spaces: 3
wrap: 72
markup: yes
clean:yes
drop-empty-paras:yes
enclose-text: yes
output-xml: yes
input-xml: no
add-xml-pi: yes
add-xml-decl:yes
show-warnings: yes
numeric-entities: yes
quote-marks: yes
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
char-encoding: latin1
show-warnings: no
err-file: errs

an ie bookmark file produces valid xml to xbel
with the stylesheet below.
 I guess you have a stylesheet, xbel to html?



<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

  <xsl:strip-space elements="*"/>
  <xsl:output method="xml"
    indent="yes"
doctype-public=
    " +//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
    doctype-system=
    "/sgml/mine/xbel-1.0.dtd"/>

  <xsl:template match="/">
        <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="html">
    <xbel>
      <title><xsl:value-of select="head/title"/></title>
      <xsl:apply-templates/>
    </xbel>
  </xsl:template>
  <xsl:template match="head"/>

  <xsl:template match="body|dl">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="h1|h3"/>

  <xsl:template match="dd">
    <folder>
      <title><xsl:value-of select="normalize-space(h3)"/></title>
    <xsl:apply-templates/>
  </folder>
  </xsl:template>


  <xsl:template match="dt">
    <bookmark href="{a/@href}">
      <title><xsl:value-of select="normalize-space(.)"/></title>

</bookmark>
  </xsl:template>









  <xsl:template match="*">
    <p style="color:red">    <xsl:value-of select="name(..)"/>/ <xsl:value-of select="name()"/> </p>
  </xsl:template>
</xsl:stylesheet>

HTH DaveP