--------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD
Content-Type: Multipart/Mixed;
boundary="------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD"
--------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Am Donnerstag, 15. Juli 2004 18:05 schrieb Michael Neumann:
can you give a short example?
xslt4r is in an alpha-stage. the last update was at the end of 2001!
I want to apply 'lcwa2sql.xsl' on 'lcwa-short.dia'. Using xsltproc from=20
libxslt, i get 'lcwa.sql'. But 'ruby xslt.rb lcwa2sql.xsl lcwa-short.dia'=
=20
produces no output.
I actually need a way to apply the stylesheets without upgrading our=20
production system to libxml and libxslt. And because of my growing addict=
ion=20
to ruby, i came accross xslt4r.
maytheforcebewithyou
ralf
--------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD
Content-Type: text/xml;
charset="iso-8859-1";
name="lcwa2sql.xsl"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="lcwa2sql.xsl"
<?xml version="1.0" encoding="ISO8859-1"?>
<!-- author: Ralf Mueller -->
<!-- this stylesheet is tested with xstlproc from the libxslt library -->
<!-- This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:dia="
http://www.lysator.liu.se/~alla/dia/"
version="1.0">
<xsl
utput method="text" encoding="iso8859-1"/>
<xsl:template match="/">
use test;
<xsl:apply-templates select="dia:diagram"/>
</xsl:template>
<xsl:template match="dia:diagram">
<xsl:for-each select="dia:layer[@name='Hintergrund']">
<xsl:for-each select="dia
bject[@type='UML - Class']">
<xsl:text>CREATE TABLE IF NOT EXISTS </xsl:text>
<xsl:apply-templates select="dia:attribute[@name='name']"/>(<xsl:apply-templates select="dia:attribute[@name='attributes']"/>);
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template match="dia:attribute[@name='name']">
<xsl:value-of select="translate(.,'#','')"/>
</xsl:template>
<xsl:template match="dia:attribute[@name='attributes']">
<xsl:for-each select="dia:composite[@type='umlattribute']">
<xsl:for-each select="dia:attribute">
<xsl:if test="./@name = 'name' or
./@name = 'type'">
<xsl:value-of select="translate(.,'#','')"/>
</xsl:if>
</xsl:for-each>
NOT NULL <xsl:if test="position() < last()">,</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD
Content-Type: application/x-gzip;
name="lcwa-short.dia.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="lcwa-short.dia.gz"
H4sICEZ+90AAA2xjd2Etc2hvcnQuZGlhAO1dzXbbNhbe+yk4yqLtjESLpCiJTZ0eN52M5zRxciZJ
F934QCJEIoZADQBathfzKrOZZ+iqO7/YAKRsmb+iSFGuFdgnsUlf3g9/H+7FxSX0w4/Xc6xdQcpQ
QE46ht7vaJBMAxcR76Tz+dOb3rjz46ujH1wEvhf/PArmmniCMHl10vE5X3x/fLxcLnV8wwAPqI5R
qDN4/B+AMTgWQscd8fhfej3t8gtzZz5ml4jNvCP25dKdaUeuNzsSd49mnj87Er95/lGv9+pI0x4j
uoADeW91F3BO0STkUCNgDk86EzC99GgQErcTS63kpgEOqHYF8EnnxSz66hyv1Bwn9JToXoAFpGm1
80XAkBDhN4uMSIEe+f8jmZUUE0LEe/XidPAiLtLqxlpXXkELQfgcUA+RLA6FAMcN0dft+0bYXv+k
Zf24Zf20Zf2IXSwCyilAPIsxCQIMAYlhOA1hfRw2BVgMk/J6mCPDto36IDPEedBqNQT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5MjT5Bt3im0lWAfKtj0G+f95/umQaPbxRqyF59HLpQR2NTGmIUVs6j9i22rrWb05UoJ1iLxSKexF
uity61ylC5ZiqbB/q2H/U8aCKYpqkRP8d3YR/B/qNUPx1cL/I90x5Qk3+uil4eiWMRx3TUOve8AO
5X6Fw5/StcoREcUa2VXFzL5eeoi2AEyKbF2ngCKYDSIVzAhlJrb4ud3sItSL6yM5KnKi+o0LColb
HHDZOHnRALdlXuYh5miB0bRgsr+3L8bOjAugNFjuY8oHnkehB3hu0+3s2Lzn2Jl/VZ25vdmeBoTE
swPL9P39XzQfEFceaiUsHw+ibW9t/VcxBWaPO8952Fg9bJij5OOZQHamTM036o3GH4Fhj7q9miH3
SqbaHkanasmjGV8OpdkeD7o9U7da3alvUKmqO/WjcZvnatltnKs1RxzQCRQMer5na70NPER6P4up
hcQBwA+CEgGBpBu9by+mLu085LeQRpv2cQyDafIFfMkg8RBDxNW+DeSbw0tA5XMMQR9qbyB2tW8W
QmgpfKdvvlM7/XlQaqe/BpLa6a/NHbXTr3b6y7tL7fQnpLcN5RYetFlSgUKwr3E3MnZIZEA38jje
rX0sdaJWGdYh7ovce4+KUA0I9WHViFk6aeef377VxJX2MwSXHF0Jyx8SLxL8LfTEopNFB+PGXv/+
2dfwEyoU+8rLvHlXcurvf2fywE5jOF814p/AmKn9yiel01VAFZuKdFdNAY3bUJHpaycTF4rVO7NN
qPRJtqAi0p+YSCqLJrEz1/hTqC1DH9rDrmm2mkojUfrDbs/o68bLgaVb45HZNcXPNnNpcquWI2ZV
Eek5evmHwKdFVB5NcgJWeTT5ECqPprLT9Bw682+qM/eUR5NJhTGyE3RJJs0onYeTmX42ZtLE16sP
t4svxD+Pgvmro/8D346IU6OOAAA=
--------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD
Content-Type: text/plain;
charset="iso-8859-1";
name="lcwa.sql"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="lcwa.sql"
use test;
CREATE TABLE IF NOT EXISTS
haeuser
(
hauscode
CHAR(10)
NOT NULL ,
landcode
CHAR(10)
NOT NULL ,
name
CHAR(40)
NOT NULL ,
adrplz
CHAR(5)
NOT NULL ,
adrort
CHAR(30)
NOT NULL ,
adrstrasse
CHAR(30)
NOT NULL ,
adrhausnr
CHAR(10)
NOT NULL ,
telnr
CHAR(20)
NOT NULL ,
faxnr
CHAR(20)
NOT NULL ,
email
CHAR(20)
NOT NULL );
CREATE TABLE IF NOT EXISTS
abteilungen
(
hauscode
CHAR(10)
NOT NULL ,
abtcode
CHAR(10)
NOT NULL ,
abtnr
INT
NOT NULL ,
name
CHAR(40)
NOT NULL );
CREATE TABLE IF NOT EXISTS
mitarbeiter
(
user
CHAR(10)
NOT NULL ,
passwort
CHAR(10)
NOT NULL ,
nachname
CHAR(30)
NOT NULL ,
vorname
CHAR(30)
NOT NULL ,
titel
CHAR(20)
NOT NULL );
--------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD--
--------------Boundary-00=_JFOXHKZOOK95XFHJ3EJD--