Changes

Jump to: navigation, search

Xsl

20 bytes removed, 07:48, 5 April 2022
Using XSL with Gramps XML
[[Category:Developers/General]]
 
==Definition==
 
[http://www.w3.org/Style/XSL/ XSL] is a family of transformation languages which allows us to describe how files encoded in the XML standard are to be formatted or transformed.
There are three languages in the family:
* [httphttps://en.wikipedia.org/wiki/XSLT XSLT] (eXtensible Stylesheet Language Transformation)* [httphttps://en.wikipedia.org/wiki/XPath XPath] (an expression language for addressing portions) * [httphttps://en.wikipedia.org/wiki/XSL-FO XSL_Formatting_Objects XSL-FO] (eXtensible Stylesheet Language - Formatting Objects)
==How using XSL ?==
We may transform, format every XML with a XML/XSL parser.
There is many parsers. The most accessible could be: [httphttps://xmlsoftgnome.pages.gitlab.gnome.org/XSLTlibxslt/xsltproc2xsltproc.html xsltproc].
With simple command-line like:
We don't really iterate through the file, it is recursive. We retrieve data with XPath.
==Using XSL with gramps Gramps XML==
Some people use perl or python for retrieving some data from GEDCOM.
We may use XSL for this on GRAMPS XML.
GRAMPS XML is [http://gramps-project.org/xml/1.2.0/ documented] and coherent, we may use it for :
You may use XSL for this on Gramps XML, see [[media:Xpaths.gz|XPaths]]. Gramps XML is [https://gramps-project.org/xml/ documented] and coherent, we may use it for : * a database resume (output : HTML, XML, PS, PDF or SVG).* filtering some data and transforming result ([[media:Ancestors.xsl.gz|Ancestors.xsl]] , [[media:Birthday.xsl.gz|Birthday.xsl]] ).* a bridge between two open programs (GRAMPS Gramps <-> [[tellico|Tellico]]).* a web form.
==Examples==
* If you select GRAMPS Gramps object on XSL, and use this code with HTML output :
<img>
<xsl:attribute name="src">
</img>
:
then you will be able to display media objects on a HTML file. You may use all HTML codes or .css file for having what you want. Sample on a {{bug|2472}} bug-report.
* With XML, you will be able to make SVG. To generate a basic ancestors geographical map area with gramps Gramps coordinates.
For [[France]] area (dirty and quick test) :
You will get a layer according to specified dimensions on XSLT stylesheet.
Ex: [http://romjerome.ifrance.com/carte.png carte.png] It uses a custom [http://en.wikipedia.org/wiki/Coordinate_system#Geographical_systems frame of reference] <rect x="{(($long+(-4))*16)*120}" y="{(1000-$lat*20)*40}" width="5px" height="5px"/> <text x="{(($long+(-4))*16)*116}" y="{(1000-$lat*20)*40}" font-size="13px"><xsl:value-of select="ptitle"/>for displaying what we wantall places in France, not always practical but fast and effective. [[File:Fr_coordonnées_positives.png|300px|thumb|center|Areas on East France]] ==See also==* [[Gramps_{{man version}}_Wiki_Manual_-_Categories#Geography_Category]]
Also, you should have a look to [[Geographic_ReportCategory:Developers/General]].
1,969
edits

Navigation menu