Difference between revisions of "Xsl"

From Gramps
Jump to: navigation, search
(New page: =Definition= 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 i...)
 
(xsl)
Line 1: Line 1:
=Definition=
+
==Definition==
  
 
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.
 
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.
Line 8: Line 8:
 
* XSL-FO (eXtensible Stylesheet Language - Formatting Objects)
 
* XSL-FO (eXtensible Stylesheet Language - Formatting Objects)
  
=How using XSL ?=
+
==How using XSL ?==
  
 
We may transform, format every XML with a XML/XSL parser.
 
We may transform, format every XML with a XML/XSL parser.
Line 19: Line 19:
 
you may generate a new file without loosing data.
 
you may generate a new file without loosing data.
  
=How this work ?=
+
==How this work ?==
  
 
There is many tutorials on the Web. XSL allows loop-like, test, variable, param, function and uses template.  
 
There is many tutorials on the Web. XSL allows loop-like, test, variable, param, function and uses template.  
Line 26: Line 26:
  
 
We don't really iterate through the file. We retrieve data with XPath.
 
We don't really iterate through the file. We retrieve data with XPath.
 +
 +
==Using XSL with 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 :
 +
 +
* a database resume (output : XML, PS, PDF or SVG)
 +
* filtering some data and transforming result
 +
* a bridge between two open programs (GRAMPS <-> [[tellico|Tellico]])

Revision as of 07:54, 2 July 2007

Definition

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:

  • XSLT (eXtensible Stylesheet Language Transformation)
  • XPath (an expression language for addressing portions)
  • 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: xsltproc.

With simple command-line like:

xsltproc xx.xsl xx.xml > new.xml

you may generate a new file without loosing data.

How this work ?

There is many tutorials on the Web. XSL allows loop-like, test, variable, param, function and uses template.

You can work with DOM or not. That also depending on the memory available

We don't really iterate through the file. We retrieve data with XPath.

Using XSL with 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 documented and coherent, we may use it for :

  • a database resume (output : XML, PS, PDF or SVG)
  • filtering some data and transforming result
  • a bridge between two open programs (GRAMPS <-> Tellico)