NAME=Joe & Freds
CLASS=Cafe
into xsl attribute lists, like this:
name="Joe & Freds" class="Cafe"
ready to be stuck in the middle of a tag.
sed -e '
/=/{ # make sure it has an = sign in
h # save current line
s/=.*/=/
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
x # get back original line
s/^[^=]*=// # loose attribute name
/./{ # anything left?
s/&/&/
s/"/"/
s/</</
s/>/>/
s/^/"/;
s/$/"/;
H #append to stored line
x # get it all back
s/\n//
p
}
d
}
d
'
No comments:
Post a Comment