1,969
edits
Changes
Xsl
,→Using XSL with Gramps XML
[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.
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.