diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-01-17 20:28:35 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-01-17 20:28:35 +0000 |
commit | 9904a3e4e8726a6e21ca4190b83a2f57349f9e8e (patch) | |
tree | 3b48fab4e946cceffd0b3ed1d0889a09fa9cf33e /examples/embedding/xml | |
parent | 874ccce4939004cb0882ef37e63a8a3ec2c17eea (diff) | |
download | xmlgraphics-fop-9904a3e4e8726a6e21ca4190b83a2f57349f9e8e.tar.gz xmlgraphics-fop-9904a3e4e8726a6e21ca4190b83a2f57349f9e8e.zip |
Added an example for the intermediate format the demonstrates stamping a document using XSLT.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369908 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples/embedding/xml')
-rw-r--r-- | examples/embedding/xml/xslt/atstamp.xsl | 57 | ||||
-rw-r--r-- | examples/embedding/xml/xslt/projectteam2fo.xsl | 2 |
2 files changed, 58 insertions, 1 deletions
diff --git a/examples/embedding/xml/xslt/atstamp.xsl b/examples/embedding/xml/xslt/atstamp.xsl new file mode 100644 index 000000000..ee21dd823 --- /dev/null +++ b/examples/embedding/xml/xslt/atstamp.xsl @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2006 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<!-- $Id$ --> +<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/> + <!-- ========================= --> + <!-- stamping... --> + <!-- ========================= --> + <xsl:template match="flow"> + <xsl:copy> + <xsl:apply-templates select="@*"/> + + <!-- Stamp a big "SPECIMEN" text over the whole page using an area tree fragment inserted at the right place... --> + <block ipd="595275" bpd="841889" is-viewport-area="true" left-position="0" top-position="0" ctm="[1.0 0.0 0.0 1.0 0.0 0.0]" positioning="fixed"> + <block ipd="595275" bpd="841889" is-reference-area="true"> + <block ipd="595275" bpd="841889"> + <lineArea ipd="595275" bpd="841889"> + <viewport ipd="595275" bpd="841889" offset="0" pos="0 0 595275 841889"> + <foreignObject ipd="0" bpd="0" ns="http://www.w3.org/2000/svg"> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> + <g transform="rotate(-50 50 50)"> + <text x="50" y="60" style="font-size:20;fill:#dfdfdf;stroke:none;font-family:sans-serif" text-anchor="middle">SPECIMEN</text> + </g> + </svg> + </foreignObject> + </viewport> + </lineArea> + </block> + </block> + </block> + + <xsl:apply-templates select="child::*"/> + </xsl:copy> + </xsl:template> + <!-- ========================= --> + <!-- identity transformation --> + <!-- ========================= --> + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> +</xsl:stylesheet> diff --git a/examples/embedding/xml/xslt/projectteam2fo.xsl b/examples/embedding/xml/xslt/projectteam2fo.xsl index bb3e22984..f500e3162 100644 --- a/examples/embedding/xml/xslt/projectteam2fo.xsl +++ b/examples/embedding/xml/xslt/projectteam2fo.xsl @@ -35,7 +35,7 @@ <fo:block font-size="12pt" space-after="5mm">Version <xsl:value-of select="$versionParam"/> </fo:block> <fo:block font-size="10pt"> - <fo:table table-layout="fixed"> + <fo:table table-layout="fixed" width="100%" border-collapse="separate"> <fo:table-column column-width="4cm"/> <fo:table-column column-width="4cm"/> <fo:table-column column-width="5cm"/> |