RE: [xsl] MERGING 2 XML DOCS WITH dom4j parser

Subject: RE: [xsl] MERGING 2 XML DOCS WITH dom4j parser
From: Lea Allison <Lea.Allison@xxxxxxxxxxxxxx>
Date: Thu, 21 Mar 2002 11:21:39 +0100
The importedDoc content is processed by a call-template named stylesheet,
which appears not to apply to my $importedDoc file for some reason?



-----Original Message-----
From: Oleg Tkachenko [mailto:olegt@xxxxxxxxxxxxx]
Sent: Thursday 21 March 2002 11:02
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] MERGING 2 XML DOCS WITH dom4j parser


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

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread