How to export Gramps data in XML format?

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

How to export Gramps data in XML format?

John W. Kitz
Hi,

I was tinkering a bit with the Gramps function to export data in XML format.
Typically XML is just plain readable text that looks something like this
example and that can be imported in e.g. Notepad++ to read, edit and what
not:

<?xml version="1.0"?>
<catalog>
   <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications
      with XML.</description>
   </book>
   <book id="bk102">
      <author>Ralls, Kim</author>
      <title>Midnight Rain</title>
      <genre>Fantasy</genre>
      <price>5.95</price>
      <publish_date>2000-12-16</publish_date>
      <description>A former architect battles corporate zombies,
      an evil sorceress, and her own childhood to become queen
      of the world.</description>
   </book>
</catalog>

None of the two options available in Gramps to export its data in XML format
(Gramps XML or Gramps XML package) seem to produce a file that contains data
which is formatted in a similar fashion to the example above.

Isn't this possible in Gramps or am I using the wrong functions?

If so, which should I use instead?

Regards, Jk.


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

Gil da Costa

On 2017-01-14 16:31, John W. Kitz wrote:

Hi,

I was tinkering a bit with the Gramps function to export data in XML format.
Typically XML is just plain readable text that looks something like this
example and that can be imported in e.g. Notepad++ to read, edit and what
not:
 
[...]

None of the two options available in Gramps to export its data in XML format
(Gramps XML or Gramps XML package) seem to produce a file that contains data
which is formatted in a similar fashion to the example above.

Isn't this possible in Gramps or am I using the wrong functions?

If so, which should I use instead?

Gramps XML format (.gramps) IS XML. It's just gzipped.

Rename it as xxx.xml.gz, and you will be able to extract the text XML with any standard tool.


It may be useful to know that gramps exports a gzipped XML, but it is able to import a non-gzipped XML file, as long as it as a ".gramps" suffix.


G.Da Costa


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

John W. Kitz
Gil,

On 2017-01-14 16:50, Gil da Costa wrote:

> On 2017-01-14 16:31, John W. Kitz wrote:
>
>> Hi,
>>
>> I was tinkering a bit with the Gramps function to export data in XML
>> format.
>> Typically XML is just plain readable text that looks something like
>> this
>> example and that can be imported in e.g. Notepad++ to read, edit and
>> what
>> not:
>>
>> [...]
>>
>> None of the two options available in Gramps to export its data in
>> XML format
>> (Gramps XML or Gramps XML package) seem to produce a file that
>> contains data
>> which is formatted in a similar fashion to the example above.
>>
>> Isn't this possible in Gramps or am I using the wrong functions?
>>
>> If so, which should I use instead?
>
> Gramps XML format (.gramps) IS XML. It's just gzipped.
>
> Rename it as xxx.xml.gz, and you will be able to extract the text XML
> with any standard tool.
>
> It may be useful to know that gramps exports a gzipped XML, but it is
> able to import a non-gzipped XML file, as long as it as a ".gramps"
> suffix.

Thanks, that did the trick. As a follow on question from that; is there
a specific reason that the researcher info remains empty in the XML file
(see below)?

<header>
     <created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
     <researcher>
     </researcher>
</header>

Even though the researcher information has been entered through Edit ->
Preferences -> Researcher.

Regards, Jk.

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

Ron Johnson
In reply to this post by Gil da Costa
On 01/14/2017 03:12 PM, John W. Kitz wrote:

> Gil,
>
> On 2017-01-14 16:50, Gil da Costa wrote:
>> On 2017-01-14 16:31, John W. Kitz wrote:
>>
>>> Hi,
>>>
>>> I was tinkering a bit with the Gramps function to export data in XML
>>> format.
>>> Typically XML is just plain readable text that looks something like
>>> this
>>> example and that can be imported in e.g. Notepad++ to read, edit and
>>> what
>>> not:
>>>
>>> [...]
>>>
>>> None of the two options available in Gramps to export its data in
>>> XML format
>>> (Gramps XML or Gramps XML package) seem to produce a file that
>>> contains data
>>> which is formatted in a similar fashion to the example above.
>>>
>>> Isn't this possible in Gramps or am I using the wrong functions?
>>>
>>> If so, which should I use instead?
>> Gramps XML format (.gramps) IS XML. It's just gzipped.
>>
>> Rename it as xxx.xml.gz, and you will be able to extract the text XML
>> with any standard tool.
>>
>> It may be useful to know that gramps exports a gzipped XML, but it is
>> able to import a non-gzipped XML file, as long as it as a ".gramps"
>> suffix.
> Thanks, that did the trick. As a follow on question from that; is there
> a specific reason that the researcher info remains empty in the XML file
> (see below)?
>
> <header>
>       <created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
>       <researcher>
>       </researcher>
> </header>
>
> Even though the researcher information has been entered through Edit ->
> Preferences -> Researcher.

