This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Thu, Apr 03, 2008 at 11:01:20PM +0200, Mark Wielaard wrote:
> Hi Andrew,
>
> On Thu, 2008-04-03 at 10:39 -0400, Andrew Cagney wrote:
> > I'm not fluent in XML either, however I still managed to hack up the
> > attached (from htdocs/bugzilla). Can we do something with that?
>
> Yes, you probably could. Note that all the rest of the manpage index
> generation is done with sed. You might need to replace all of that. But
> I wouldn't put too much work into it unless you really want to. It does
> work pretty well as is now.
While I agree xslt is the proper way, I also immediately know the sed
syntax. So here goes:
/<refpurpose>/{
:loop
/<\/refpurpose>/b break
N
b loop
:break
s,^.*<refpurpose>,,
s,</refpurpose>.*$,,
s,\(^[[:space:]]*\|[[:space:]]*$\),,g
s,[[:space:]]\+, ,g
p
q
}
Save to file and use like this:
$ sed -n -f foo.sed < foo.xml
Attachment:
pgp00000.pgp
Description: PGP signature
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |