XML Report - strange beaviour

Stimulsoft Ultimate discussion
Post Reply
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

XML Report - strange beaviour

Post by tpontow »

Hello,

i have two XML reports for testing. The first has the following xml data with only one tag <Testdaten> and no further hierarchies:

Code: Select all

<Testdaten Wert1="abcd" Wert2="1" Wert3="12.67" Wert4="True" Wert5="67"></Testdaten>
With that no data is displayed in my report.

After changing the structure to

Code: Select all

<Root Ident="12">
<Testdaten Wert1="abcd" Wert2="1" Wert3="12.67" Wert4="True" Wert5="67"/>
</Root>
i can see data in my report for <Testdaten> and as well for <Root>.

Attached i have both xml data files, xsd files and report files. Can you tell me why i see no data in report / preview for the first structure with no hierarchies?

Thanks
Thorsten
Attachments
Testdaten2.xsd
Second report schema file
(938 Bytes) Downloaded 154 times
Testdaten2.xml
Second report xml data
(143 Bytes) Downloaded 150 times
ReportXml2.mrt
Second report
(15.02 KiB) Downloaded 149 times
Testdaten.xsd
First report schema file
(598 Bytes) Downloaded 160 times
Testdaten.xml
First report xml data
(128 Bytes) Downloaded 158 times
ReportXml.mrt
First report
(8.22 KiB) Downloaded 161 times
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: XML Report - strange beaviour

Post by HighAley »

Hello.

We use XMLReader class of .Net Framework to parse XML files.
Due to W3C XML Recommendations where the .Net Framework reference to, there should be a root element in the xml file.

Thank you.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: XML Report - strange beaviour

Post by tpontow »

Ok, i think you mean that W3C document which says:
2.1 Well-Formed XML Documents

[

Definition: A textual object is a well-formed XML document if:]
1. Taken as a whole, it matches the production labeled document.

2. It meets all the well-formedness constraints given in this specification.

3. Each of the parsed entities which is referenced directly or indirectly within the document is well-formed.


Document

[1]

document

::=

prolog element Misc*


Matching the document production implies that:
1. It contains one or more elements.

2. [Definition: There is exactly one element, called the root, or document element, no part of which appears in the content of any other element.] For all other elements, if the start-tag is in the content of another element, the end-tag is in the content of the same element. More simply stated, the elements, delimited by start- and end-tags, nest properly within each other.


[Definition: As a consequence of this, for each non-root element C in the document, there is one other element P in the document such that C is in the content of P, but is not in the content of any other element that is in the content of P. P is referred to as the parent of C, and C as a child of P.]
By this definition my first code sample above is well formed with one element which is also the root (<Testdaten>). I don't understand why i need an extra artificial root element? So i don't understand why my first xml sample can't be used as data for xml reports.

Thanks
Thorsten
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: XML Report - strange beaviour

Post by tpontow »

I changed my data structure. If i have no subelements in my generated xml data i wrap an artifical root element around it. So, i can live with that. It's ok for me. ;)

Thanks for the information
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: XML Report - strange beaviour

Post by HighAley »

Hello.

Sorry, again. This is a behaviour of the XMLReader class of the .Net Framework. We can't affect it.
It's good that you have found the solution of your problem.

Thank you.
Post Reply