Solved

[XML] Delphi 7 XML Data Binding is flawed?

Posted on 2003-11-19
4
1,514 Views
Last Modified: 2013-11-19
Okay, I wonder if there are more problems with the XML Data Binding wizard than the ones I found. I found that:
1) Adding child nodes to a sequence node will not add them in the order that is required by the sequence.
2) Boolean values are written as 'True' or 'False' while XML is case-sensitive and expects them to be 'true' or 'false'.
3) DateTime fields are not written in the XML-specific format.

About that first issue... If I have this schema-declaration:

  <xs:complexType name="NamedItem">
    <xs:sequence>
      <xs:element name="Name" minOccurs="0" type="xs:string"/>
      <xs:element name="Description" minOccurs="0" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

Now, in Delphi. If I create a node of type NamedItem and add a description before the name, the XML file will look like this:
<NamedItem><Description>adescription</Description><Name>aname</Name><NamedItem>
However, the schema specified that they should be a sequence so I expected Delphi to put these nodes in the right order!

So far, the issues I've found are things I can accept for now. I realise these errors might require me to work around them if I want to output an xml file that validates according to my schema. But I wonder if there are even more problems with Delphi's implementation of XML.

My problem: I have an xml schema and I need to generate/read/write an xml file and make sure it is valid according to this schema. A simple solution is to modify the sourcecode that is generated by the XML data Binding wizard and I just have to make sure I insert elements in the right order. But I wonder if I can expect even more problems.

And no, I don't want or need any alternative XML components, no matter how good they are, how fast they are or how free they are.

Points will be divided if more than one person mentions possible problems that haven't been mentioned before.
0
Comment
Question by:Wim ten Brink
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:DeerBear
ID: 9778953
Hi,

I don't own D7, but to my experience a hotspot is entities' handling( &egrave;&lt;&gt; etc ) which may
well be flawed and if I was you I'd investigate in that direction.

HTH,

Andrew
0
 
LVL 1

Accepted Solution

by:
Chopinke earned 500 total points
ID: 9782255
As for 2) and 3)  visit:

http://bdn.borland.com/article/0,1410,28514,00.html

Charlie
0
 
LVL 17

Author Comment

by:Wim ten Brink
ID: 9782702
Good link, Charlie! :-)
However, it is SOAP related and all I need to do is read/write configuration files containing all kinds of information. I have schemas for these files and must make sure that whatever I write will be validated (e.g. by using XMLSpy) according to these schemas. The biggest thing I actually need to rewrite is the XML Data Binding wizard since this thing generated a flawed sourcefile.

Andrew,
I use the IXMLDocument/TXMLDocument component to access the xml data and haven't noticed many problems with values in entities. It recognizes &lt; and &gt; but &egrave; is invalid. But this is correct since XML doesn't recognise this character reference. Only &amp; &lt; &gt; &quot; &apos; are recognized, which is correct. Other references are just invalid. (Well, unicode chartacters can be referenced by using &#xxx; where xxx is the numeric code for the character. Thus &#0169; will put the © character in the entity. But there's no real need to reference unicode since an XML file can handle unicode files quite well.
0
 
LVL 17

Author Comment

by:Wim ten Brink
ID: 10079020
Points and A-Grade awarded for the useful link. I hoped someone else might have added something useful to this Q so I would have to split the points but no... No one else added anything. The link explains the weaknesses of Delphi's SOAP implementation and gave me enough leads to discover some other flaws.

Thanks again!
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question