<Processing Instruction><?xml</Processing Instruction><Normal Text> version="1.0" encoding="iso-8859-15"</Normal Text><Processing Instruction>?></Processing Instruction><br/>
<dsNormal></dsNormal><br/>
<Comment><!--</Comment><br/>
<Comment>	This file is freely distributable, created by Wilbert Berendsen (wbsoft@xs4all.nl)</Comment><br/>
<dsNormal></dsNormal><br/>
<Comment>	This is just a simple XSLT file that converts some HTML pages to a XBEL bookmarklist.</Comment><br/>
<Comment>	It is included here to test the new XSLT highlighting by Peter Lammich.</Comment><br/>
<Comment>	</Comment><br/>
<Comment>	</Comment><Alert>TODO</Alert><Comment>: add better test file.</Comment><br/>
<Comment>--></Comment><br/>
<dsNormal></dsNormal><br/>
<Tag><</Tag><XSLT Tag>xsl:stylesheet</XSLT Tag><Attribute> xmlns:xsl=</Attribute><Attribute Value>"http://www.w3.org/1999/XSL/Transform"</Attribute Value><Attribute> version=</Attribute><Attribute Value>"1.0"</Attribute Value><br/>
<Attribute>xmlns:h=</Attribute><Attribute Value>"http://www.w3.org/1999/xhtml"</Attribute Value><Tag>></Tag><br/>
<Tag><</Tag><XSLT Tag>xsl:output</XSLT Tag><Attribute> method=</Attribute><Attribute Value>"xml"</Attribute Value><Attribute> encoding=</Attribute><Attribute Value>"iso-8859-15"</Attribute Value><Attribute> indent=</Attribute><Attribute Value>"yes"</Attribute Value><br/>
<Attribute> doctype-public=</Attribute><Attribute Value>"+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"</Attribute Value><br/>
<Attribute> doctype-system=</Attribute><Attribute Value>"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd"</Attribute Value><br/>
<Tag>/></Tag><br/>
<dsNormal></dsNormal><br/>
<Comment><!-- main --></Comment><br/>
<Tag><</Tag><XSLT Tag>xsl:template</XSLT Tag><Attribute> match=</Attribute><XPath>"/"</XPath><Tag>></Tag><br/>
<Tag><xbel><folder><title></Tag><Normal Text>Linux at Home Links</Normal Text><Tag></title></Tag><br/>
<Tag><</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Attribute> select=</Attribute><XPath>"//*[</XPath><XPath Attribute>@id</XPath Attribute><XPath>=</XPath><XPath String>'maincontents'</XPath String><XPath>]//h:li"</XPath><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:variable</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"f"</Attribute Value><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>document</XPath/ XSLT Function><XPath>(h:a/</XPath><XPath Attribute>@href</XPath Attribute><XPath>)/h:html"</XPath><Tag>/></Tag><br/>
<Normal Text>  </Normal Text><Tag><folder></Tag><br/>
<Normal Text>  </Normal Text><Tag><title><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"h:a/h:strong"</XPath><Tag>/></title></Tag><br/>
<Normal Text>  </Normal Text><Tag><desc><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>normalize-space</XPath/ XSLT Function><XPath>(h:a/</XPath><XPath/ XSLT Function>text</XPath/ XSLT Function><XPath>())"</XPath><Tag>/></desc></Tag><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><Variable>$f</Variable><XPath>//h:div[</XPath><XPath Attribute>@id</XPath Attribute><XPath>=</XPath><XPath String>'maincontents'</XPath String><XPath>]"</XPath><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:call-template</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"getbookmarks"</Attribute Value><Tag>/></Tag><br/>
<Normal Text>  </Normal Text><Tag></</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Tag>></Tag><br/>
<Normal Text>  </Normal Text><br/>
<Normal Text>  </Normal Text><Tag></folder></Tag><br/>
<Tag></</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Tag>></Tag><br/>
<Tag></folder></xbel></Tag><br/>
<Tag></</Tag><XSLT Tag>xsl:template</XSLT Tag><Tag>></Tag><br/>
<Comment><!-- end of main --></Comment><br/>
<dsNormal></dsNormal><br/>
<Comment><!-- get bookmarks from a page --></Comment><br/>
<Tag><</Tag><XSLT Tag>xsl:template</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"getbookmarks"</Attribute Value><Tag>></Tag><br/>
<dsNormal></dsNormal><br/>
<Tag><</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Comment><!-- harvest links from p or li elements --></Comment><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:when</XSLT Tag><Attribute> test=</Attribute><XPath>"</XPath><XPath Axis>self::</XPath Axis><XPath>h:li or </XPath><XPath Axis>self::</XPath Axis><XPath>h:p"</XPath><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag><</Tag><XSLT Tag>xsl:variable</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"t"</Attribute Value><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>normalize-space</XPath/ XSLT Function><XPath>()"</XPath><Tag>/></Tag><br/>
<Normal Text>    </Normal Text><Tag><</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Attribute> select=</Attribute><XPath>".//h:a[1]"</XPath><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag><</Tag><XSLT Tag>xsl:call-template</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"bookmark"</Attribute Value><Tag>></Tag><br/>
<Normal Text>        </Normal Text><Tag><</Tag><XSLT Tag>xsl:with-param</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"desc"</Attribute Value><Attribute> select=</Attribute><XPath>"</XPath><Variable>$t</Variable><XPath>"</XPath><Tag>/></Tag><br/>
<Normal Text>      </Normal Text><Tag></</Tag><XSLT Tag>xsl:call-template</XSLT Tag><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag></</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag><</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Attribute> select=</Attribute><XPath>".//h:a[</XPath><XPath/ XSLT Function>position</XPath/ XSLT Function><XPath>()!=1]"</XPath><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag><</Tag><XSLT Tag>xsl:call-template</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"bookmark"</Attribute Value><Tag>/></Tag><br/>
<Normal Text>    </Normal Text><Tag></</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Tag></</Tag><XSLT Tag>xsl:when</XSLT Tag><Tag>></Tag><br/>
<dsNormal></dsNormal><br/>
<dsNormal></dsNormal><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag><</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Attribute> select=</Attribute><XPath>"*"</XPath><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag><</Tag><XSLT Tag>xsl:call-template</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"getbookmarks"</Attribute Value><Tag>/></Tag><br/>
<Normal Text>    </Normal Text><Tag></</Tag><XSLT Tag>xsl:for-each</XSLT Tag><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Tag></</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<dsNormal></dsNormal><br/>
<Tag></</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<dsNormal></dsNormal><br/>
<Tag></</Tag><XSLT Tag>xsl:template</XSLT Tag><Tag>></Tag><br/>
<dsNormal></dsNormal><br/>
<dsNormal></dsNormal><br/>
<Tag><</Tag><XSLT Tag>xsl:template</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"bookmark"</Attribute Value><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:param</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"href"</Attribute Value><Attribute> select=</Attribute><XPath>"</XPath><XPath Attribute>@href</XPath Attribute><XPath>"</XPath><Tag>/></Tag><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:param</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"desc"</Attribute Value><Attribute> select=</Attribute><XPath>"</XPath><XPath String>''</XPath String><XPath>"</XPath><Tag>/></Tag><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:param</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"title"</Attribute Value><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>normalize-space</XPath/ XSLT Function><XPath>()"</XPath><Tag>/></Tag><br/>
<dsNormal></dsNormal><br/>
<Normal Text>  </Normal Text><Tag><</Tag><XSLT Tag>xsl:variable</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"realdesc"</Attribute Value><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag><</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag><</Tag><XSLT Tag>xsl:when</XSLT Tag><Attribute> test=</Attribute><XPath>"</XPath><XPath/ XSLT Function>starts-with</XPath/ XSLT Function><XPath>(</XPath><Variable>$desc</Variable><XPath>,</XPath><Variable>$title</Variable><XPath>)"</XPath><Tag>></Tag><br/>
<Normal Text>        </Normal Text><Tag><</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<Normal Text>          </Normal Text><Tag><</Tag><XSLT Tag>xsl:when</XSLT Tag><Attribute> test=</Attribute><XPath>"</XPath><XPath/ XSLT Function>starts-with</XPath/ XSLT Function><XPath>(</XPath><XPath/ XSLT Function>translate</XPath/ XSLT Function><XPath>(</XPath><XPath/ XSLT Function>substring-after</XPath/ XSLT Function><XPath>(</XPath><Variable>$desc</Variable><XPath>,</XPath><Variable>$title</Variable><XPath>),</XPath><XPath String>',.;'</XPath String><XPath>,</XPath><XPath String>'...'</XPath String><XPath>),</XPath><XPath String>'.'</XPath String><XPath>)"</XPath><Tag>></Tag><br/>
<Normal Text>            </Normal Text><Tag><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>substring</XPath/ XSLT Function><XPath>(</XPath><Variable>$desc</Variable><XPath>,</XPath><XPath/ XSLT Function>string-length</XPath/ XSLT Function><XPath>(</XPath><Variable>$title</Variable><XPath>) + 2)"</XPath><Tag>/></Tag><br/>
<Normal Text>          </Normal Text><Tag></</Tag><XSLT Tag>xsl:when</XSLT Tag><Tag>></Tag><br/>
<Normal Text>          </Normal Text><Tag><</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<Normal Text>            </Normal Text><Tag><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>substring-after</XPath/ XSLT Function><XPath>(</XPath><Variable>$desc</Variable><XPath>,</XPath><Variable>$title</Variable><XPath>)"</XPath><Tag>/></Tag><br/>
<Normal Text>          </Normal Text><Tag></</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<Normal Text>        </Normal Text><Tag></</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag></</Tag><XSLT Tag>xsl:when</XSLT Tag><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag><</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<Normal Text>        </Normal Text><Tag><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><Variable>$desc</Variable><XPath>"</XPath><Tag>/></Tag><br/>
<Normal Text>      </Normal Text><Tag></</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag></</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Tag></</Tag><XSLT Tag>xsl:variable</XSLT Tag><Tag>></Tag><br/>
<Normal Text>  </Normal Text><br/>
<Normal Text>  </Normal Text><Tag><bookmark></Tag><br/>
<Normal Text>    </Normal Text><Tag><</Tag><XSLT Tag>xsl:attribute</XSLT Tag><Attribute> name=</Attribute><Attribute Value>"href"</Attribute Value><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag><</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<Normal Text>        </Normal Text><Tag><</Tag><XSLT Tag>xsl:when</XSLT Tag><Attribute> test=</Attribute><XPath>"</XPath><XPath/ XSLT Function>starts-with</XPath/ XSLT Function><XPath>(</XPath><Variable>$href</Variable><XPath>,</XPath><XPath String>'http://'</XPath String><XPath>) or </XPath><XPath/ XSLT Function>starts-with</XPath/ XSLT Function><XPath>(</XPath><Variable>$href</Variable><XPath>,</XPath><XPath String>'ftp://'</XPath String><XPath>) or </XPath><XPath/ XSLT Function>starts-with</XPath/ XSLT Function><XPath>(</XPath><Variable>$href</Variable><XPath>,</XPath><XPath String>'mailto:'</XPath String><XPath>)"</XPath><Tag>></Tag><br/>
<Normal Text>          </Normal Text><Tag><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><Variable>$href</Variable><XPath>"</XPath><Tag>/></Tag><br/>
<Normal Text>        </Normal Text><Tag></</Tag><XSLT Tag>xsl:when</XSLT Tag><Tag>></Tag><br/>
<Normal Text>        </Normal Text><Tag><</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<Normal Text>          </Normal Text><Tag><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>concat</XPath/ XSLT Function><XPath>(</XPath><XPath String>'http://www.xs4all.nl/~wbsoft/linux/links/'</XPath String><XPath>,</XPath><Variable>$href</Variable><XPath>)"</XPath><Tag>/></Tag><br/>
<Normal Text>        </Normal Text><Tag></</Tag><XSLT Tag>xsl:otherwise</XSLT Tag><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag></</Tag><XSLT Tag>xsl:choose</XSLT Tag><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag></</Tag><XSLT Tag>xsl:attribute</XSLT Tag><Tag>></Tag><br/>
<Normal Text>    </Normal Text><Tag><title><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>normalize-space</XPath/ XSLT Function><XPath>(</XPath><Variable>$title</Variable><XPath>)"</XPath><Tag>/></title></Tag><br/>
<Normal Text>    </Normal Text><Tag><</Tag><XSLT Tag>xsl:if</XSLT Tag><Attribute> test=</Attribute><XPath>"</XPath><XPath/ XSLT Function>normalize-space</XPath/ XSLT Function><XPath>(</XPath><Variable>$realdesc</Variable><XPath>) != </XPath><XPath String>''</XPath String><XPath>"</XPath><Tag>></Tag><br/>
<Normal Text>      </Normal Text><Tag><desc><</Tag><XSLT Tag>xsl:value-of</XSLT Tag><Attribute> select=</Attribute><XPath>"</XPath><XPath/ XSLT Function>normalize-space</XPath/ XSLT Function><XPath>(</XPath><Variable>$realdesc</Variable><XPath>)"</XPath><Tag>/></desc></Tag><br/>
<Normal Text>    </Normal Text><Tag></</Tag><XSLT Tag>xsl:if</XSLT Tag><Tag>></Tag><br/>
<Normal Text>  </Normal Text><Tag></bookmark></Tag><br/>
<Tag></</Tag><XSLT Tag>xsl:template</XSLT Tag><Tag>></Tag><br/>
<dsNormal></dsNormal><br/>
<dsNormal></dsNormal><br/>
<dsNormal></dsNormal><br/>
<Tag></</Tag><XSLT Tag>xsl:stylesheet</XSLT Tag><Tag>></Tag><br/>
