[prev in list] [next in list] [prev in thread] [next in thread]
List: lyx-users
Subject: Re: Progress on the MS Word to LyX conversion (xml)
From: Richard heck <rgheck () bobjweil ! com>
Date: 2008-07-24 1:08:52
Message-ID: 4887D624.7010508 () bobjweil ! com
[Download RAW message or body]
Steve Litt wrote:
> On Wednesday 23 July 2008 07:00, José Matos wrote:
>
>> XML will not change the current status.
>>
>> grep '<style name="Section"' somefile.lyx
>>
>> will still work and it not so different from what we have now. You need the
>> '' already if you have spaces in your expression...
>>
>
> The trouble is, XML tags can be anywhere -- spacing and linefeeds are
> immaterial. That means you can no longer parse based on position, such as:
>
> /^begin_layout/
>
> because technically the whole XML file could be in a single line. Or a single
> tag could be split between lines.
>
>
True of course, but in fact the file is likely to be nicely formatted.
rh
> This problem is somewhat lessened by the fact that you could do the following
> in Vim/ex:
>
> :%s/</\r</g
> :%s/>/>\r/g
> :g/^\s*$/d
>
> I imagine you could do the same thing with sed, I just don't know how. The
> preceding would put every XML tag on its own line, and eliminate all blank
> lines, after which you could indeed parse based on linefeeds. The other
> problem, of course, is that angle brackets within the text would be linefed,
> which may or may not be a problem depending on the XML dialect you come up
> with.
>
> SteveT
>
> Steve Litt
> Recession Relief Package
> http://www.recession-relief.US
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic