[xep-support] Merge XML files before generating PDF

Jerry Janofsky JanofskyJ at comcast.net
Tue Jan 23 06:50:38 PST 2007


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 at renderx.com [mailto:owner-xep-support at renderx.com]
On Behalf Of Chris Chiasson
Sent: Tuesday, January 23, 2007 8:52 AM
To: xep-support at renderx.com
Subject: Re: [xep-support] Merge XML files before generating PDF

xi:include?

On 1/23/07, Stralka, Mark [JANUS] <MStralk2 at 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 at 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 at 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



More information about the Xep-support mailing list