Package DE_EPAGES::Object::API::Object::XMLStructure
logical structure presenting an xml file that contains database content.
the structure contains a lot of elements that are referenced by object path.
every xml element has a lot of semantic structure attributes e.g.
xml-file:
if changes where made please actualize:
http://ep-support.intern.epages.de:8080/wiki/index.php/Image:XMLStructure.jpeg
http://ep-support.intern.epages.de:8080/wiki/index.php/XML_Structure
Functions
- addElement
- assimilateXMLStructure
- countTagAttributes
- deleteChilds
- deleteElement
- deleteTagAttribute
- deleteTagAttributes
- deleteXMLStructAttribute
- existsAdditionalTagAttributes
- existsElement
- existsIDPart
- existsParentElement
- existsSubElement
- existsTagAttribute
- existsXMLStructAttribute
- getChildElements
- getClass
- getDirectChildElements
- getElements
- getElementsWithoutParent
- getID
- getIDValue
- getRootElements
- getTagAttribute
- getTagAttributes
- getTagAttributesHash
- getXMLStructAttribute
- getXMLStructAttributes
- getXMLStructAttributesHash
- getXMLType
- getXMLTypeAddictedID
- isEmpty
- isRootElement
- new
- parentElement
- setID
- setTagAttribute
- setTagAttributes
- setXMLStructAttribute
- setXMLStructAttributes
addElement
adds a new element to the semantic structure.
Syntax |
$XMLStruct->addElement($ElementName,$Class,$hID, $hXMLStructAttributes,$hTagAttributes); |
Example |
$self->addElement('/Class/Class1/Objects/Object1/Attributes/TranslationAttribute{Language->de;Name->Test}', 'TranslationAttribute', {'Language' => 'de', 'Name' => 'Test'}, {'TagName' => 'Attribute'}, {'Meta' => 'Übersetzung', 'delete' => '1' } ); |
Input |
|
assimilateXMLStructure
added all elements and attributes from alien semantic structure taht dont exists if 'overwrite' is set to '1' additional all attributes that exists in both will overwrite by the alien semantic structure.
Syntax |
$XMLStruct->assimilateXMLStructure($AlienXMLStruct, $hOptions); |
Example |
$XMLStruct->assimilateXMLStructure($XMLStruct2, {'overwrite' => '1'}); |
Input |
|
countTagAttributes
return the number of tag attribute, from element
Syntax |
my $CountTagAttributes = $XMLStruct->countTagAttributes($ElementName); |
Input |
|
Return |
|
deleteChilds
delete all child elements of given element.
Syntax |
$XMLStruct->deleteChilds($Element); |
Input |
|
deleteElement
removes an element with given path from semantic structure.
Syntax |
$XMLStruct->deleteElement($ElementName); |
Input |
|
deleteTagAttribute
delete the attribute of element in semantic structure
Syntax |
$XMLStruct->deleteTagAttribute($ElementName, $TagAttributeName); |
Input |
|
deleteTagAttributes
delete all attributes of element in semantic structure
Syntax |
$XMLStruct->deleteTagAttributes($ElementName); |
Input |
|
deleteXMLStructAttribute
delete the attribute of element in semantic structure
Syntax |
$XMLStruct->deleteXMLStructAttribute($ElementName, $XMLStructAttributeName); |
Input |
|
existsAdditionalTagAttributes
return true if additionally attributes exists besides the attributes in array. return false if only the given attributes exists.
Syntax |
my $Exists = $XMLStruct->existsAdditionalTagAttributes($ElementName,$aControlAttributeNames); |
Input |
|
Return |
|
existsElement
return true if the path of an element exists in the semantic structure.
Syntax |
my $ExistsElement = $XMLStruct->existsElement($ElementName); |
Input |
|
Return |
|
existsIDPart
return true if part of id for element exists
Syntax |
my $Exists = $XMLStruct->existsIDPart($ElementName,$IDName); |
Input |
|
Return |
|
existsParentElement
return true if the parent path of an element is an element of the semantic structure.
Syntax |
my $ExistsParentElement = $XMLStruct->existsParentElement($ElementName); |
Input |
|
Return |
|
existsSubElement
return true if one ore more sub elements of given element exists
Syntax |
my $SubElementExists = $XMLStruct->existsSubElement($ElementName); |
Input |
|
Return |
|
existsTagAttribute
return true if if the attribute of element exists
Syntax |
my $ExistsTagAttribute = $XMLStruct->existsTagAttribute($ElementName, $TagAttributeName); |
Input |
|
Return |
|
existsXMLStructAttribute
return true if semantic structure element exists for given element
Syntax |
my $Exists = $XMLStruct->existsXMLStructAttribute($ElementName, $XMLStructAttributeName); |
Input |
|
Return |
|
getChildElements
return a list with the names of all child elements in the semantic structure of a given elementname.
Syntax |
$aChildElements = $XMLStruct->getChildElements($ParentElement); |
Input |
|
Return |
|
getClass
return class element exists
Syntax |
my $Class = $XMLStruct->getClass($ElementName); |
Input |
|
Return |
|
getDirectChildElements
return all child elements of given element, that are direct children
Syntax |
$aDirectChildElements = $XMLStruct->getDirectChildElements($ParentElement); |
Input |
|
Return |
|
getElements
return a list with the names of all elements in the semantic structure. the names are always the pathes of the elements.
Syntax |
$aElements = $XMLStruct->getElements(); |
Example |
my @Elements = @{$XMLStruct->getElements()}; |
Return |
|
getElementsWithoutParent
return all elements of structure, that have no parent element in structure.
Syntax |
my $aOrphanElements = $XMLStruct->getElementsWithoutParent($ElementName); |
Return |
|
getID
return the identifier of given element
Syntax |
my $hID = $XMLStruct->getID($ElementName); |
Input |
|
Return |
|
getIDValue
return part of id for element exists
Syntax |
my $IDAttributeValue = $XMLStruct->getIDValue($ElementName,$IDAttributeName); |
Input |
|
Return |
|
getRootElements
return all root elements of semantic structure, elements with no parent
Syntax |
my $aRootElements = $XMLStruct->getRootElements(); |
Return |
|
getTagAttribute
return the value of tag attribute of the element
Syntax |
my $TagAttributeValue = $XMLStruct->getTagAttribute($ElementName, $TagAttributeName); |
Input |
|
Return |
|
getTagAttributes
return a sorted array with names of tag attributes for given array.
Syntax |
my $aAttributes = $XMLStruct->getTagAttributes($ElementName); |
Input |
|
Return |
|
getTagAttributesHash
return a sorted array with names of tag attributes for given array.
Syntax |
my $hAttributes = $XMLStruct->getTagAttributesHash($ElementName); |
Input |
|
Return |
|
getXMLStructAttribute
get the semantic structure attribute of element like _XMLStruct-Class=?
Syntax |
my $XMLStructAttributeValue = $XMLStruct->getXMLStructAttribute($ElementName, $XMLStructAttributeName); |
Input |
|
Return |
|
getXMLStructAttributes
return a sorted array with names of semantic structure attributes for given array.
Syntax |
my $aXMLStructAttributes = $XMLStruct->getXMLStructAttributes($ElementName); |
Input |
|
Return |
|
getXMLStructAttributesHash
get list of semantic structure attributes for element
Syntax |
my $hXMLStructAttributes = $XMLStruct->getXMLStructAttributesHash($ElementName); |
Input |
|
Return |
|
getXMLType
returns the type of xml [epages_standard|epages_translation]
Syntax |
my $XMLType = $self->getXMLType(); |
Return |
|
getXMLTypeAddictedID
return the identifier of given element addicted by the xml type the only known difference is AttributeValue tags in translation file, they are addressed only by Name because translation xml files have a global language tag.
Syntax |
my $hID = $XMLStruct->getXMLTypeAddictedID($ElementName); |
Input |
|
Return |
|
isEmpty
return true if no elements are in semantic structure ore only elements that have no effect for sub pathes like global tags like <epages>, ...
Syntax |
my $IsEmpty = $XMLStruct->isEmpty(); |
Return |
|
isRootElement
return true if given element is an root element, so it is an element with no parent.
Syntax |
my $IsRootElements = $XMLStruct->isRootElement($Element); |
Input |
|
Return |
|
new
constructor for semantic structure object.
Syntax |
$self->new($XMLType); |
Input |
|
parentElement
returns the name of the parent of given element, dont check if exists in structure.
Syntax |
my $ParentElementName = $XMLStruct->parentElement($ElementName); |
Input |
|
Return |
|
setID
set the identifier of given element, remember Element name have to be consistent to his id
Syntax |
$XMLStruct->setID($ElementName, $hID); |
Example |
$XMLStruct->setID('/Test1/Test2/Example{ID1->Value1;ID2->Value2}', {'ID1' => 'Value1', 'ID2' => 'Value2'}); |
Input |
|
Return |
|
setTagAttribute
set the attribute value of element in semantic structure
Syntax |
$XMLStruct->setTagAttribute($ElementName, $TagAttributeName, $Value); |
Input |
|
setTagAttributes
set the tag attributes for a semantic structure element. if a tag attribute already exists it will be overwrite.
Syntax |
$XMLStruct->setTagAttributes($ElementName, $hTagAttributes); |
Input |
|
setXMLStructAttribute
set the semantic structure attribute of element like _XMLStruct-Class='Object'
Syntax |
$XMLStruct->setXMLStructAttribute($ElementName, $XMLStructAttributeName, $XMLStructAttributeValue); |
Input |
|
setXMLStructAttributes
set the semantic structure attributes for an element
Syntax |
$XMLStruct->setXMLStructAttributes($ElementName, $hXMLStructAttributes); |
Input |
|