This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: MERGING 2 XML DOCS WITH dom4j parser
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 21 Mar 2002 12:01:51 +0200
- Subject: Re: [xsl] MERGING 2 XML DOCS WITH dom4j parser
- Organization: Multiconn International
- References: <A81889A49303D611871C00A024513E932FFEF5@virgin_6>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Lea Allison wrote:
> The problem I find with this method, is that by using a parameter / variable
> to import the second document I have to use a for-each loop with the
> $importedDoc to be able to apply the templates to this data.
Why not just <xsl:apply-templates select="$importedDoc/*"/> ?
>
> Secondly, if I view the outputed XML from the stylesheet, it only shows the
> first document. The 2nd doc in the param does not show.
What do you mean by "I view outputed XML from the stylesheet" ?
> Actually it would be ideal to get two combined documents returned to the
> users browser as XML. ie.
>
> <DOCUMENT>
> <DOC1>
> <CONFIGINFO />
> </DOC1>
>
> <H>Main document</H>
> <P>Hello world</P>
> </DOCUMENT>
>
> Where DOC1 would be the 2nd documented added to the first.
>
> There is also another problem. The imported document is not always the same.
> I vary the document based on language, so I need to dynamically name the
> imported document.
Pass its name as parameter too.
<DOCUMENT>
<xsl:element name="{$imported-doc-name}">
<!-- Process imported doc -->
<xsl:apply-templates select="$imported-doc" mode="imported"/>
<xsl:element>
<!-- Process main doc -->
<xsl:apply-templates/>
</DOCUMENT>
--
Oleg Tkachenko
Multiconn International, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list