On Fri, 23 Jul 2004, Michael Kay wrote:
This kind of thing is very much easier using XSLT 2.0
* use the unparsed-text() function to read the text file
* split it into individual lines using the tokenize() function
* parse each line using xsl:analyze-string
* arrange it into a hierarchical structure using xsl:for-each-group
You know, I think you may just have offered a light into an alternate from
perl maintenance hell. :) OK, it's as well-behaved as perl gets, but I
just can't think in that language.
Right now, I'm using a variant of this perl script:
http://www.extraneous.org/wiki/ProseML_text2chapter.pl
But it seems that the .txt -> .xml translation *could* be done with XSLT
2.0 given your above statement.
--
_Deirdre web: http://deirdre.net blog: http://deirdre.org/blog/
"Memes are a hoax! Pass it on!"