diff options
author | Glenn Adams <gadams@apache.org> | 2016-03-06 06:14:41 +0000 |
---|---|---|
committer | Glenn Adams <gadams@apache.org> | 2016-03-06 06:14:41 +0000 |
commit | 57949ba0cfffa2dd5933a103c6ad867de9f1e7a0 (patch) | |
tree | cd1d8100a9135449635251820f39f272151005ac /fop/test/xsl | |
parent | c8cde713f54ca731f4a7f3bfaef8af9e8a1b9262 (diff) | |
download | xmlgraphics-fop-57949ba0cfffa2dd5933a103c6ad867de9f1e7a0.tar.gz xmlgraphics-fop-57949ba0cfffa2dd5933a103c6ad867de9f1e7a0.zip |
Configure maven build.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/maven@1733788 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop/test/xsl')
-rw-r--r-- | fop/test/xsl/copy.xsl | 21 | ||||
-rw-r--r-- | fop/test/xsl/doc.xsl | 52 | ||||
-rw-r--r-- | fop/test/xsl/fo-page-sequence-splitter.xsl | 45 | ||||
-rw-r--r-- | fop/test/xsl/fo-replicator.xsl | 72 | ||||
-rw-r--r-- | fop/test/xsl/iloop.xsl | 24 |
5 files changed, 214 insertions, 0 deletions
diff --git a/fop/test/xsl/copy.xsl b/fop/test/xsl/copy.xsl new file mode 100644 index 000000000..d036bf740 --- /dev/null +++ b/fop/test/xsl/copy.xsl @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="/"><xsl:copy-of select="*"/></xsl:template> +</xsl:stylesheet> diff --git a/fop/test/xsl/doc.xsl b/fop/test/xsl/doc.xsl new file mode 100644 index 000000000..c84cec5a3 --- /dev/null +++ b/fop/test/xsl/doc.xsl @@ -0,0 +1,52 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> + <xsl:output method="xml" indent="yes"/> + <xsl:template match="test"> + <fo:root> + <fo:layout-master-set> + <fo:simple-page-master master-name="one" page-height="29.7cm" page-width="21cm" margin-top="0.5cm" margin-bottom="0.5cm" margin-left="1.5cm" margin-right="1.5cm"> + <fo:region-body margin-top="1.5cm" margin-bottom="2cm"/> + <fo:region-before extent="1.5cm"/> + <fo:region-after extent="1.5cm"/> + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="one"> + <fo:flow font-size="10pt" line-height="10pt" flow-name="xsl-region-body"> + <xsl:apply-templates select="data"/> + </fo:flow> + </fo:page-sequence> + </fo:root> + </xsl:template> + + <xsl:template match="data"> + <xsl:apply-templates/> + </xsl:template> + +<!-- note: this causes any node not otherwise defined to be copied --> + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="title"> + <xsl:apply-templates/> + </xsl:template> +</xsl:stylesheet> diff --git a/fop/test/xsl/fo-page-sequence-splitter.xsl b/fop/test/xsl/fo-page-sequence-splitter.xsl new file mode 100644 index 000000000..d493ad2af --- /dev/null +++ b/fop/test/xsl/fo-page-sequence-splitter.xsl @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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$ --> +<!-- Description: Splits an FO file into multiple FO files at page-sequence boundaries. --> +<!-- Note: Requires Xalan-J! --> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:fo="http://www.w3.org/1999/XSL/Format" + xmlns:redirect="http://xml.apache.org/xalan/redirect" + extension-element-prefixes="redirect"> + + <xsl:template match="fo:page-sequence"> + <redirect:write select="concat('page-sequence-', position(), '.fo')"> + <fo:root> + <xsl:apply-templates select="../fo:layout-master-set"/> + <xsl:apply-templates select="../fo:declarations"/> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </fo:root> + </redirect:write> + </xsl:template> + + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + +</xsl:stylesheet> diff --git a/fop/test/xsl/fo-replicator.xsl b/fop/test/xsl/fo-replicator.xsl new file mode 100644 index 000000000..256c47752 --- /dev/null +++ b/fop/test/xsl/fo-replicator.xsl @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You 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.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <xsl:param name="repeats" select="2"/> + <xsl:template match="@*|node()"> + <xsl:param name="run"/> + <xsl:copy> + <xsl:apply-templates select="@*|node()"> + <xsl:with-param name="run" select="$run"/> + </xsl:apply-templates> + </xsl:copy> + </xsl:template> + <xsl:template match="fo:root"> + <fo:root> + <xsl:apply-templates select="@*|fo:layout-master-set|fo:declarations"> + <xsl:with-param name="run" select="0"/> + </xsl:apply-templates> + <xsl:call-template name="repeat"> + <xsl:with-param name="n" select="$repeats"/> + <xsl:with-param name="what" select="fo:page-sequence"/> + </xsl:call-template> + </fo:root> + </xsl:template> + <xsl:template name="repeat"> + <xsl:param name="n"/> + <xsl:param name="what"/> + <xsl:if test="number($n) > 0"> + <xsl:apply-templates select="$what"> + <xsl:with-param name="run" select="$n"/> + </xsl:apply-templates> + <xsl:call-template name="repeat"> + <xsl:with-param name="n" select="number($n) - 1"/> + <xsl:with-param name="what" select="$what"/> + </xsl:call-template> + </xsl:if> + </xsl:template> + <xsl:template match="fo:*/@id"> + <xsl:param name="run"/> + <xsl:attribute name="id"><xsl:value-of select="."/>-<xsl:value-of select="$run"/></xsl:attribute> + </xsl:template> + <xsl:template match="fo:*/@ref-id"> + <xsl:param name="run"/> + <xsl:attribute name="ref-id"><xsl:value-of select="."/>-<xsl:value-of select="$run"/></xsl:attribute> + </xsl:template> + <xsl:template match="fo:*/@internal-destination"> + <xsl:param name="run"/> + <xsl:attribute name="internal-destination"><xsl:value-of select="."/>-<xsl:value-of select="$run"/></xsl:attribute> + </xsl:template> + <xsl:template match="fo:page-number-citation"> + <xsl:param name="run"/> + <fo:inline><xsl:value-of select="@ref-id"/></fo:inline> + </xsl:template> + <xsl:template match="fo:retrieve-marker|fo:marker"> + <xsl:param name="run"/> + </xsl:template> +</xsl:stylesheet> diff --git a/fop/test/xsl/iloop.xsl b/fop/test/xsl/iloop.xsl new file mode 100644 index 000000000..2efdfb068 --- /dev/null +++ b/fop/test/xsl/iloop.xsl @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <xsl:template match="/"> + <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> + <fo:layout-master-set> + <fo:simple-page-master master-name="all" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="0.3cm" margin-left="1cm" margin-right="1cm"> + <fo:region-body margin-top="0cm" margin-right="0cm" margin-bottom="1cm" margin-left="0cm" region-name="doesntexist" /> + + </fo:simple-page-master> + </fo:layout-master-set> + <fo:page-sequence master-reference="all"> + + <fo:flow flow-name="xsl-region-body"> + <fo:block> + <xsl:apply-templates select="//region[@name='Main Region']" /> + </fo:block> + </fo:flow> + </fo:page-sequence> + </fo:root> + + </xsl:template> + + +</xsl:stylesheet>
\ No newline at end of file |