Skip to main content

Table 1 XBabelPhish primitive operations

From: The XBabelPhish MAGE-ML and XML Translator

Operation

Definition

Target Location

New Content

New Content Type

Result

addElementFirst

add an element as the first child of a targeted parent element

<x>

<a/>

element to add

<x><a/></x>

addElementLast

add an element as the last child of a targeted parent

<x>

<d/>

element to add

<x> <a/> <d/> </x>

insertElementAfter

insert an element after a targeted sibling element

<a>

<b/>

element to add

<x> <a/> <b/> <d/> </x>

insertElementBefore

insert an element before a targeted sibling element

<d>

<c/>

element to add

<x>

<a/> <b/> <c/> <d/>

</x>

addAttribute

add an attribute to a targeted element

<x>

name

name of attribute to add

<x>

name="xFamily"

<a/> <b/> <c/> <d/>

</x>

   

"xFamily"

attribute value

 

addTextStart

add text to the start of an element

<x>

"start"

text to add

<x>

start name="xFamily"

<a/> <b/> <c/> <d/>

</x>

addTextEnd

add text to the end of an element

<x>

"end"

text to add

<x>

start name="xFamily"

<a/> <b/> <c/> <d/> end

</x>

delete

delete a target node of any type

<d>

 

node to delete

<x>

start name="xFamily"

<a/> <b/> <c/>

end

</x>

rename

rename a target element or attribute node

<a>/@name

title

new name

<x>

start title="xFamily"

<a/> <b/> <c/> end

</x>

update

update the value of a target element or attribute node

<a>/@title

"abcGroup"

new (attribute) value

<x>

start title="abcGroup"

<a/> <b/> <c/> end

</x>

  1. The Operation in the first row is applied to the simple, abstract XML snippet:
  2. <x> </x>
  3. The Operation in each succeeding row applies to the Result of the row immediately preceding it.