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

RE: adding markup to tables that have none?

  • To: "'Michael Kay'" <mike@s...>, xml-dev@l...
  • Subject: RE: adding markup to tables that have none?
  • From: "DuCharme, Bob (LNG-CHO)" <bob.ducharme@l...>
  • Date: Tue, 19 Apr 2005 12:54:36 -0400

sales mark up table
That would be easy enough in perl and python as well, but it wouldn't do well at inferring blank entries, while something that determines column boundaries based on the position of the one's digit in each entry could.
 
I guess any algorithm would then lead to mention of special cases that it doesn't handle, but this is a start. Thanks!
 
Bob


From: Michael Kay [mailto:mike@s...]
Sent: Tuesday, April 19, 2005 12:34 PM
To: 'DuCharme, Bob (LNG-CHO)'; xml-dev@l...
Subject: RE: adding markup to tables that have none?

Use XSLT 2.0:
 
<xsl:for-each select="tokenize(unparsed-text($input-file), '\n')">
  <tr>
    <xsl:variable name="regex">(.{5})(.{10})(.{12})(.{3})</xsl:variable
    <xsl:analyze-string select="." regex="$regex">
      <xsl:matching-substring>
       <xsl:for-each select="1 to 4">
         <td><xsl:value-of select="regex-group(.)"/></td>
       </
     </
    </
   </tr>
</xsl:for-each>
 
Michael Kay


From: DuCharme, Bob (LNG-CHO) [mailto:bob.ducharme@l...]
Sent: 19 April 2005 17:23
To: 'xml-dev@l...'
Subject: adding markup to tables that have none?

This is a tough problem, but it's as old as the use of markup in data files, so I'm sure others have tackled it. When you have a table in which all layout is achieved using spacing (which of course requires the use of a fixed-width font) and you want to add HTML or CALS table markup that identifies row and table entry boundaries, what kinds of tools are out there besides importing to Excel and saving as XML?
 
I know that such tools would only work with simpler tables, because spanned entries, wrapped entries, and other fancy table tricks would cause problems, but I thought that there must be something out there, and I can't find anything. Any suggestions?
 
thanks,
 
Bob
 
 

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.