Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002652 [JEDI VCL] 00 JVCL Components major always 2005-02-17 16:30 2005-02-19 06:17
Reporter jeges View Status public  
Assigned To user72
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0002652: TJvSimpleXml namespace problem at end tag
Description Hello!

I have used this component to parse an xml file that I got from the Java
standard xml creator. I encountered a problem parsing the following types
of xml elements:


The TJvSimpleXml component only accepts the following type of tags:

IMHO the first form should be valid, based on the Java generated xmls.
Additional Information
Tags No tags attached.
Attached Files ? file icon JvSimpleXml_good.pas [^] (91,055 bytes) 2005-02-18 09:24

- Relationships

-  Notes
2005-02-18 01:38

It is a bug. Try commenting out the ':' case handler in TJvSimpleXMLElemClassic.LoadFromStream and see if that resolves it.

NB! Not tested extensively, so might have other, unknown, negative side-effects
jeges (reporter)
2005-02-18 11:06

I worked on it today and it looks like I solved the problem. I attached the file to the issue. I noticed that, when creating the xml stream it doesn't adds the namespaces (called pointers in the code) also. If you find it useful and solid commit it in. Diffs:
- TJvSimpleXMLElemClassic.SaveToStream adds the (namespace + ':') characters before tagname
- TJvSimpleXMLElems.LoadFromStream saves in a local variable the namespace and when the tag is finished it returns (namespace + ':' + tagname) to TJvSimpleXMLElemClassic.LoadFromStream
- TJvSimpleXMLElemClassic.LoadFromStream validates the returned end tag namespace and tagname to the elements namespace and tagname

That's all.

PS. Sorry about the double attachment. I couldn't delete the first, which was an older "under construction" version sadly uploaded. The file containing the solution is the "JvSimpleXml_good.pas" which should be of course renamed to "JvSimpleXml.pas". If you have the rights please delete the old one :)
2005-02-19 05:13

Have you tested your changes with xml files that doesn't have namespace prefixed tags? I suspect not.
2005-02-19 06:17

A slightly modified version has been posted to CVS where the value of the prefix is checked before adding the ':'. Also includes a fix for CDATA sections that has white space between the CDATA and the last [. This is allowed.

- Issue History
Date Modified Username Field Change
2005-02-17 16:30 jeges New Issue
2005-02-17 17:04 jeges Issue Monitored: jeges
2005-02-18 01:38 user72 Note Added: 0006512
2005-02-18 01:38 user72 Status new => feedback
2005-02-18 08:57 anonymous File Added: JvSimpleXml.pas
2005-02-18 09:24 anonymous File Added: JvSimpleXml_good.pas
2005-02-18 09:32 anonymous Note Added: 0006519
2005-02-18 09:37 jeges Note Added: 0006520
2005-02-18 11:06 anonymous Note Deleted: 0006519
2005-02-18 11:06 jeges Note Added: 0006523
2005-02-18 11:08 jeges Note Deleted: 0006520
2005-02-19 05:03 user72 File Deleted: JvSimpleXml.pas
2005-02-19 05:13 user72 Note Added: 0006524
2005-02-19 06:17 user72 Status feedback => resolved
2005-02-19 06:17 user72 Resolution open => fixed
2005-02-19 06:17 user72 Assigned To => user72
2005-02-19 06:17 user72 Note Added: 0006527

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker