Subject: RE: [xsl] Expanding Tabs From: "Mario Madunic" <Mario_Madunic@xxxxxxxxxxxx> Date: Tue, 30 Mar 2010 07:47:31 -0500 |
Alex, Don't know if this will help but here are a couple of suggestions from my experience. I've done quite a bit of this in the past and have found preprocessing using ANT helps a lot before applying XSLTs. Using the filterchain/tokenfilter/replaceregex tasks has made working with text files easier. Hopefully you have at your disposal a tool similar to ANT. Second is using a step process when applying templates and grouping things together. In other words break down what you need down to small steps and parse your content through each step till you are happy with the result, then move onto the next. It's not elegant but have found it gets the job done and quite easy to maintain if other rules need to be applied. Marijan (Mario) Madunic Publishing Specialist New Flyer Industries -----Original Message----- From: Alex Muir [mailto:alex.g.muir@xxxxxxxxx] Sent: Tuesday, March 30, 2010 7:30 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Expanding Tabs Okay I see, What I'm doing is converting old text documents into XML. I feel like the string length and position of the text is important given there are tables represented in the text, section titles, subsection titles, lists, footnotes, paragraphs,, new pages... The length of a line, how much text follows one line to the next, blank lines, the space between table columns will all be relevant for determining what is what in the document and surrounding content with xml tags. I'll be using regex and analyze string for the majority of the process so it may be that white space in general is all I need to match on however it seemed that line length and position of text will be relevant and so wanted to have every tab expanded to have the same number of space so that counts are accurate,,, perhaps the logic would have been easier for some aspects with expanded tabs. Will see Regards Alex On Mon, Mar 29, 2010 at 10:58 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote: >> >> I did come across something of interest when searching for >> xsl expand tabs... in the XSL Working Draft 16-December-1998: >> http://www.w3.org/TR/1998/WD-xsl-19981216#expand-tabs >> > > That's in the part of the spec that became XSL Formatting objects. > > This all raises the question of what you are trying to achieve. Generally, > if your final output is HTML or XSL-FO, then replacing tabs by spaces isn't > a very useful thing to do. It's not likely to be useful for most XML > vocabularies either. I'm not sure it's all that useful even if you are > producing old-fashioned ASCII text in a fixed-width font (like this email), > unless whoever typed the text knows the old UNIX rules and used a text > editor that respects them. > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > > -- Alex https://sites.google.com/a/utg.edu.gm/alex Some Good Music http://sites.google.com/site/greigconteh/ -------------------------------------------------------------------- Please consider the environment before printing this e-mail. CONFIDENTIALITY STATEMENT: This communication (and any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmission, circulation, distribution, reproduction, conversion to hard copy, copying or other use of this communication, information or material is strictly prohibited and may be illegal. If you received this communication in error or if it is forwarded to you without the express authorization of New Flyer, please notify us immediately by telephone or by return email and permanently delete the communication, information and material from any computer, disk drive, diskette or other storage device or media. Thank you.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Expanding Tabs, Alex Muir | Thread | RE: [xsl] Expanding Tabs, Michael Kay |
RE: [xsl] question on variable defi, Hermann Stamm-Wilbra | Date | RE: [xsl] Expanding Tabs, Michael Kay |
Month |