Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] removing excess XML tags
From: Francois Mauger (mauger_at_[hidden])
Date: 2009-02-06 10:49:31


Hi Paul,

Maybe some sed script could help:

Hint (Sorry, I'm not a sed guru!):

cat file.xml | sed \
  -e '/^<!DOCTYPE boost_serialization>$/d' \
  -e '/^<boost_serialization .*>$/d' \
  -e '/^<\/boost_serialization>$/d' \
  -e 's/ class_id="[[:digit:]]*"//g' \
  -e 's/ version="[[:digit:]]*"//g' \
  -e 's/ tracking_level="[[:digit:]]*"//g'

With this small test XML file:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="5">
<MYTAG class_id="0" tracking_level="0" version="0"></MYTAG>
<YOURTAG class_id="0" tracking_level="0" version="0"></YOURTAG>
<ATAG class_id="0" tracking_level="0" version="0"></ATAG>
</boost_serialization>

I get:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MYTAG></MYTAG>
<YOURTAG></YOURTAG>
<ATAG></ATAG>

Not exhaustively tested I'm afraid, but hope it can help.

regards

frc

-- 
François Mauger
Département de Physique - Université de Caen Basse-Normandie

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net