XPipe

Towards the industrialization of XML processing

Last updated Saturday, January 12, 2002

Getting Started with Pyxie2

When using the pyxie module the first thing that you will want to do is
build up a pyxie tree. You can do this with the function File2xTree (or String2xTree)
which will take in XML, parse it and build a tree made up of Nodes which represent the
XML.

e.g.
  T = pyxie.pyxieUtils.File2xTree("FileName.xml")
This statement results in a pyxie xTree being returned and stored in "T"

So what is a pyxie Tree?
A pyxie tree is a tree made up of interconected nodes that represent the XML which was parsed.
The nodes which make up the tree can be one of two types xElement or xData depending on whether
the bit of XML they represented was an Element or Data.


Below is an example of XML with three elements and the resulting pyxie tree.
<Person>
  <FirstName>Derek</FirstName>
  <SurName>Higgins</SurName>
</Person>

       xElement
        /      \
       /          \
      /            \
xElement  xElement
     |                   |
   xData        xData

How do I use this Tree?

Try looking through the Pyxie2 example files and running them with Jython you will also need the file example.xml as this is used as input to the python files.

example.xml
pyxie-example-1.py
pyxie-example-2.py
pyxie-example-3.py

You can also browse the latest Pyxie2 documentation at Pyxie2 Docs

Up

Home