Unit AdSimpleXML

DescriptionusesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Unit which is used for parsing XML-Files. Originally "JclSimpleXML.pas".

Overview

Classes, Interfaces, Objects and Records

Name Description
Class EAdSimpleXMLError  
packed record TAdHashElem  
packed record TAdHashRecord  
Class TAdSimpleHashTable  
Class TAdSimpleXMLProp  
Class TAdSimpleXMLProps  
Class TAdSimpleXMLElemsProlog  
Class TAdSimpleXMLElems  
Class TAdSimpleXMLElem  
Class TAdSimpleXMLElemComment  
Class TAdSimpleXMLElemClassic  
Class TAdSimpleXMLElemCData  
Class TAdSimpleXMLElemText  
Class TAdSimpleXMLElemHeader  
Class TAdSimpleXMLElemDocType  
Class TAdSimpleXMLElemSheet  
Class TAdSimpleXML  

Functions and Procedures

function SimpleXMLEncode(const S: String): String;
procedure SimpleXMLDecode(var S: String; TrimBlanks: Boolean);
function XMLEncode(const S: String): String;
function XMLDecode(const S: String): String;
function EntityEncode(const S: String): String;
function EntityDecode(const S: String): String;

Types

TAdOnSimpleXMLParsed = procedure(Sender: TObject; Name: String) of object;
TAdOnValueParsed = procedure(Sender: TObject; Name, Value: String) of object;
TAdOnSimpleProgress = procedure(Sender: TObject; const Position, Total: Integer) of object;
TAdHashKind = (...);
PAdHashElem = ˆTAdHashElem;
PAdHashRecord = ˆTAdHashRecord;
TAdHashList = array [0..25] of PAdHashRecord;
PAdHashList = ˆTAdHashList;
TAdSimpleXMLElemCompare = function(Elems: TAdSimpleXMLElems; Index1, Index2: Integer): Integer of object;
TAdSimpleXMLElemClass = class of TAdSimpleXMLElem;
TAdSimpleXMLOptions = set of (sxoAutoCreate, sxoAutoIndent, sxoAutoEncodeValue, sxoAutoEncodeEntity, sxoDoNotSaveProlog, sxoTrimPrecedingTextWhitespace);
TAdSimpleXMLEncodeEvent = procedure(Sender: TObject; var Value: String) of object;
TAdSimpleXMLEncodeStreamEvent = procedure(Sender: TObject; InStream, OutStream: TStream) of object;

Constants

RsEInvalidXMLElementUnexpectedCharacte = 'Invalid XML Element: Unexpected character in property declaration ("%s" found)';
RsEInvalidXMLElementUnexpectedCharacte_ = 'Invalid XML Element: Unexpected character in property declaration. Expecting " or '' but "%s" found';
RsEUnexpectedValueForLPos = 'Unexpected value for lPos';
RsEInvalidXMLElementExpectedBeginningO = 'Invalid XML Element: Expected beginning of tag but "%s" found';
RsEInvalidXMLElementExpectedEndOfTagBu = 'Invalid XML Element: Expected end of tag but "%s" found';
RsEInvalidXMLElementMalformedTagFoundn = 'Invalid XML Element: malformed tag found (no valid name)';
RsEInvalidXMLElementErroneousEndOfTagE = 'Invalid XML Element: Erroneous end of tag, expecting </%0:s> but </%1:s> found';
RsEInvalidCommentExpectedsButFounds = 'Invalid Comment: expected "%0:s" but found "%1:s"';
RsEInvalidCommentNotAllowedInsideComme = 'Invalid Comment: "--" not allowed inside comments';
RsEInvalidCommentUnexpectedEndOfData = 'Invalid Comment: Unexpected end of data';
RsEInvalidCDATAExpectedsButFounds = 'Invalid CDATA: expected "%0:s" but found "%1:s"';
RsEInvalidCDATAUnexpectedEndOfData = 'Invalid CDATA: Unexpected end of data';
RsEInvalidHeaderExpectedsButFounds = 'Invalid Header: expected "%0:s" but found "%1:s"';
RsEInvalidStylesheetExpectedsButFounds = 'Invalid Stylesheet: expected "%0:s" but found "%1:s"';
RsEInvalidStylesheetUnexpectedEndOfDat = 'Invalid Stylesheet: Unexpected end of data';
RsEInvalidDocumentUnexpectedTextInFile = 'Invalid Document: Unexpected text in file prolog';

Description

Functions and Procedures

