Newbie - Dynamic data in .fo file
Hi all, I need to pick data for my .fo file from another xml. How do I do this? Do I need to transform it again? I have searched the mailing list but cant seem to find the answer (maybe using wrong keywords, dynamic data ??). BTW, Why is there no fop user mailing list at mail-archive? Its search engine seems far better than the one at MARC. TIA, Vikram
Re: Newbie - Dynamic data in .fo file
Hi, Did you try something like document('urltoyourxmlfile') in your fo file? This should insert your xml doc into your fo file ... - Original Message - From: Vikram Goyal01 To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 10:21 AM Subject: Newbie - Dynamic data in .fo file Hi all,I need to pick data for my .fo file from another xml. How do I do this? Do I need to transform it again?I have searched the mailing list but cant seem to find the answer (maybe using wrong keywords, dynamic data ??).BTW,Why is there no fop user mailing list at mail-archive? Its search engine seems far better than the one at MARC.TIA,Vikram
Re: Newbie - Dynamic data in .fo file
You can improve the use of the document() function if you do something like that: document('urltoyourxmlfile')/mystuff/entry[position() = 3]/text which basically means that you can append an XPath statement to further restrict the content to be included. I use this to include language dependant textblocks. If you wrap the result using node-set() function (See Xalan documentation) you can even apply templates from your stylesheet to it. Thanks for your reply. The problem is that I need to replace certain place holders in my .fo file with corresponding tags in the xml file. I dont need to dump the whole xml file in the fo file. For eg: To: replace with Client Name is in the fo file, and the client name is in the xml file as a tag. Cheers, Jeremias Märki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Tel. +41 41 317 2020 - Fax +41 41 317 2029 Internet http://www.outline.ch
Re: Newbie - Dynamic data in .fo file
Jeremias Maerki wrote: document('urltoyourxmlfile')/mystuff/entry[position() = 3]/text ... If you wrap the result using node-set() function (See Xalan documentation) you can even apply templates from your stylesheet to it. No need for doing this: xsl:apply-templates select=document('urltoyourxmlfile' )/mystuff/entry[position() = 3]/text/ works. You can even do xsl:variable name=mystuff select=document('urltoyourxmlfile')/mystuff/ ... xsl:value-of select=$mystuff/entry[position() = 3]/text/ or whatever. Using keys to select stuff from $mystuff is a bit trickier. Questions about details should be sent to the XSL list http://www.mulberrytech.com/xsl/xsl-list/ J.Pietschmann