Which XML parser to use?

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Which XML parser to use?

Postby Gaal » Wed Aug 23, 2006 17:39

Spannerman, in an other topic, wrote:Anyway, while we are on the subject, could anyone recommend a parser out of XercesParser, ExpatParser, LibxmlParser or TinyXMLParser?


While I was looking for the possibility of splitting the huge .looknfeel into several xml files containing only one widget each (but this is another subject of discussion) I found this site http://lists.gnu.org/archive/html/lmi/2005-08/msg00013.html
which gives some advice among the different well known xml parsers.

This might help you to choose which one to use for your case.

Cheers
Last edited by Gaal on Wed Aug 23, 2006 21:08, edited 1 time in total.

User avatar
Levia
Quite a regular
Quite a regular
Posts: 83
Joined: Mon May 22, 2006 18:25
Location: Bergen op zoom, The Netherlands
Contact:

Postby Levia » Wed Aug 23, 2006 19:30

I personally like Expat. Ive had problems with tinyXML earlier so thats why I switched in the first place, Expat is working fine (in CEGUI ofc)
Image
Image

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Postby spannerman » Wed Aug 23, 2006 20:24

Cool, thanks for posting the link Gaal :)

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Postby Van » Wed Aug 23, 2006 22:59

Ditto - Expat here.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Thu Aug 24, 2006 07:37

yeah... expat, there's a reason it's the default

User avatar
Dalfy
CEGUI Team (Retired)
Posts: 130
Joined: Tue Oct 11, 2005 16:13
Location: Paris, FRANCE
Contact:

Postby Dalfy » Thu Aug 24, 2006 08:35

I would not reply a single answer but the following : Xerces during the development stage of the product and Expat in production.


I really like Expat and it is perfectly adapted to CEGUI. But it will not report any error which can be a loss of time while creating a product.


PS: The use of SVN Trunk is highly recommanded for Xerces.

PS2: Lindquist Expat is not the default under linux: The parser are orderer the following in linux : Xerces, Libxml, expat, tiny.

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Postby Gaal » Thu Aug 24, 2006 17:28

I used to use tiny with no problem up to CeGUI 0.5.0RC2
The problem I am encountering now is for the special french letters which are displayed now with two digits (space + other strange letter).
I tried another encoding when saving the layout, (occidental windows encoding instead of UTF8), but tiny seems to stop parsing the xml file when reading "ç" (C cédille !) and ignores the following windows.

So I tried Expat, but this one stops at the first "Comment" in the layout returning an Exception. (Which tiny doesn't!)

I tried Xerces, but it also fails argueing that the xml file is not well formed ! LOL!

So, for the moment, I came back to tiny...

User avatar
Dalfy
CEGUI Team (Retired)
Posts: 130
Joined: Tue Oct 11, 2005 16:13
Location: Paris, FRANCE
Contact:

Postby Dalfy » Thu Aug 24, 2006 19:45

Could you send me by mail a layout that cause trouble ?

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Postby Gaal » Fri Aug 25, 2006 22:42

Thanks Dalfy, but I solved my problem.
I had to put the first line as this :
<?xml version="1.0" encoding="windows-1252" ?>
I did not need it with the 0.4.x
I thing this is due to the removal of all the UTF8 cast.

Never mind, this works for the moment. I will investigate a little bit. I will let you know if I find something interesting. LOL

Looking forward to hearing of release 0.5.0

User avatar
Dalfy
CEGUI Team (Retired)
Posts: 130
Joined: Tue Oct 11, 2005 16:13
Location: Paris, FRANCE
Contact:

Postby Dalfy » Sat Aug 26, 2006 09:08

Utf8 cast are done in 0.5 we enforce the parsing of the document using UTF-8 are you sure your document was really saved using UTF8 encoding ?

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Postby Gaal » Sat Sep 02, 2006 18:16

I appologize for the delay, but I was on vacation those last days...some more rest before the rush of the end of the year...

I use VS2003 to edit my xml files and I customized it to save in "UTF8-sans signature code page 65001" but may be I should try "avec signature" ???
I will try when I have some time...

I already tried to save in "Europe occidental windows code page 1252", it worked with CeGUI, but when I edit the file again with VS, every "éàç" are transformed (visualised) with some "squares"!
This decided me to save in "UTF8" but to add the code page 1252 in the encoding parameter in the first line. ! :roll: It's a strange mix ! but it works for the moment.

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Postby Gaal » Tue Sep 05, 2006 03:57

I have done some investigations and I would like to draw your attention to the CeGUI-tinyXML-0.5.0RC2 code, because it does not work properly in UTF-8 with "french" letters like "éèçà"

CeGUI-Expat works perfectly. But be sure you save the file with UTF-8 encoding, otherwise you will have an exception !
I use Visual Studio 2003 and I precise : encoding="UTF-8"

Please try this little layout with tinyXML, then Expat and look at the difference :

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<GUILayout>
    <!-- Fenêtre de test avec des lettres françaises -->
   <Window Type="TaharezLook/FrameWindow" Name="Test/Window">
      <Property Name="UnifiedPosition"   Value="{{0.5,-300},{0.5,-100}}" />
      <Property Name="UnifiedSize"      Value="{{0,600},{0,200}}" />
      <Property Name="CloseButtonEnabled" Value="true" />
      <Property Name="DragMovingEnabled"   Value="true" />
      <Property Name="SizingEnabled"      Value="true" />
      <Property Name="AlwaysOnTop"      Value="false" />
      <Property Name="FrameEnabled"      Value="true" />
      <Property Name="Alpha"            Value="1" />
      <Property Name="Text"            Value=" Test du français (UTF-8)" />
      
      <Window Type="TaharezLook/StaticText"   Name="Test/StaticText">
         <Property Name="UnifiedPosition"   Value="{{0,0},{0,0}}" />
         <Property Name="UnifiedSize"      Value="{{1,0},{1,0}}" />
         <Property Name="FrameEnabled"      Value="False" />
         <Property Name="BackgroundEnabled"   Value="False" />
         <Property Name="Text" Value=" Test : éèàçêôÔÊË" />
      </Window>
         
   </Window>
</GUILayout>


hope that will help some one


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests