Since tree is a special case for a graph, I think you may use a DOM
tree for example to represent your graph in-memory.

XML data is inherently hierarchical, and mapping it to any custom
structure (for e.g a non tree like graph or something else) I think
would require a custom design. A SAX stream to your custom graph
structure should be possible, provided you're able to develop such an
algorithm.

On Sun, Dec 11, 2011 at 9:25 PM, alessandra.brind...@virgilio.it
<alessandra.brind...@virgilio.it> wrote:
>  Hello, I have to implement the Data Graph in Java from an XML document. For
> example, having the following document:
>
> <movie>
> <title> Hello </ title>
> <actors>
> <actor> Brad Pitt </ actor>
> <actor> George Clooney </ actor>
> </actors>
> </movie>
>
> we must build an internal representation of the document in the form of a
> graph, where elements are represented as nodes and links between elements
> such as arches. Then I have to navigate through the graph to process the
> data. I wanted to understand what are the most efficient structures for the
> representation of a graph, ie Hashtable, matrices, etc. ...
> In addition, you have to give me some suggestions on how I can use the sax
> parser to construct the structure graph?



-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to