A bug, maybe?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE database PUBLIC "-//Gramps//DTD Gramps XML 1.7.1//EN"
"http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
<database xmlns="http://gramps-project.org/xml/1.7.1/">
   <header>
     <created date="2017-01-07" version="4.2.4"/>
     <researcher>
     </researcher>
<mediapath>/home/ron/Genealogy_Media/Johnson-Gilbert</mediapath>
   </header>


--
World Peace Through Nuclear Pacification


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

John W. Kitz
Ron,

On 2017-01-14 22:24, Ron Johnson wrote:

> On 01/14/2017 03:12 PM, John W. Kitz wrote:
>> Gil,
>>
>> On 2017-01-14 16:50, Gil da Costa wrote:
>>> On 2017-01-14 16:31, John W. Kitz wrote:
>>>
>>>> Hi,
>>>>
>>>> I was tinkering a bit with the Gramps function to export data in XML
>>>> format.
>>>> Typically XML is just plain readable text that looks something like
>>>> this
>>>> example and that can be imported in e.g. Notepad++ to read, edit and
>>>> what
>>>> not:
>>>>
>>>> [...]
>>>>
>>>> None of the two options available in Gramps to export its data in
>>>> XML format
>>>> (Gramps XML or Gramps XML package) seem to produce a file that
>>>> contains data
>>>> which is formatted in a similar fashion to the example above.
>>>>
>>>> Isn't this possible in Gramps or am I using the wrong functions?
>>>>
>>>> If so, which should I use instead?
>>> Gramps XML format (.gramps) IS XML. It's just gzipped.
>>>
>>> Rename it as xxx.xml.gz, and you will be able to extract the text XML
>>> with any standard tool.
>>>
>>> It may be useful to know that gramps exports a gzipped XML, but it is
>>> able to import a non-gzipped XML file, as long as it as a ".gramps"
>>> suffix.
>> Thanks, that did the trick. As a follow on question from that; is
>> there
>> a specific reason that the researcher info remains empty in the XML
>> file
>> (see below)?
>>
>> <header>
>>       <created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
>>       <researcher>
>>       </researcher>
>> </header>
>>
>> Even though the researcher information has been entered through Edit
>> ->
>> Preferences -> Researcher.
>
> A bug, maybe?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE database PUBLIC "-//Gramps//DTD Gramps XML 1.7.1//EN"
> "http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
> <database xmlns="http://gramps-project.org/xml/1.7.1/">
>    <header>
>      <created date="2017-01-07" version="4.2.4"/>
>      <researcher>
>      </researcher>
> <mediapath>/home/ron/Genealogy_Media/Johnson-Gilbert</mediapath>
>    </header>

Looked into it some more, isn't a bug. I guess the word researcher in
the <researcher></researcher> tags threw me a bit of a curve ball. In
order for data to be included in between the researcher tags in the XML
file one needs to go to Tools -> Family Tree Processing -> Edit Database
Owner Information.

Doing so, entering the data and exporting the XML again results in:

<created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
     <researcher>
       <resname>removed for privacy</resname>
       <resaddr>removed for privacy</resaddr>
       <rescity>removed for privacy</rescity>
       <resstate>removed for privacy</resstate>
       <rescountry>removed for privacy</rescountry>
       <respostal>removed for privacy</respostal>
       <resemail>removed for privacy</resemail>
     </researcher>

Thanks and regards, Jk.

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

Ron Johnson
In reply to this post by Ron Johnson
On 01/14/2017 03:41 PM, John W. Kitz wrote:

> Ron,
>
> On 2017-01-14 22:24, Ron Johnson wrote:
>> On 01/14/2017 03:12 PM, John W. Kitz wrote:
>>> Gil,
>>>
>>> On 2017-01-14 16:50, Gil da Costa wrote:
>>>> On 2017-01-14 16:31, John W. Kitz wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I was tinkering a bit with the Gramps function to export data in XML
>>>>> format.
>>>>> Typically XML is just plain readable text that looks something like
>>>>> this
>>>>> example and that can be imported in e.g. Notepad++ to read, edit and
>>>>> what
>>>>> not:
>>>>>
>>>>> [...]
>>>>>
>>>>> None of the two options available in Gramps to export its data in
>>>>> XML format
>>>>> (Gramps XML or Gramps XML package) seem to produce a file that
>>>>> contains data
>>>>> which is formatted in a similar fashion to the example above.
>>>>>
>>>>> Isn't this possible in Gramps or am I using the wrong functions?
>>>>>
>>>>> If so, which should I use instead?
>>>> Gramps XML format (.gramps) IS XML. It's just gzipped.
>>>>
>>>> Rename it as xxx.xml.gz, and you will be able to extract the text XML
>>>> with any standard tool.
>>>>
>>>> It may be useful to know that gramps exports a gzipped XML, but it is
>>>> able to import a non-gzipped XML file, as long as it as a ".gramps"
>>>> suffix.
>>> Thanks, that did the trick. As a follow on question from that; is
>>> there
>>> a specific reason that the researcher info remains empty in the XML
>>> file
>>> (see below)?
>>>
>>> <header>
>>>        <created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
>>>        <researcher>
>>>        </researcher>
>>> </header>
>>>
>>> Even though the researcher information has been entered through Edit
>>> ->
>>> Preferences -> Researcher.
>> A bug, maybe?
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE database PUBLIC "-//Gramps//DTD Gramps XML 1.7.1//EN"
>> "http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
>> <database xmlns="http://gramps-project.org/xml/1.7.1/">
>>     <header>
>>       <created date="2017-01-07" version="4.2.4"/>
>>       <researcher>
>>       </researcher>
>> <mediapath>/home/ron/Genealogy_Media/Johnson-Gilbert</mediapath>
>>     </header>
> Looked into it some more, isn't a bug. I guess the word researcher in
> the <researcher></researcher> tags threw me a bit of a curve ball. In
> order for data to be included in between the researcher tags in the XML
> file one needs to go to Tools -> Family Tree Processing -> Edit Database
> Owner Information.
>
> Doing so, entering the data and exporting the XML again results in:
>
> <created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
>       <researcher>
>         <resname>removed for privacy</resname>
>         <resaddr>removed for privacy</resaddr>
>         <rescity>removed for privacy</rescity>
>         <resstate>removed for privacy</resstate>
>         <rescountry>removed for privacy</rescountry>
>         <respostal>removed for privacy</respostal>
>         <resemail>removed for privacy</resemail>
>       </researcher>

I still think it's a bug, since otherwise what's the point of having
Edit->Preferences->Researcher?

--
World Peace Through Nuclear Pacification


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

Nick Hall
On 15/01/17 00:03, Ron Johnson wrote:
Looked into it some more, isn't a bug. I guess the word researcher in
the <researcher></researcher> tags threw me a bit of a curve ball. In
order for data to be included in between the researcher tags in the XML
file one needs to go to Tools -> Family Tree Processing -> Edit Database
Owner Information.

Doing so, entering the data and exporting the XML again results in:

<created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
      <researcher>
        <resname>removed for privacy</resname>
        <resaddr>removed for privacy</resaddr>
        <rescity>removed for privacy</rescity>
        <resstate>removed for privacy</resstate>
        <rescountry>removed for privacy</rescountry>
        <respostal>removed for privacy</respostal>
        <resemail>removed for privacy</resemail>
      </researcher>
I still think it's a bug, since otherwise what's the point of having 
Edit->Preferences->Researcher?

The researcher information in the preferences is used to provide the default when a database is created.  The "Edit Database Owner Information" tool allows the researcher in the database to be changed.  It doesn't change the default.  The researcher for each database can be different.

Nick.



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

manzi.sam
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: How to export Gramps data in XML format?

John W. Kitz
In reply to this post by Ron Johnson
Ron,

On 2017-01-15 01:03, Ron Johnson wrote:

