Package DE_EPAGES::XML::API::BaseImportHandler
This is the base class for XML import handlers.
Functions
- collectCharacters
- existsReturn
- getAttributes
- getCharacters
- importXML
- new
- popID
- popReturn
- pushID
- pushReturn
- stackID
- stackReturn
- topElement
- topID
- topReturn
- varsOnErrorString
collectCharacters
If called with one parameter, this function enables or disables character parsing. Previously parsed characters are reset. If called without parameters, the funtion returns true if character parsing is enabled. See also getCharacters
Syntax |
$self->collectCharacters( $Enable ); my $Enable = $self->collectCharacters; |
Example |
if( $self->collectCharacters ) { print $self->getCharacters; $self->collectCharacters( 0 ); } |
Input |
|
Return |
|
existsReturn
Returns true if at least value exists on the stack.
Syntax |
$CompanyID = $self->existsReturn( 'CompanyID' ) |
Input |
|
Return |
|
getAttributes
Returns the attributes of an element as hash.
Syntax |
$hAttributes = $self->getAttributes( $Element ); $hAttributes = $self->getAttributes( ( $Element, $Namespace ); |
Example |
my $Name = $self->getAttributes( $Element )->{'Name'}; |
Input |
|
Return |
|
getCharacters
Syntax |
$String = $self->getCharacters; |
Example |
Returns the parsed text between XML tags that has been collected since character parsing has been enabled with $self-><function collectCharacters>( 1 ). if( $self->collectCharacters ) { print $self->getCharacters; $self->collectCharacters( 0 ); } |
Return |
|
importXML
Imports classes and attributes from an XML file.
Syntax |
$Package->importXML( $FileName ); $Handler = $Package->new; $Handler->importXML( $FileName ); |
Input |
|
new
Creates a new XML import handler object.
Syntax |
$Handler = DE_EPAGES::XML::API::BaseImportHandler->new(); |
Return |
|
popID
Returns the most recently added parameter and removes leaves it from the stack.
Syntax |
$CompanyID = $self->popID( 'CompanyID' ) |
Input |
|
Return |
|
popReturn
Returns the most recently added value and removes it from the stack.
Syntax |
$CompanyID = $self->popReturn( 'CompanyID' ) |
Input |
|
Return |
|
pushID
Adds a named parameter value. This allows element handlers to pass information to the handler of sub elements.
Syntax |
$self->pushID( 'CompanyID', $CompanyID ) |
Input |
|
pushReturn
Adds a named return value. This allows handles for sub elemets to pass information to the handler of the outer element.
Syntax |
$self->pushReturn( 'CompanyID', $CompanyID ) |
Input |
|
stackID
Returns the named parameter values. This allows element handlers to get information about top level identifier.
Syntax |
my $raIDs = $self->stackID( 'CompanyID'); |
Input |
|
Return |
|
stackReturn
Returns the return added values.
Syntax |
my $raReturns = $self->stackReturn( 'CompanyReturn'); |
Input |
|
Return |
|
topElement
Returns the currently processes XML element node.
Syntax |
$Element = $self->topElement; |
Return |
|
topID
Returns the most recently added parameter but leaves it on the stack.
Syntax |
$CompanyID = $self->topID( 'CompanyID' ) |
Input |
|
Return |
|
topReturn
Returns the most recently added value but leaves it on the stack.
Syntax |
$CompanyID = $self->topReturn( 'CompanyID' ) |
Input |
|
Return |
|
varsOnErrorString
Returns information about the current position in the XML file.
Syntax |
$Position = $self->varsOnError(); $Position = $self->varsOnError( $Element ); |
Input |
|
Return |
|