Difference between revisions of "LMD VCL - XML"

From LMD
Jump to: navigation, search
Line 3: Line 3:
  
 
== Tables of names ==
 
== Tables of names ==
In LMDXML implementing is used тАЬtables of namesтАЭ idea. It's a just list of strings for each of them is assigned unique (in bounds of table) number. Link to such table included in each document. And for elements are stored not a strings, but unique numbers from table. The same is actual for attributes.
+
In LMDXML engine the <i>tables of name</i> approach is used. It's a just list of strings for of which each item is assigned an unique (in bounds of table) number. Link to such table is included in each document. Elements are not stored to a string, but to an unique number of the table. The same is true for attributes.
  
What for?
+
<b>Why?</b><br>
 +
At first - it helps to decrease memory usage, especially for huge documents. We don't need to store thousands strings, just thousands of numbers (number don't require memory reserving and use less memory).
  
Firstly, it helps to decrease memory usage, especially for huge documents. We don't need to store thousands strings, just thousands numbers (number don't require memory reserving and use less memory).
+
At second - it increases searching speed dramatically, because comparing of numbers is much faster than comparing strings.  
 
 
Secondly, it increase searching speed dramatically, because comparing of number is much faster than comparing strings.  
 
  
 
== Interfaces or Classes? ==
 
== Interfaces or Classes? ==
LMDXML all objects are represented as interfaces ('''interface''' keyword instead of '''class'''). Reason is that work with interfaces much safer and simpler than with objects referencing. You needn't to create complex code with '''try...finally''' to destroy objects тАУ it will be done by compiler RTL for you. See examples.
+
The LMDXML engine implements all objects as interfaces ('''interface''' keyword instead of '''class'''). Technical background is that working with interfaces is much safer and simpler than working with object referencing. You needn't to create complex code with '''try...finally''' to destroy objects - it will be done by compiler RTL for you. See examples.
  
 
== BinaryXML format ==
 
== BinaryXML format ==
It's binary representation of XML format. You can use it to store config files, because it compact, fast and typed. LMDXML can uses both of classic text XML and binary XML.
+
Represents binary representation of XML format. You can use it to store configuration files, because it compact, fast and typed. LMDXML engine can make use of both ways: Classic text XML and binary XML.

Revision as of 14:51, 5 October 2008

Native with DOM like API

LMDXML is pure pascal, fast and small library to parse XML files.

Tables of names

In LMDXML engine the tables of name approach is used. It's a just list of strings for of which each item is assigned an unique (in bounds of table) number. Link to such table is included in each document. Elements are not stored to a string, but to an unique number of the table. The same is true for attributes.

Why?
At first - it helps to decrease memory usage, especially for huge documents. We don't need to store thousands strings, just thousands of numbers (number don't require memory reserving and use less memory).

At second - it increases searching speed dramatically, because comparing of numbers is much faster than comparing strings.

Interfaces or Classes?

The LMDXML engine implements all objects as interfaces (interface keyword instead of class). Technical background is that working with interfaces is much safer and simpler than working with object referencing. You needn't to create complex code with try...finally to destroy objects - it will be done by compiler RTL for you. See examples.

BinaryXML format

Represents binary representation of XML format. You can use it to store configuration files, because it compact, fast and typed. LMDXML engine can make use of both ways: Classic text XML and binary XML.