Sign in Join
FPDoc Onlineexperiment

TXMLObjectWriter.GetPropertyElement function

Member of TXMLObjectWriterprotectedIn unit Laz_XMLStreaming

Gets a TDOMElement used to serialize a property using the specified type name.

Declaration

pascal
function GetPropertyElement(const TypeName: string): TDOMElement

Arguments

TypeName

Name for the type represented in the property element.

Function result

TDOMElement used to represent the type and property name.

Description

GetPropertyElement returns a TDOMElement configured to represent a property using the specified type.

The TagName in the element is set to the specified TypeName argument. The property name is retrieved from the internal element stack in the class instance and stored as the 'name' attribute in the element. If the property name has not been assigned (''), the name attribute is omitted from the element.

The TDomElement in the return value is appended as a child node to the element stack.

GetPropertyElement is used in the implementation of write methods in the object instance. Such as:

  • BeginCollection
  • WriteBinary
  • WriteBoolean
  • WriteFloat
  • WriteSingle
  • WriteCurrency
  • WriteInteger
  • WriteUInt64
  • WriteIdent
  • WriteDate
  • WriteMethodName
  • WriteSet
  • WriteString
  • WriteWideString
  • WriteUnicodeString
  • WriteVariant

These calling routines set the 'value' attribute for the element returned from the method. Tehety may set set additional attribute values, like 'class', as needed for a component or type.

Errors

Raises an Exception if the DOM elment already exists, and has therefore already been saved.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.