Subject: Re: Call-Template confusion From: "Rebecca Lundberg" <rlundberg@xxxxxxxx> Date: Mon, 2 Oct 2000 08:51:06 -0400 |
I can't answer your question regarding dtd's but maybe I can help with the text issue. I just completed a couple of projects whose output was highly formatted text. You can get your data to appear in proper order by using call-template or by matching patterns in the order you want the data to appear and having your value-of in each one. Don't know if it's the most efficient way but it works. As for text spacing, I found a few combinations that work: <xsl:text>data then your spaces and/or carriage returns (
)</xsl:text> Your value-of's can come before and after the <xsl:text>'s You can also use concat(' ', variable). I couldn't get this to work with the carriage returns within the concat. Regardless of what Michael Kay's book leads you to believe (sorry Michael) these things worked for me. It's not pretty but it works. And the stylesheet is *long* but performance is quite acceptable. A hint to help with counting spaces: figure out your font style and size before you begin: Chose a fixed width font. Then, print a page full of lines of that font with space identifiers. For example lines and lines of 123456789a123456789b. You can then hold your printed page up to your template and see exactly how many spaces you need to add or subtract. As for pagination...Look through the archives to see the things these kind folks suggested I do. Good luck! Rebecca > The result must have selected nodes converted to text, in a specific position > on its proper line (e.g., the text in node <xx> must be output to line 2, > spaces 14-50), but the text in the node may or may not occupy all the alloted > space (although if it goes over, that's Somebody Elses Problem). > I thought maybe <xsl:text> instructions containing the proper number of > spaces as well as an <xsl:value-of />, but Mike Kay's book put a damper on > that (my shortcomings are all genetic; the book rocks :>) ) . > Could a call-template be written that took two parameters (a string, and a > number) return the string with empty spaces appended to the end so that it > occupied the number of spaces specified by the number parameter? How would > such a template be written in XSLT, or is there a better way altogether? > BRIEF EXAMPLE > <a>123456789 </a> <!--<a> must occupy spaces 5 through 15, inclusive, on > line x--> > 1234567 <!--b must occupy spaces 17 through 50, inclusive, also on line > x--> > > needs to be (hyphens represent blank spaces, numbering begins at 0): > > -----123456789---1234567-------------------------- > > Thanks again > Edmund Mitchell > edmund_mitchell@xxxxxxxxxxx > > > > 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Call-Template confusion, Emitchell154 | Thread | Applying templates to Result Tree F, James Lynn |
Re: Output is incorrect..., David Carlisle | Date | Applying templates to Result Tree F, James Lynn |
Month |