From: Marcus P. <mar...@ho...> - 2004-05-06 07:19:17
|
Hi, I'm trying to insert one XML tag into a Visual Studio project file, using XmlStarlet (0.9.1 Win32 binaries), and my problem is that I can't get XmlStarlet to preserve the original formatting (that's what the -P and -S options are for, right?). Example: $ (echo "<a"; echo " foo='1'>"; echo "</a>") <a foo='1'> </a> $ (echo "<a"; echo " foo='1'>"; echo "</a>") | xml ed -P -S -O -i /a -t attr -n bar -v 2 <a foo="1" bar="2"> </a> So as you see, XmlStarlet puts all the attributes of the "a" -tag on the same line. The real problem is, that VS stores multi-line values in it's configuration file, and XmlStarlet removes newlines from the attribute value. Example: $ (echo "<a foo=\"1"; echo "2..\">"; echo "</a>") <a foo="1 2.."> </a> $ (echo "<a foo=\"1"; echo "2..\">"; echo "</a>") | xml ed -P -S -O -i /a -t attr -n bar -v 2 <a foo="1 2.." bar="2"> </a> Any ideas? Best regards, -Marcus. email: marcus_picasso at hotmail dot com _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 |