> On 01/14/2017 03:41 PM, John W. Kitz wrote:
>> Ron,
>>
>> On 2017-01-14 22:24, Ron Johnson wrote:
>>> On 01/14/2017 03:12 PM, John W. Kitz wrote:
>>>> Gil,
>>>>
>>>> On 2017-01-14 16:50, Gil da Costa wrote:
>>>>> On 2017-01-14 16:31, John W. Kitz wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I was tinkering a bit with the Gramps function to export data in
>>>>>> XML
>>>>>> format.
>>>>>> Typically XML is just plain readable text that looks something
>>>>>> like
>>>>>> this
>>>>>> example and that can be imported in e.g. Notepad++ to read, edit
>>>>>> and
>>>>>> what
>>>>>> not:
>>>>>>
>>>>>> [...]
>>>>>>
>>>>>> None of the two options available in Gramps to export its data in
>>>>>> XML format
>>>>>> (Gramps XML or Gramps XML package) seem to produce a file that
>>>>>> contains data
>>>>>> which is formatted in a similar fashion to the example above.
>>>>>>
>>>>>> Isn't this possible in Gramps or am I using the wrong functions?
>>>>>>
>>>>>> If so, which should I use instead?
>>>>> Gramps XML format (.gramps) IS XML. It's just gzipped.
>>>>>
>>>>> Rename it as xxx.xml.gz, and you will be able to extract the text
>>>>> XML
>>>>> with any standard tool.
>>>>>
>>>>> It may be useful to know that gramps exports a gzipped XML, but it
>>>>> is
>>>>> able to import a non-gzipped XML file, as long as it as a ".gramps"
>>>>> suffix.
>>>> Thanks, that did the trick. As a follow on question from that; is
>>>> there
>>>> a specific reason that the researcher info remains empty in the XML
>>>> file
>>>> (see below)?
>>>>
>>>> <header>
>>>>        <created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
>>>>        <researcher>
>>>>        </researcher>
>>>> </header>
>>>>
>>>> Even though the researcher information has been entered through Edit
>>>> ->
>>>> Preferences -> Researcher.
>>> A bug, maybe?
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE database PUBLIC "-//Gramps//DTD Gramps XML 1.7.1//EN"
>>> "http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
>>> <database xmlns="http://gramps-project.org/xml/1.7.1/">
>>>     <header>
>>>       <created date="2017-01-07" version="4.2.4"/>
>>>       <researcher>
>>>       </researcher>
>>> <mediapath>/home/ron/Genealogy_Media/Johnson-Gilbert</mediapath>
>>>     </header>
>> Looked into it some more, isn't a bug. I guess the word researcher in
>> the <researcher></researcher> tags threw me a bit of a curve ball. In
>> order for data to be included in between the researcher tags in the
>> XML
>> file one needs to go to Tools -> Family Tree Processing -> Edit
>> Database
>> Owner Information.
>>
>> Doing so, entering the data and exporting the XML again results in:
>>
>> <created date="2017-01-14" version="GrampsAIO64-4.2.5-1"/>
>>       <researcher>
>>         <resname>removed for privacy</resname>
>>         <resaddr>removed for privacy</resaddr>
>>         <rescity>removed for privacy</rescity>
>>         <resstate>removed for privacy</resstate>
>>         <rescountry>removed for privacy</rescountry>
>>         <respostal>removed for privacy</respostal>
>>         <resemail>removed for privacy</resemail>
>>       </researcher>
>
> I still think it's a bug, since otherwise what's the point of having
> Edit->Preferences->Researcher?

Despite the various answers I got on the mailing list I still didn't
quite understand it either, so I raised a trouble ticket just to be
sure. Discussion to be continued there I guess...

Thanks and regards, Jk.

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: owner/researcher information - was: How to export Gramps data in XML format?

enno
Hello John,
>> I still think it's a bug, since otherwise what's the point of having
>> Edit->Preferences->Researcher?
> Despite the various answers I got on the mailing list I still didn't
> quite understand it either, so I raised a trouble ticket just to be
> sure. Discussion to be continued there I guess...
As far as I can tell, and remember from earlier discussions, including
an issue that I raised earlier myself, here's what the situation should
be, i.e. the intent:

1. Researcher information is a program preference. It sort of registers
you as the primary user/owner of a particular Gramps installation. This
preference is saved in an INI file on every PC that Gramps is used on.
Changes made here will never affect existing trees, and will never
transfer to other Gramps setups, unless you copy the INI files that
store this preference.

2. When you create a new tree, and only then, Gramps will copy the owner
information to that new tree. And from then on, you can change the owner
information for that tree in the tools menu, and only there. Making a
change in the preferences will never change the ownership of a tree.

3. When you import a tree into another one, its owner information will
not affect the information in the tree it is imported into, unless that
part is empty. This makes sure that any existing ownership is not
changed by an import.

Program and tree 'ownership' are separate things, and I think that
Gramps works mostly right in this respect. It's closely related to
author information in Word. If you set a standard author name in Word,
it will be used for the author name in new documents, but any existing
document will keep the original author's name and not be suddenly
'owned' by you. You can change the author name for the document, if you
want, but that will still be independent of the name registered with
Word itself.

This makes me think that the behavior found by you is the right one, and
there is no need to change that. I do acknowledge that the meaning of
the different menu entries is not very clear, and we may need to add
some text that explains that the researcher information is a program
preference.

regards,

Enno


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org