 |
| XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 19th, 2007, 08:13 PM
|
|
Registered User
|
|
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
XSL:FO Querying block id tags
I have a very complicated submittal generated in XSLT + XSL:FO. There's a large number of sections and subsections, any number of which may or may not print. I'm designing the table of contents and I'm having trouble coming up with an effective way to do this. One way is to run all the logic for the sections which print again, but the logic involves calling scripts which query a DB, so this solution would drastically increase the generation time, which is big enough as it is. Is there any way at all to query if a <fo:block id=> tag has been declared?
|
|

September 20th, 2007, 08:47 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
For problems of this kind, where you want to avoid doing a computation twice, the answer is often a two-phase transformation where the first phase does the computation (or in this case the database retrieval) and stores the results in a temporary document which is accessed (repeatedly) by the next phase of processing.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

September 20th, 2007, 11:51 AM
|
|
Registered User
|
|
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I agree, it's certainly a good solution, but the submittal I've been given is over 15,000 lines of XSL code and this would call for significant restructuring, and time is a factor for me. The best solution would be if I could just test those tags for existence... As it is, I'll add extra code to the DB query script to populate a table anytime there's a result set, then query that table at the end (the TOC will now print at the end), then test it. Given this solution, can I force the TOC to always be the second page in the document, or will it always print according to it's sequence?
|
|

September 20th, 2007, 12:26 PM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
In my experience, if code needs restructuring and time is important, then you should do the restructuring.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

September 20th, 2007, 02:54 PM
|
|
Registered User
|
|
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i need the output...thats it...
its ur wish , u do in ur own way/////
please let me know
|
|
 |