function SimpleXMLEncode(const S: String): String;

Encodes a string into an internal format: any character <= #127 is preserved all other characters are converted to hex notation except for some special characters that are converted to XML entities

procedure SimpleXMLDecode(var S: String; TrimBlanks: Boolean);

Decodes a string encoded with SimpleXMLEncode: any character <= #127 is preserved all other characters and substrings are converted from the special XML entities to characters or from hex to characters NB! Setting TrimBlanks to true will slow down the process considerably

function XMLEncode(const S: String): String;
 
function XMLDecode(const S: String): String;
 
function EntityEncode(const S: String): String;

Encodes special characters (', ", <, > and &) into XML entities (@apos;, &quot;, &lt;, &gt; and &amp;)

function EntityDecode(const S: String): String;

Decodes XML entities (@apos;, &quot;, &lt;, &gt; and &amp;) into special characters (', ", <, > and &)

Types

TAdOnSimpleXMLParsed = procedure(Sender: TObject; Name: String) of object;
 
TAdOnValueParsed = procedure(Sender: TObject; Name, Value: String) of object;
 
TAdOnSimpleProgress = procedure(Sender: TObject; const Position, Total: Integer) of object;
 
TAdHashKind = (...);

Those hash stuffs are for future use only Plans are to replace current hash by this mechanism

Values
  • hkList:  
  • hkDirect:  
PAdHashElem = ˆTAdHashElem;
 
PAdHashRecord = ˆTAdHashRecord;
 
TAdHashList = array [0..25] of PAdHashRecord;
 
PAdHashList = ˆTAdHashList;
 
TAdSimpleXMLElemCompare = function(Elems: TAdSimpleXMLElems; Index1, Index2: Integer): Integer of object;
 
TAdSimpleXMLElemClass = class of TAdSimpleXMLElem;
 
TAdSimpleXMLOptions = set of (sxoAutoCreate, sxoAutoIndent, sxoAutoEncodeValue, sxoAutoEncodeEntity, sxoDoNotSaveProlog, sxoTrimPrecedingTextWhitespace);
 
TAdSimpleXMLEncodeEvent = procedure(Sender: TObject; var Value: String) of object;
 
TAdSimpleXMLEncodeStreamEvent = procedure(Sender: TObject; InStream, OutStream: TStream) of object;
 

Constants

RsEInvalidXMLElementUnexpectedCharacte = 'Invalid XML Element: Unexpected character in property declaration ("%s" found)';
 
RsEInvalidXMLElementUnexpectedCharacte_ = 'Invalid XML Element: Unexpected character in property declaration. Expecting " or '' but "%s" found';
 
RsEUnexpectedValueForLPos = 'Unexpected value for lPos';
 
RsEInvalidXMLElementExpectedBeginningO = 'Invalid XML Element: Expected beginning of tag but "%s" found';
 
RsEInvalidXMLElementExpectedEndOfTagBu = 'Invalid XML Element: Expected end of tag but "%s" found';
 
RsEInvalidXMLElementMalformedTagFoundn = 'Invalid XML Element: malformed tag found (no valid name)';
 
RsEInvalidXMLElementErroneousEndOfTagE = 'Invalid XML Element: Erroneous end of tag, expecting </%0:s> but </%1:s> found';
 
RsEInvalidCommentExpectedsButFounds = 'Invalid Comment: expected "%0:s" but found "%1:s"';
 
RsEInvalidCommentNotAllowedInsideComme = 'Invalid Comment: "--" not allowed inside comments';
 
RsEInvalidCommentUnexpectedEndOfData = 'Invalid Comment: Unexpected end of data';
 
RsEInvalidCDATAExpectedsButFounds = 'Invalid CDATA: expected "%0:s" but found "%1:s"';
 
RsEInvalidCDATAUnexpectedEndOfData = 'Invalid CDATA: Unexpected end of data';
 
RsEInvalidHeaderExpectedsButFounds = 'Invalid Header: expected "%0:s" but found "%1:s"';
 
RsEInvalidStylesheetExpectedsButFounds = 'Invalid Stylesheet: expected "%0:s" but found "%1:s"';
 
RsEInvalidStylesheetUnexpectedEndOfDat = 'Invalid Stylesheet: Unexpected end of data';
 
RsEInvalidDocumentUnexpectedTextInFile = 'Invalid Document: Unexpected text in file prolog';
 

SourceForge.net Logo


Generated by PasDoc 0.11.0 on 2008-12-31 14:32:00