|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: adding markup to tables that have none?
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








