Solved

[XML] Delphi 7 XML Data Binding is flawed?

Posted on 2003-11-19
4
1,475 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now