Choose style:

Author Topic: [SOLVED] editing XML files  (Read 1200 times)

0 Members and 1 Guest are viewing this topic.

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1999
  • Karma: 344
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
[SOLVED] editing XML files
« on: May 03, 2016, 06:47:11 pm »
Is there a way to edit an .xml file that has to have a massive amount all on the one line?

Code: [Select]
error on line 2 at column 478674: Encoding error

How can I find column 478674?  ??? I've tried Ultraedit and it gives up after about 4000 columns.
« Last Edit: May 04, 2016, 06:57:35 am by murraymint »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26305
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: editing XML files
« Reply #1 on: May 03, 2016, 07:15:57 pm »
Try Emacs
Code: [Select]
sudo apt-get install emacs24
it should then be available in your menus under the "Programming" submenu

or

Take a look at this
http://blog.crisp.se/2011/02/22/yassalsundman/1298373360000

it lists 2 tools for adding line breaks to large one line xml files, or options to chop them into smaller chuncks .. xmllint should already be installed, and xml-twig-tools is in the repos.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1999
  • Karma: 344
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: editing XML files
« Reply #2 on: May 03, 2016, 08:17:40 pm »
Thanks, those look promising but now I'm getting
Code: [Select]
parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xEF 0xBF 0x31 0x2F

and those tools won't process the file. It seems to be because there's a French accented character in there. I can live without those, is there any way I can force-convert the whole thing to "proper UTF-8"?

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1999
  • Karma: 344
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: [SOLVED] editing XML files
« Reply #3 on: May 04, 2016, 06:58:30 am »
OK, it was easy enough to manually deFrenchify. After some sleep I can see the other stupid mistake that's making it not work, so I'll regenerate the thing properly and it should be fine.