Print Notes

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Print Notes

zkab
Is there a way to print all notes in the database at once ?
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Robert Chéramy
Am 17.09.2011 15:29, schrieb zkab:
> Is there a way to print all notes in the database at once ?

This is not pretty, but:
- export your database to xml.
- gunzip the database (you may rename it to <something>.gz before)
- Open with a text editor, remove everything before and after the notes
section.
- Print (I said it is not pretty)

Robert


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

robhealey1
Greetings:

It would NOT be that difficult to write a tool or report that simply prints all Notes only...

Something like:

for nhandle in db.get_note_handles():
    note = db.get_note_from_handle(nhandle)
    if note:
        print(note)

This would show it up on the terminal screen.  I do not know how to send it to the printer yet...

You could also open a new file, send all notes to that file, open that new file  in a word processor, and print it...

Sincerely yours,
Rob G. Healey


2011/9/17 Robert Chéramy <[hidden email]>
Am 17.09.2011 15:29, schrieb zkab:
> Is there a way to print all notes in the database at once ?

This is not pretty, but:
- export your database to xml.
- gunzip the database (you may rename it to <something>.gz before)
- Open with a text editor, remove everything before and after the notes
section.
- Print (I said it is not pretty)

Robert


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users



--
Sincerely yours,
Rob G. Healey

"Always surround yourself with people that inspire you to
greatness!"


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

zkab
In reply to this post by Robert Chéramy
I did following:

- export the database to xml ... the exported file was 'data.gramps'
- gunzip the database ... the result was 'data.gramps.gz'
- open with a text editor ... unreadable characters were displayed ...

Where did I miss ?
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

jerome
In reply to this post by zkab
Hi,


I made something like that (with format/markup support)!

It was for testing data into Notes...
http://www.gramps-project.org/bugs/view.php?id=4856#c19034

but may be also used for production. :)

I suppose we need to update to version number (gramps_target_version = 3.3 on NoteReport.gpr.py) for running it into last stable release.

Feel free to improve it. ;)


Regards,
Jérôme


--- En date de : Dim 18.9.11, Rob Healey <[hidden email]> a écrit :

De: Rob Healey <[hidden email]>
Objet: Re: [Gramps-users] Print Notes
À: "Gramps Users List" <[hidden email]>
Date: Dimanche 18 septembre 2011, 3h56

Greetings:
It would NOT be that difficult to write a tool or report that simply prints all Notes only...
Something like:
for nhandle in db.get_note_handles():
    note = db.get_note_from_handle(nhandle)    if note:        print(note)
This would show it up on the terminal screen.  I do not know how to send it to the printer yet...

You could also open a new file, send all notes to that file, open that new file  in a word processor, and print it...
Sincerely yours,Rob G. Healey


2011/9/17 Robert Chéramy <[hidden email]>

Am 17.09.2011 15:29, schrieb zkab:

> Is there a way to print all notes in the database at once ?



This is not pretty, but:

- export your database to xml.

- gunzip the database (you may rename it to <something>.gz before)

- Open with a text editor, remove everything before and after the notes

section.

- Print (I said it is not pretty)



Robert





------------------------------------------------------------------------------

BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA

http://p.sf.net/sfu/rim-devcon-copy2

_______________________________________________

Gramps-users mailing list

[hidden email]

https://lists.sourceforge.net/lists/listinfo/gramps-users




--
Sincerely yours,Rob G. Healey
"Always surround yourself with people that inspire you togreatness!"




-----La pièce jointe associée suit-----

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
-----La pièce jointe associée suit-----

_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users

Note.tgz (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

zkab
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Peter Landgren
In reply to this post by zkab
You can get the previews form the notes.

Go to  the notes view and "Export view..." as a CSV file.

/Peter




> Is there a way to print all notes in the database at once ?
>
> --
> View this message in context:
> http://gramps.1791082.n4.nabble.com/Print-Notes-tp3820200p3820200.html
> Sent from the GRAMPS - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------------
> --- BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> http://p.sf.net/sfu/rim-devcon-copy2
> _______________________________________________
> Gramps-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-users

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Robert Chéramy
In reply to this post by zkab
Am 18.09.2011 12:12, schrieb zkab:
> I did following:
>
> - export the database to xml ... the exported file was 'data.gramps'
> - gunzip the database ... the result was 'data.gramps.gz'

You did gzip the file. Assuming you are running linux:
- rename data.gramps to data.gramps.gz: mv data.gramps to data.gramps.gz
- gunzip it: gunzip data.gramps.gz
- look into the resulting data.gramps

Exporting the notes to csv ist probably nicer anyway...

Robert

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

zkab
Thanks - now I am on the right track with printing the notes ...
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Benny Malengier
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 <[hidden email]>
Thanks - now I am on the right track with printing the notes ...


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

zkab
Apparently I have missed something.

1) I exported (Gramps XML) to 'zkab.unzip.gramps'.
2) Created 'example_note.xsl' with the content you said.
3) Opened 'zkab.unzip.gramps' with nano ... but all I see is a mess of unreadable characters ...
    How can I replace first line when I don't see one ?
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Benny Malengier


