2011/9/19 Hubert Toullec <hubert.toullec@...>
> **
> Seems very interesting. I tried it, but Firefox (6.02 on Ubuntu 11.04)
> repeatedly ask to load the xml file in new tab without displaying anything
> (Javascript is enabled) !
> What can be wrong ?
>
Try the tutorial here: http://www.w3schools.com/xsl/ it is really short.
There is an example xml file and example xsl. If that works, then the
example I gave should work. If that does not work, then something is wrong
with how firefox is set up on your box.
Benny
> PS. Does this trick preserve styles ?
> Thank you
>
> Le lundi 19 septembre 2011 à 14:41 +0200, Benny Malengier a écrit :
>
> I see many answers, but the most elegant is missing: xslt.
>
> 1/ Step one is the same, you obtain the unzipped xml file inside of the
> .gramps xml export. Let's assume it is called zkab.unzip.gramps
>
> 2/ Now you use the power of xml to use xslt to automatically transform the
> xml file in an xhtml file that every browser can show in a very nice way!
> For this, you create a file in the same directory as zkab.unzip.gramps,
> called example_note.xsl
>
> The content of this file is:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:template match="/">
> <html>
> <body>
> <h2>All Notes</h2>
> <table border="1">
> <tr bgcolor="#9acd32">
> <th>ID</th>
> <th>Text</th>
> </tr>
> <xsl:for-each select="database/notes/note">
> <tr>
> <td><xsl:value-of select="@id"/></td>
> <td><xsl:value-of select="text"/></td>
> </tr>
> </xsl:for-each>
> </table>
> </body>
> </html>
> </xsl:template>
>
> </xsl:stylesheet>
>
> 3/ You now must indicate in the zkab.unzip.gramps file that when opened in
> firefox/chrome/ie8 it should use this xsl file, so you open the
> zkab.unzip.gramps file with your editor (wordpad, kate, gedit, ...) and
> replace the first line with the following two lines
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="example_note.xsl"?>
>
>
> 4/ In eg firefox, go to open file, and select to open your .gramps file.
> Voila, a list of all your notes with column of ID in front, which you can
> print as you do webpages. (Note: In case you block javascript, you must
> allow the file:// protocol to use javescript).
>
> You can use this trick on _all_ your data like this, making the xml format
> export very useful apart from backup reasons.
>
> Perhaps somebody should add this example to the wiki documentation ...
>
> Benny
>
> 2011/9/19 zkab <raivo.kask@...>
>
> Thanks - now I am on the right track with printing the notes ...
>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> Learn about the latest advances in developing for the
> BlackBerry® mobile platform with sessions, labs & more.
> See new tools and technologies. Register for BlackBerry® DevCon today!
> http://p.sf.net/sfu/rim-devcon-copy1
> _______________________________________________ Gramps-users mailing list Gramps-users@... https://lists.sourceforge.net/lists/listinfo/gramps-users
>
>
>
|