Home > Back-end >  Delphi7 nativexml development
Delphi7 nativexml development

Time:10-11

Delphi7 + nativexml development, how to manage the class XML document format (fixed)?
XML document formats (simplified) as follows:

<? The XML version="1.0" encoding="GB2312"?>














What are the potential energy will unit file after generalization, post,
And generated after class, whether there is a function of the loading XML DOC document? Use this class to have a XML DOC document?

Add:
I now use NativeXml is version 3.26, the following
{$# ifndef D12up}
Type
UnicodeString=WideString;
RawByteString=AnsiString;
{$endif}

Const

//the Current version of the NativeXml unit
CNativeXmlVersion='v3.26';

-- -- -- -- -- -- -- --
//the Forward declaration of TNativeXml
TNativeXml=class;

//TXmlNode is the ancestor for all nodes in the XML document. See TsdElement
//for the elements, TsdAttribute for attributes.
TXmlNode=class (TDebugPersistent)
Private
//inherited from TDebugPersistent: FOwner: TDebugComponent
FParent: TXmlNode;
.

CodePudding user response:


Passing UP friendship

CodePudding user response:

Scripting language is difficult, unless by DELPHI

CodePudding user response:

The upstairs friends, how to say it is difficult to? Generalization is!

CodePudding user response:

Delphi client define the mapping class

CodePudding user response:

Actually is kind of mapping of XML

CodePudding user response:

Why generalization?
Need to generate the source code in translating, much trouble ah,,,,,,, so some people say that upstairs with a script

Implement a class, in fact, according to the name from the XML value (if need be, and can write value function),!
Such a class is common, become just the XML data content
If the class, the class will also changes with the structure of the XML, is the trouble

CodePudding user response:

Can you write it,

CodePudding user response:

XML structure is fixed
It's convenient to make generalization, development time,

CodePudding user response:

If it is a simple class

Can use keys list instead of

Does not attribute - the values

If there is a child attributes or array

So big deal to define a single list of classes can completely meet the demand

CodePudding user response:

Feeling is too old to DELPHI, a lot of new technology, originally the DELPHI did not consider that lead to begin to disconnect from the OBJECT, so can't

CodePudding user response:

The structure of an XML document is relatively complex, attributes, deep level
So let's class,

CodePudding user response:

I said don't know whether you know

Delphi list of key values such as Stringlist


Sl. The name [' Caption] :='value';

Sl. The name [' XXXX '] :='XX';

Describe like this is not a simple class?

If if there is object hierarchy

By SL. ADDOBJECT (' Child 'object);
Implement
Really can't define a class list, similar to the cycle of XML to add

CodePudding user response:

The
references to the tenth floor jiap1723 response:
if it is a simple class

Can use keys list instead of

Does not attribute - the values

If there is a child attributes or array

So big deal to define a single list of classes can completely meet the requirements of


Keys list to replace completely can express a complex XML
This I use ini implementation: multi-level, repeat can store
This stuff, I it is a general explanation of class, using XML or ini as a big data field line
Of course, the premise is to press the speed of access to and take according class/structure domain almost the speed of the
XML can be much worse, ini is really about

CodePudding user response:

On the 14th floor sz_haitao
reference response:
references to the tenth floor jiap1723 response:
If it is a simple class

Can use keys list instead of

Does not attribute - the values

If there is a child attributes or array

So big deal to define a single list of classes can completely satisfy the demand


Keys list to replace completely can express a complex XML
This I use ini implementation: multi-level, repeat can store
The practice of this thing, I is a generic class, using XML or ini as a big...


Well my thoughts with you about

I also did something similar, but is a one-way list

CodePudding user response:

Upstairs, eldest brother, can you write a call by the XML structure examples? Thank you very much!

CodePudding user response:

reference 16 floor solonet response:
upstairs eldest brother, can you write a call by the XML structure of the case? Thank you

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
M have time another day

CodePudding user response:


The unit UntClassDef;

Interface

USES the
Windows, Classes, SysUtils, Parser, Dialogs, IdGlobal, StrUtils,
IniFiles, Graphics, Forms and DB, ADODB, Gauges, Variants, NativeXML;

Const
//the node name
XmlDocRootNodeName='HYMAKEESTDOC';//the root of the document name
XmlHEADERNodeName='HEADER';
XmlDATANodeName='DATA';
XmlPASSNodeName='PASS';
XmlTProjectNodeName='TProject';
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related