0

I want to remove extra data appended after end tag of XML. for example dffgghh My XML is of very large size.I want to read it and delete extra data if present.Please help me.

user3193015
  • 171
  • 1
  • 1
  • 3
  • split based on "tagName" . Ignore second/last part... You could also use Regex with replaceAll... You could find position of the tag and get subString upto that tag... there are several other methods as well.. Have you tried anything at all? – TheLostMind Jan 28 '14 at 08:36
  • well your parser should exclude anything that isn't canonical, or at the very least expose it as a CDATA that you can skip. what code are you using to parse the xml? – user326608 Jan 28 '14 at 08:42

1 Answers1

1

Simply read it as XML. Anything after the

</rootTag>

will be ignored automatically

If you want to clean the file itself, read it so and write back.

Gangnus
  • 24,044
  • 16
  • 90
  • 149