Recent

Author Topic: Error parsing XML using TXMLDocument  (Read 6522 times)

@nton

  • New Member
  • *
  • Posts: 10
Error parsing XML using TXMLDocument
« on: July 16, 2012, 12:47:44 pm »
I try to open an XML file generated by STARUML to find some information stored inside.
(the file is attached)

I followed the XML tutorial from the WIKI and came up with the following code (abbreviated):


uses laz2_XMLRead, laz2_DOM

var
   BCMDocument : TXMLDocument;
   
     try
         ReadXMLFile(BCMDocument, edtBCMBestand.Text);
         {Do Something}
     finally
        BCMDocument.Free;
     end;

the statement: ReadXMLFile(BCMDocument, edtBCMBestand.Text); gives the following error:

In 'file:///C:/ TestStarUMLProject.uml' (Line 39 Pos 65) Invalid character.

The file opens fine in Firefox, Explorer and in the lazarus IDE.
Other tools seem not to have any problems with this file.

I can't see any invalid characters

Am I missing something, is it a Bug?

Please Help!
Lazarus 1.26 32 bit, FPC 2.64, Windows 7, ZEOS 7.1.4

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Error parsing XML using TXMLDocument
« Reply #1 on: July 16, 2012, 02:09:48 pm »
Update your lazarus, it works in recent revision.

@nton

  • New Member
  • *
  • Posts: 10
Re: Error parsing XML using TXMLDocument
« Reply #2 on: July 16, 2012, 02:34:35 pm »
Currently I am using v0.9.30.4 with fpc 2.6.0. On Windows XP.
Isn't that the latest?
Lazarus 1.26 32 bit, FPC 2.64, Windows 7, ZEOS 7.1.4

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Error parsing XML using TXMLDocument
« Reply #3 on: July 16, 2012, 02:37:07 pm »
I mean, daily snapshot/svn version.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Error parsing XML using TXMLDocument
« Reply #4 on: July 16, 2012, 02:37:39 pm »
Perhaps the latest released "stable" version. Unfortunately it's a long way behind with bug fixes etc.

While a new Lazarus release is being worked on, I'd suggest downloading and installing a Lazarus + fpc 2.6.1 win32 Daily Snapshot (see link to left)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

@nton

  • New Member
  • *
  • Posts: 10
Re: Error parsing XML using TXMLDocument
« Reply #5 on: July 16, 2012, 05:48:49 pm »
Thanks Leledumbo and BigChimp!

It works!

Lazarus is also a lot faster (compliments!)
Lazarus 1.26 32 bit, FPC 2.64, Windows 7, ZEOS 7.1.4

 

TinyPortal © 2005-2018