[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Call-Template confusion

Subject: Re: Call-Template confusion
From: "Rebecca Lundberg" <rlundberg@xxxxxxxx>
Date: Mon, 2 Oct 2000 08:51:06 -0400
damper templates
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 (&#xA;)</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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.