Author: pfrields
Update of /cvs/docs/release-notes/devel/xmlbeats
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25971
Modified Files:
xmlfix
Log Message:
Fix xmlfix script (somewhat) to do better replacement of IDs
Index: xmlfix
===================================================================
RCS file: /cvs/docs/release-notes/devel/xmlbeats/xmlfix,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xmlfix 24 Sep 2006 20:00:54 -0000 1.1
+++ xmlfix 3 Apr 2007 03:17:52 -0000 1.2
@@ -35,13 +35,13 @@
mkdir -p Fixed/ || ( echo "Couldn't make a directory here" && exit
1 )
for i in $BEATDIR/*; do
- OUTXML="$(basename "$i").xml"
+ OUTXML="Fixed/$(basename "$i").xml"
eval "$XMLFORMAT -f $XMLFORMATCONF ${i} > $OUTXML"
sed -i 's@<\(/\)\?article>@<\1section>@' $OUTXML
sed -i 's@<!DOCTYPE article@<!DOCTYPE section@' $OUTXML
# Yes this is hacky. So sue me.
- sed -i "s@^<section@<section id=\"sn-${i}\"@" $OUTXML
+ sed -i "s@^<section@<section
id=\"sn-${i//${BEATDIR}\//}\"@" $OUTXML
NEWTITLE=$(grep 'RAW HTML:' $OUTXML | sed
's@.\+<h2>\([^<]\+\).\+@\1(a)')
sed -i "s@^ <title>.\+@ <title>${NEWTITLE}</title>@"
$OUTXML
done
Show replies by date