I have to update extensions.rdf, in mozilla fire fox, but when i open it on remote machine it shows data in horizontal lines, but if i copy this data by control-c and paste it somewhere, it looks like below. If i am saving this data, and running my script, then script is working. If data is in horizontal lines then also my script works, but all the lines misplaces, in extensions.rdf.

<?xml version="1.0"?>
<RDF:RDF xmlns:NS1="http://www.mozilla.org/2004/em-rdf#"
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Description RDF:about="rdf:#$BLu3w3"
NS1:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
NS1:minVersion="3.5.3"
NS1:maxVersion="3.5.3" />
<RDF:Seq RDF:about="urn:mozilla:item:root">
<RDF:li RDF:resource="urn:mozilla:item:{972ce4c6-7e08-4474-a285-3208198ce6fd}"/>
</RDF:Seq>
<RDF:Description RDF:about="urn:mozilla:item:{972ce4c6-7e08-4474-a285-3208198ce6fd}"
NS1:installLocation="app-global"
NS1:version="3.5.3"
NS1:internalName="classic/1.0"
NS1:locked="true"
NS1:appManaged="true"
NS1:name="Default"
NS1:description="The default theme."
NS1:creator="Mozilla"
NS1:contributor="Mozilla Contributors">
<NS1:type NC:parseType="Integer">4</NS1:type>
<NS1:targetApplication RDF:resource="rdf:#$BLu3w3"/>
</RDF:Description>
</RDF:RDF>
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Since it looks very much like a normal XML file, you could try the MS XML parser object to make changes to it. While it isn't exactly easy, it's the best way. Using normal text editing code to manipulate it is the road to oblivion.

There was an XML class file for VBS on the web which makes the whole thing easier. I d/l and edited it to suit my purposes but I couldn't tell you where I got it from, I'm afraid: it was a long while ago.

Lastly, note that the parser is *very* picky about well-formed XML - it might baulk at adding an attribute, for example - so make sure the original file has all its closing tags etc. in place.

EDIT:
Here's a free XML component, to make your script nice and easy: http://www.chilkatsoft.com/xml-activex.asp
Answered 09/17/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity