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 Johannes Franz <jo...@rub.de> on 2004/05/13 20:58:15 UTC
Merging two xml files to one.
Hi there,
i would like to do following thing:
xmlfile1.xml xmlfile2.xml -> xmlfile12.xml
fop -xml xmlfile12.xml -xsl xmlfile12.xsl -pdf output.pdf
Has someone an idea how i could do this?
Greetings,
Johannes Franz.
Re: Merging two xml files to one.
Posted by Johannes Franz <jo...@rub.de>.
Thanks very much,
i'll try this way since it seems to be the easiest to me.
----- Original Message -----
From: "Andreas L. Delmelle" <a_...@pandora.be>
To: <fo...@xml.apache.org>
Sent: Thursday, May 13, 2004 9:43 PM
Subject: RE: Merging two xml files to one.
> > -----Original Message-----
> > From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
>
> > Anyway, you can make a slight modification to your XSL
> > code, so that it does not only apply-templates to
> > the primary XML, but also to another source tree that
> > is created with the document() function.
> >
>
> Oh, before you painfully have to find out for yourself: while the URI used
> with the document function can be passed in as an xsl:param, there is
> currently no possibility of feeding this param in via the command line (No
> problem if you use FOP embedded, see the XML+XSL2PDF example on the site.
>
http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/
> ExampleXML2PDF.java?rev=HEAD)
>
> If you insist on doing it via the command line, there's still the option
of
> using something like this as primary XML:
> <root>
> <file href="xml11.xml" />
> <file href="xml12.xml" />
> ...
> </root>
>
> - and in XSLT do
>
> <xsl:variable name="merged" select="document(/root/file/@href)" />
> ...
> <xsl:apply-templates select="$merged/*">
> <xsl:sort select="..." />
> </xsl:apply-templates>
>
>
> Greetz,
>
> Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
RE: Merging two xml files to one.
Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
> Anyway, you can make a slight modification to your XSL
> code, so that it does not only apply-templates to
> the primary XML, but also to another source tree that
> is created with the document() function.
>
Oh, before you painfully have to find out for yourself: while the URI used
with the document function can be passed in as an xsl:param, there is
currently no possibility of feeding this param in via the command line (No
problem if you use FOP embedded, see the XML+XSL2PDF example on the site.
http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/
ExampleXML2PDF.java?rev=HEAD)
If you insist on doing it via the command line, there's still the option of
using something like this as primary XML:
<root>
<file href="xml11.xml" />
<file href="xml12.xml" />
...
</root>
- and in XSLT do
<xsl:variable name="merged" select="document(/root/file/@href)" />
...
<xsl:apply-templates select="$merged/*">
<xsl:sort select="..." />
</xsl:apply-templates>
Greetz,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
RE: Merging two xml files to one.
Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
> > -----Original Message-----
> > From: Johannes Franz [mailto:johannes.franz@rub.de]
> >
> > Hi there,
> > i would like to do following thing:
> >
> > xmlfile1.xml xmlfile2.xml -> xmlfile12.xml
> >
> > fop -xml xmlfile12.xml -xsl xmlfile12.xsl -pdf output.pdf
> >
> > Has someone an idea how i could do this?
>
>
> Hi,
>
> You definitely need to take a close look at XSLT. It takes only one
Sorry, obviously you're already using XSLT... Anyway, you can make a slight
modification to your XSL code, so that it does not only apply-templates to
the primary XML, but also to another source tree that is created with the
document() function.
HTH!
Cheers,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
RE: Merging two xml files to one.
Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Johannes Franz [mailto:johannes.franz@rub.de]
>
> Hi there,
> i would like to do following thing:
>
> xmlfile1.xml xmlfile2.xml -> xmlfile12.xml
>
> fop -xml xmlfile12.xml -xsl xmlfile12.xsl -pdf output.pdf
>
> Has someone an idea how i could do this?
Hi,
You definitely need to take a close look at XSLT. It takes only one XML as
(primary) input, but other ones can be loaded in effortlessly, so it's *the*
way to go here...
http://xml.apache.org/fop/resources.html#documents-xslt
HTH!
Greetz,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org