You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Sascha Teifke <ma...@teifke.de> on 2005/03/16 16:38:39 UTC
fop with lenya: how can I suppress the in a created
pdf
I am using fop with apache lenya to create pdf files.
I'm using a simple xsl-file for transforming the created
lenya xml files into pdf files:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
>
<!-- generate PDF page structure -->
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="page"
page-height="29.7cm"
page-width="21cm"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm"
>
<fo:region-before extent="3cm"/>
<fo:region-body margin-top="3cm"/>
<fo:region-after extent="1.5cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="all">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference
master-reference="page" page-position="first"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="all">
<fo:flow flow-name="xsl-region-body">
<fo:block><xsl:apply-templates/></fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<!-- process paragraphs -->
<xsl:template match="p">
<fo:block><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="meta">
<fo:block color="green">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- convert sections to XSL-FO headings -->
<xsl:template match="s1">
<fo:block font-size="24pt" color="red" font-weight="bold">
<xsl:apply-templates select="@title"/>
</fo:block>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
But ... how can I make the <lenya:meta> tags in the xml file not to be
shown in the
created pdf file???
Thank you in advance!
Sascha
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop with lenya: how can I suppress the in a created
pdf
Posted by Sascha Teifke <ma...@teifke.de>.
Michael Wechner wrote:
> Sascha Teifke wrote:
>
>> Michael Wechner wrote:
>>
>>> Sascha Teifke wrote:
>>>
>>>> I am using fop with apache lenya to create pdf files.
>>>> I'm using a simple xsl-file for transforming the created
>>>> lenya xml files into pdf files:
>>>> <fo:page-sequence master-reference="all">
>>>> <fo:flow flow-name="xsl-region-body">
>>>> <fo:block><xsl:apply-templates/></fo:block>
>>>
>>>
>>>
>>>
>>>
>>> <xsl:apply-templates select="/html/*[local-name() != 'meta']"/>
>>>
>>> HTH
>>>
>>> Michi
>>>
>> I did so, but now my page is blank ...
>
>
>
> I guess the namespaces needed to be added ...
>
> Michi
>
Sorry, I am completely new to this and I really hope it isn't to
annoying ....
how can this be done?
>>
>>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop with lenya: how can I suppress the in a created
pdf
Posted by Michael Wechner <mi...@wyona.com>.
Sascha Teifke wrote:
> Michael Wechner wrote:
>
>> Sascha Teifke wrote:
>>
>>> I am using fop with apache lenya to create pdf files.
>>> I'm using a simple xsl-file for transforming the created
>>> lenya xml files into pdf files:
>>> <fo:page-sequence master-reference="all">
>>> <fo:flow flow-name="xsl-region-body">
>>> <fo:block><xsl:apply-templates/></fo:block>
>>
>>
>>
>>
>> <xsl:apply-templates select="/html/*[local-name() != 'meta']"/>
>>
>> HTH
>>
>> Michi
>>
> I did so, but now my page is blank ...
I guess the namespaces needed to be added ...
Michi
>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop with lenya: how can I suppress the in a created
pdf
Posted by Sascha Teifke <ma...@teifke.de>.
Michael Wechner wrote:
> Sascha Teifke wrote:
>
>> I am using fop with apache lenya to create pdf files.
>> I'm using a simple xsl-file for transforming the created
>> lenya xml files into pdf files:
>> <fo:page-sequence master-reference="all">
>> <fo:flow flow-name="xsl-region-body">
>> <fo:block><xsl:apply-templates/></fo:block>
>
>
>
> <xsl:apply-templates select="/html/*[local-name() != 'meta']"/>
>
> HTH
>
> Michi
>
I did so, but now my page is blank ...
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop with lenya: how can I suppress the in a created
pdf
Posted by Michael Wechner <mi...@wyona.com>.
Sascha Teifke wrote:
> I am using fop with apache lenya to create pdf files.
> I'm using a simple xsl-file for transforming the created
> lenya xml files into pdf files:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> >
> <!-- generate PDF page structure -->
> <xsl:template match="/">
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="page"
> page-height="29.7cm"
> page-width="21cm"
> margin-top="1cm"
> margin-bottom="2cm"
> margin-left="2.5cm"
> margin-right="2.5cm"
> >
> <fo:region-before extent="3cm"/>
> <fo:region-body margin-top="3cm"/>
> <fo:region-after extent="1.5cm"/>
> </fo:simple-page-master>
>
> <fo:page-sequence-master master-name="all">
> <fo:repeatable-page-master-alternatives>
> <fo:conditional-page-master-reference
> master-reference="page" page-position="first"/>
> </fo:repeatable-page-master-alternatives>
> </fo:page-sequence-master>
> </fo:layout-master-set>
>
> <fo:page-sequence master-reference="all">
> <fo:flow flow-name="xsl-region-body">
> <fo:block><xsl:apply-templates/></fo:block>
<xsl:apply-templates select="/html/*[local-name() != 'meta']"/>
HTH
Michi
>
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop with lenya: how can I suppress the in a created
pdf
Posted by Michael Wechner <mi...@wyona.com>.
Sascha Teifke wrote:
> Thank you very much!
> That was it!
> I will subscribe to the mulberry list at once.
I don't know if you are also subscribed to the Lenya list,
but your XSLT would be a nice contribution ;-)
Michi
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: fop with lenya: how can I suppress the in a created
pdf
Posted by Sascha Teifke <ma...@teifke.de>.
Thank you very much!
That was it!
I will subscribe to the mulberry list at once.
So long!
Sascha
Andreas L. Delmelle wrote:
>>-----Original Message-----
>>From: Sascha Teifke [mailto:mailinglist@teifke.de]
>>
>>
>>
>
>Hi,
>
>(*sigh*... Glen's right, you know. Question is actually more suited for
>Mulberry, but here we go anyway...)
>
>Normally, to keep the lenya:meta element from appearing in the ouput, all
>you need to do is add an empty template like so:
>
><xsl:template match="lenya:meta"
>xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" />
>
>However, you will still run into trouble, since your source document is in
>the XHTML namespace, and you only have templates for nodes that are in no
>namespace...
>
>
>
>><?xml version="1.0" encoding="iso-8859-1"?>
>><xsl:stylesheet
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>> xmlns:fo="http://www.w3.org/1999/XSL/Format"
>>
>>
>
>You want to add these bindings:
> xmlns:h="http://www.w3.org/1999/xhtml"
> xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
>
>and to keep those namespaces from being repeated in the result:
> exclude-result-prefixes="h lenya"
>
>
>> >
>>
>>
>
>Then, the templates need to be slightly adjusted:
>
>
>
>> <xsl:template match="h:p">
>>
>>
>...
>
>
>> <xsl:template match="h:meta">
>>
>>
>...
>
>
>> <xsl:template match="h:s1">
>>
>>
>...
>And an empty template:
> <xsl:template match="lenya:meta" />
>
>Should work...
>
>HTH!
>
>Greetz,
>
>Andreas
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: fop with lenya: how can I suppress the in a created pdf
Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Sascha Teifke [mailto:mailinglist@teifke.de]
>
Hi,
(*sigh*... Glen's right, you know. Question is actually more suited for
Mulberry, but here we go anyway...)
Normally, to keep the lenya:meta element from appearing in the ouput, all
you need to do is add an empty template like so:
<xsl:template match="lenya:meta"
xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" />
However, you will still run into trouble, since your source document is in
the XHTML namespace, and you only have templates for nodes that are in no
namespace...
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
You want to add these bindings:
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
and to keep those namespaces from being repeated in the result:
exclude-result-prefixes="h lenya"
> >
Then, the templates need to be slightly adjusted:
> <xsl:template match="h:p">
...
> <xsl:template match="h:meta">
...
> <xsl:template match="h:s1">
...
And an empty template:
<xsl:template match="lenya:meta" />
Should work...
HTH!
Greetz,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org