2011/9/19 zkab <[hidden email]>
Apparently I have missed something.

1) I exported (Gramps XML) to 'zkab.unzip.gramps'.
2) Created 'example_note.xsl' with the content you said.
3) Opened 'zkab.unzip.gramps' with nano ... but all I see is a mess of
unreadable characters ...

To save space, gramps exports a zipped file. So you should not open  zkab.unzip.gramps with nano, but instead with ark, fileroller or 7-zip.
You will then see you can extract the actual file which is the one you should call zkab.unzip.gramps

Benny
   How can I replace first line when I don't see one ?

--
View this message in context: http://gramps.1791082.n4.nabble.com/Print-Notes-tp3820200p3823829.html
Sent from the GRAMPS - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Benny Malengier


2011/9/19 Benny Malengier <[hidden email]>


2011/9/19 zkab <[hidden email]>
Apparently I have missed something.

1) I exported (Gramps XML) to 'zkab.unzip.gramps'.
2) Created 'example_note.xsl' with the content you said.
3) Opened 'zkab.unzip.gramps' with nano ... but all I see is a mess of
unreadable characters ...

To save space, gramps exports a zipped file. So you should not open  zkab.unzip.gramps with nano, but instead with ark, fileroller or 7-zip.
You will then see you can extract the actual file which is the one you should call zkab.unzip.gramps


See also:
http://gramps-project.org/wiki/index.php?title=Generate_XML#How_do_I_tell_if_the_XML_file_is_compressed.3F

I see if you create a file test.gramps, the file inside is normally called: test.gramps.uncompressed

Benny
 
Benny
   How can I replace first line when I don't see one ?

--
View this message in context: http://gramps.1791082.n4.nabble.com/Print-Notes-tp3820200p3823829.html
Sent from the GRAMPS - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users



------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

jerome
In reply to this post by zkab
Benny,


> Perhaps somebody should add this example to the wiki documentation ...

We have a xsl page on wiki :)
http://gramps-project.org/wiki/index.php?title=Xsl
Should I also mark it as "documentation" (category) ?
and/or to try to create a new "HowTo" page ?

And it was one of the first way to alternative reports for Gramps, made by some users !!!

Note, I have an easier one for some users ... Not the nicer one but it keeps note markup and format on some output file format. ;)

It is an addon.
So, it can be added under our .gramps/gramps33/plugins folder.

About, xslt it is true that this is a powerful way for reformatting our genealogical data via Gramps XML file.

I did not looked at last specifications[1]
but I wonder if we cannot try to use XQuery[2] embedded into (in association with) small XHTML forms as small Gramps web application (XML reader) ? I am not a big fan of SDK (Android, iOS, Meego) but as they are all compliant with HTML (web navigation), I suppose it needs a common XSLT/XPath/XQuery parser for most device/plateform [3]?

XQuery sounds like sql, I have basic XHTML forms matching most fields and a XPath index ...

There is also the Berkeley DB XML, which is rather an alternative DB backend with Xquery support!


[1] http://www.w3.org/TR/xslt20/
[2] http://www.w3.org/TR/xslt-xquery-serialization/
[3] http://www.relaxng.org/


Jérôme



--- En date de : Lun 19.9.11, Benny Malengier <[hidden email]> a écrit :

De: Benny Malengier <[hidden email]>
Objet: Re: [Gramps-users] Print Notes
À: "zkab" <[hidden email]>
Cc: [hidden email]
Date: Lundi 19 septembre 2011, 14h41

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 <[hidden email]>

Thanks - now I am on the right track with printing the notes ...



-----La pièce jointe associée suit-----

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
-----La pièce jointe associée suit-----

_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users

