This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Antwort: Re: Antwort: Re: two xml source documents
- From: Markus dot Lehr at mlp-ag dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 5 Aug 2002 15:59:04 +0200
- Subject: Antwort: Re: Antwort: Re: [xsl] two xml source documents
- Reply-to: xsl-list at lists dot mulberrytech dot com
Ok, I tried it but it had no effect. Both XML files are in the same directory
with the stylesheet.
But is <xsl:apply-templates select="doc2/beratung/stattext"/> correct?
It simply does nothing when i referre to Testmich2.xml, for all other data from
the main XML file it works fine, there is no error message at all.
Iīm using Xalan-j 2_3_0 and fop0.20.1, donīt know if I have mentioned this
before.
Markus
------------------------------------------------------------------------------
Hello Markus,
are the XML files in the same directory like the stylesheet? When writing
"document ('Testmich2.xml')" the XML file is searched in the directory of
the stylesheet. If it is not there you either can specify the path:
"document ('../xml/Testmich2.xml')"
or, more elegant I think, refer to the input XML file:
"document ('Testmich2.xml', .)"
--------------------------^^^^
where '.' is the current context node and must be from this file. '/' is
also possible of course.
If this doesn't work, what's the error message?
Regards,
Joerg
Markus.Lehr@mlp-ag.com wrote:
> Hello Joerg,
> I tried your solution but there must be something I`m doing wrong. It simply
> does not acces the second xml-file...
> I got both xml-files in the same directory, so I think I donīt need to give it
a
> path, do I?
>
> Hereīs the (more or less) relevant part of the stylesheet
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:my="
> http://www.mlp-ag.com"
> xmlns:fo="http://www.w3.org/1999/XSL/Format">
>
>
> <xsl:variable name="doc2" select="document ('Testmich2.xml')"/>
>
>
> <xsl:template match="/">
>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> .....
>
> <fo:flow flow-name="xsl-region-body">
>
> <fo:table>
> <fo:table-column column-width="40mm"/>
> <fo:table-column column-width="70mm"/>
> <fo:table-column column-width="70mm"/>
> <fo:table-body>
> <fo:table-row>
> <fo:table-cell ><fo:block ></fo:block></fo:table-cell>
> <fo:table-cell ><fo:block>Beratung:</fo:block></fo:table-cell>
> <fo:table-cell> <fo:block></fo:block><fo:block><
> xsl:apply-templates
select="doc2/beratung/stattext"/></fo:block></fo:table-cell>
> </fo:table-row>
>
> </fo:table-body>
> </fo:table>
>
> </fo:flow>
> </fo:page-sequence>
>
> </fo:root>
>
> </xsl:template>
>
> and hereīs the xml-file
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="C:\Test\iftestfooter.xsl"?>
> <beratung xmlns="http://www.mlp.com" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance">
> <stattext>Sie wurden beraten von</stattext>
> </beratung>
>
> Could you please take a look at it?
--
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list