This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Call-Template confusion


Hello all
I'm trying to transform an input XML doc to an internal format my company 
uses, and I have a couple of questions.  Thanks in advance for any help-I 
want this to turn out well; I'm told my company had a disastrous introduction 
to XML, and they are now suspicious of all things XML.
First off
The input XML docs arrive with a document type declaration, so  to transform 
them (we don't care about their validity-that will have been done before they 
reach us by the client), must the processor (xt) have access to the dtd?  (It 
is a 97 page monster, and I'm afraid that validating against it (or whatever 
xt might need it for) will slow transformations, and give the anti-XML 
element in the company ammunition) .  If it must, is there a way to write a 
micro-dtd, just a few lines, which more-or-less says "Everything is 
permitted" and give it the same name as the monster?
Finally
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@hotmail.com



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]