eZpedia : The Free eZ Publish CMS Documentation Encyclopedia

Solution: Manipulating eZXML Document Contents

Problem - Example #1

I need to modify the contents of the eZXML document stored in the ezorder.data_text_1 (variable/field).

I need to append three sibling items to the last in the 'shop_account' structure.

The document

The eZXML document contains the following example structure.

 

I could not find a way to modify an existing document simply this using any existing eZ code or API. I was pointed by a friend to use 'domxml' as an alternative to provide the features should need to modify an existing document without having to write code to regenerate it myself (which I did not really want to do, or think I should have too).

The code

The following is an example of the code used in this example solution

 

The summary

There are a number of solutions to this problem. This is simply one example for the next person trying to use, manipulate information stored (trapped) in ezxml / xml inside the eZ publish database content.

Article provided by eZpedia

All text is available under the terms of the GNU Free Documentation License

Powered by eZ Publish 6.0.2stable

Hosted by USA eZ Publish Community Partner : Brookins Consulting