RE: [xep-support] Merge XML files before generating PDF

From: Jerry Janofsky <JanofskyJ@comcast.net>
Date: Tue Jan 23 2007 - 06:50:38 PST

Chris,

You can use xi:include with an href="locationOfYourXmlDocument". This will
work if your included XML doc has exactly what you want to include. It can't
have anything such as "<?xml version="1.0" encoding="UTF-8"?>" on the top or
that will get included also. It must have only the definition of the node
you are importing.

This, however, is not realistic for most existing XML documents. If that is
your case, you can use XPointer to extract only the node you want from the
included document. I am doing that exactly. I've included the template that
I am using below. It is a little difficult to read but I think you will get
the idea.

Jerry J

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
    xmlns:i="http://apache.org/cocoon/include/1.0"
        xmlns:xi="http://www.w3.org/2001/XInclude">
    <xsl:template match="IncludeSection">

<xi:include>
  <xsl:attribute name="href">
    <xsl:value-of
select="@src"/>#xmlns(fo=http://www.w3.org/1999/XSL/Format)xpointer(//fo:flo
w[@flow-name='xsl-region-body']/*)</xsl:attribute>
   </xi:include>

    </xsl:template>
</xsl:stylesheet>

-----Original Message-----
From: owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com]
On Behalf Of Chris Chiasson
Sent: Tuesday, January 23, 2007 8:52 AM
To: xep-support@renderx.com
Subject: Re: [xep-support] Merge XML files before generating PDF

xi:include?

On 1/23/07, Stralka, Mark [JANUS] <MStralk2@janus.jnj.com> wrote:
>
>
> Hi,
>
> We have the requirement to combine several XML documents into one large
XML
> document before generating a PDF. Can any please provide a good example
of
> how to combine several XML files into one larger XML document using DOM,
> Sax, or any other java XML technology? Ideally, these XML documents will
be
> pulled down from URLs, not just the file system.
>
> Thank you
>
> Mark Stralka
>

-- 
http://chris.chiasson.name/
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/terms-of-service.html
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Tue Jan 23 07:03:31 2007

This archive was generated by hypermail 2.1.8 : Tue Jan 23 2007 - 07:03:31 PST