docs: Include files are always searched at standard location, too.
This removes the need to specify the location where yml2 was unpacked or
installed as YML_PATH. So this now works:
YML_PATH=/foo ./yml2proc --xml2yml
The standard system location <prefix>/share/yml2 is now always appended to
the include search path. If this path does not exist, the directory one
above the `backend.py` file is added, allowing the same behaviour for
uninstalled yml2.
In the Makefile enforce the .ysl2 files to be searched in the current
directory first.
include yslt.yml2
tstylesheet xmlns:uml="http://schema.omg.org/spec/UML/2.1",
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" {
template "/" apply "xmi:XMI/uml:Model/packagedElement", 0;
template "packagedElement[@xmi:type='uml:Package']" {
param "name", "''";
if "$name=''" apply "packagedElement", 0 { with "name", "@name"; }
if "$name!=''" apply "packagedElement", 0 { with "name", "concat($name, '_', @name)"; }
}
template "packagedElement[@xmi:type='uml:Class']" {
param "name";
| CREATE TABLE «$name»_«@name» (
apply "ownedAttribute";
| );
}
template "ownedAttribute[@xmi:type='uml:Property' and type/@xmi:type='uml:PrimitiveType']" {
0> «@name»
choose {
when "type/@href='http://schema.omg.org/spec/UML/2.1/uml.xml#String'"
> VARCHAR
// [...] for other types, extend when clauses
}
if "position()!=last()" > ,
text "\n";
}
}