[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Markup from HTML
From: |
Gilles Sadowski |
Subject: |
Re: Markup from HTML |
Date: |
Thu, 22 Jan 2009 17:11:18 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello.
>> does anyone of you have a script or a way to convert from (simple)
>> html to markup like this:
>>
>> This is a me<b><i>lis</i></b>ma.
>>
>> To get:
>>
>> \markup { "This is a " \concat { "me" \bold \italic "lis" "ma." } }
>>
>
> sed would do the job, but I'm too hazy on it to offer a solution.
Depending on how complex the input may be, XSL might be a more powerful
approach (but it takes quite some effort to get used to it!).
Here attached is an XSL script that can serve as a starting point.
Used as
$ xsltproc htm2txt.xsl in.htm
You'll get
\markup { \concat { "This is a me"\bold { \concat { \italic { \concat { "lis"
} } } }"ma." } }
[I couldn't test the output as I don't have a \concat in \version 2.10.]
Best,
Gilles
htm2txt.xsl
Description: application/xml
This is a melisma.