[Gambas-user] XML library with xml multilevel tags
Luigi Carlotto
md9327 at ...120...
Sat Dec 27 19:09:50 CET 2008
I do not comprise the reason, but mine precedence post has been included
like answer in an other mail.
… however…
Gambas 2.9.0
Using the gb.xml library, me they are shrewed that the reading can be
carried out single on files xml to 2 levels.
I explain myself in better way…
I have necessity to read xml files, that it contains a composed
structure from elements, structured in hierarchical way on more levels,
as an example:
<?xml version="1.0" encoding="UTF8"?>
<pgDesigner Version="2.0.0">
<PROJECT Name="bible" PageFormat="A4" PageOrientation="0"
Revision="14/03/2008 14:44:03" Description="bible" Driver="8.2"
Author="mgm" Display="0">
<TABLE Name="tb_log" X="10" Y="6" ColorBack="230,230,230"
ColorText="0,0,0" ColorBackTitle="230,230,230"
ColorBackTitleSelected="76,89,166" ColorForeTitle="0,0,0"
ColorForeTitleSelected="255,255,255" Comment="006C006F0067"
Option="false" PrimaryKey="tb_log_pk">
<TABLEFIELD Name="id" Table="tb_log"
Comment="006900640065006E00740069006600690061006E0074" Length="0"
NullCheck="true" PrimaryKey="true" Type1="serial"/>
<INDEX Name="tb_type_personne_idx1" Table="tb_type_personne"
Unique="true"/>
</TABLE>
questa è una prova
</PROJECT>
</pgDesigner>
In the example, the hierarchy of the rows xml is composed gives:
1) a main element (root) “<pgDesigner>”;
2) inside of the root, the element is present “<PROJECT>”;
3) under “<PROJECT>” the element is present “<TABLE>”;
4) in its turn, the element “<TABLE>” contains a series of other
heterogenous elements.
Through the gb.xml library, the reading of the file does not notice of
the closing of tag (Node.Type=XmlReaderNodeType.EndElement), if these
are sluices on the same definition of the tag, like as an example:
<INDEX Name="tb_type_personne_idx1" Table="tb_type_personne"
Unique="true"/>
the reading evidences the opening of tag, but the not its closing, for
which it renders impossible to ago understand if tag following the part
of a advanced element, or is to the same level of the element
precedence.
The behavior is various in phase of writing where, through the methods
“StartElement” and “EndElement”, it is possible to define complex
structures.
This logic, currently, only forces the use of structures xml on two
levels.
More information about the User
mailing list