NoteReport.py (5K) Download Attachment
NoteReport.gpr.py (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

hutou
In reply to this post by Benny Malengier
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 ?
PS. Does this trick preserve styles ?
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Benny Malengier
In reply to this post by Benny Malengier


2011/9/19 Hubert Toullec <[hidden email]>
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 <[hidden email]>
Thanks - now I am on the right track with printing the notes ...

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 _______________________________________________ Gramps-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gramps-users



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Doug
In reply to this post by Benny Malengier
Benny,
Could you expand on this? Maybe I've missed some crucial points.

I exported my database as XML; renamed the .gramps file to
.gz; gunzipped it; replaced the first line of the unzipped
file with

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="example_note.xsl"?>

and created the example_note.xsl file.

When I open the file in Firefox, all I get is the All Notes
header and a few AAAAAAs.

(The w3schools.com example displays in Firefox as expected)

Thanks,

Doug




On 19/09/11 13:41, Benny Malengier wrote:

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















------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Benny Malengier
If you look at the bottom of this mail to my pasted example_note.xsl, you will see a bunch of AAAA, as in

  <html>

Is it possible that that is the problem? So if you open it in an ascii editor, are the spaces perhaps not spaces?
I attached the xsl file to this mail, even though it might not go to the mailing list then.

Benny

2011/9/21 doug <[hidden email]>
Benny,
Could you expand on this? Maybe I've missed some crucial points.

I exported my database as XML; renamed the .gramps file to
.gz; gunzipped it; replaced the first line of the unzipped
file with

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="example_note.xsl"?>

and created the example_note.xsl file.

When I open the file in Firefox, all I get is the All Notes
header and a few AAAAAAs.

(The w3schools.com example displays in Firefox as expected)

Thanks,

Doug




On 19/09/11 13:41, Benny Malengier wrote:

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















------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users

example_note.xsl (738 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Doug
I've tried with your new example_note.xsl that removes the
AAAA .
The result is cleaned up, but still nothing - this
screenshot is all I get

Doug

On 21/09/11 14:58, Benny Malengier wrote:

> If you look at the bottom of this mail to my pasted
> example_note.xsl, you will see a bunch of AAAA, as in
>
> Â  <html>
>
> Is it possible that that is the problem? So if you open it
> in an ascii editor, are the spaces perhaps not spaces?
> I attached the xsl file to this mail, even though it might
> not go to the mailing list then.
>
> Benny
>
> 2011/9/21 doug <[hidden email] <mailto:[hidden email]>>
>
>     Benny,
>     Could you expand on this? Maybe I've missed some crucial
>     points.
>
>     I exported my database as XML; renamed the .gramps file to
>     .gz; gunzipped it; replaced the first line of the unzipped
>     file with
>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <?xml-stylesheet type="text/xsl" href="example_note.xsl"?>
>
>     and created the example_note.xsl file.
>
>     When I open the file in Firefox, all I get is the All Notes
>     header and a few AAAAAAs.
>
>     (The w3schools.com <http://w3schools.com> example
>     displays in Firefox as expected)
>
>     Thanks,
>
>     Doug
>
>
>

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users

Screenshot.jpg (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Print Notes

Benny Malengier
Hmm, strange. If you open the xml of your data, is there a notes section? Does that section have <note> parts? Obviously, if nothing is in the xml (eg not a 3.3 xml) then it would show the true result: no notes.

Benny

2011/9/22 doug <[hidden email]>
I've tried with your new example_note.xsl that removes the AAAA .
The result is cleaned up, but still nothing - this screenshot is all I get

Doug


On 21/09/11 14:58, Benny Malengier wrote:
If you look at the bottom of this mail to my pasted
example_note.xsl, you will see a bunch of AAAA, as in

  <html>


Is it possible that that is the problem? So if you open it
in an ascii editor, are the spaces perhaps not spaces?
I attached the xsl file to this mail, even though it might
not go to the mailing list then.

Benny

2011/9/21 doug <[hidden email] <mailto:[hidden email]>>


   Benny,
   Could you expand on this? Maybe I've missed some crucial
   points.

   I exported my database as XML; renamed the .gramps file to
   .gz; gunzipped it; replaced the first line of the unzipped
   file with

   <?xml version="1.0" encoding="UTF-8"?>
   <?xml-stylesheet type="text/xsl" href="example_note.xsl"?>

   and created the example_note.xsl file.

   When I open the file in Firefox, all I get is the All Notes
   header and a few AAAAAAs.

   (The w3schools.com <http://w3schools.com> example

   displays in Firefox as expected)

   Thanks,

   Doug




------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
12