I need to comment single/multiple lines from XML file.
How can i comment using (<-- and -->) , if i want to comment <dependency> tag (allthe 6 lines) and for <groupId> tag (only one line)
Can any one help me in this .... ?
Thanks in advance ....
Do you want to comment out the contents of the field, or the start and end tags too?
If the file is regularly formatted, the sed scripts by Annihilannic will work (perhaps with some minor modifications if you want to keep the start and end tags and just comment out the contents). If the file is free-form, perhaps you should look into XSLT.
it works for a file where the start tags are unique... but wht if the tags are same?
something like the one as below and i hv 2 comment tag with content mno?
<Service>
<name>abc</name>
</Service>
<Service>
<name>mno</name>
</Service>
<Service>
<name>xyz</name>
</Service>
That's a much simpler problem than the original question; you know exactly what you're searching for so it's just a search and replace. What have you tried and in what way did it fail?