Professional Web Applications Themes

data structure from XML::LibXML - PERL Modules

I am hunting for a way of dumping a data structure from an XML::LibXML doent or element. To explain, both XML::Simple and XML::Twig have a way of turning the doent into a data structure. XML::Simple has XMLin() and XML::Twig has simplify(), both of which return a Perl data structure. I make heavy use of XML::LibXML across my project and would prefer to not have to introduce a secondary XML module for this purpose alone. Will I have to roll my own "simplify" method that walks libxml elements from which to create the data structure? I have been unable to find ...

  1. #1

    Default data structure from XML::LibXML

    I am hunting for a way of dumping a data structure from an XML::LibXML
    doent or element.

    To explain, both XML::Simple and XML::Twig have a way of turning the
    doent into a data structure. XML::Simple has XMLin() and XML::Twig
    has simplify(), both of which return a Perl data structure.

    I make heavy use of XML::LibXML across my project and would prefer to
    not have to introduce a secondary XML module for this purpose alone.
    Will I have to roll my own "simplify" method that walks libxml elements
    from which to create the data structure? I have been unable to find any
    docs or usenet postings regarding this subject.

    Thanks,
    /dave
    Dave Roe Guest

  2. #2

    Default Re: data structure from XML::LibXML

    Dave Roe wrote:
    > I am hunting for a way of dumping a data structure from an XML::LibXML
    > doent or element.
    From which specific XML::LibXML package do you wish to dump a data
    structure? The doentation
    ([url]http://search.cpan.org/~phish/XML-LibXML-1.58_1/LibXML.pod[/url]) indicates
    that the module is divided into approx. 16 packages.

    jimk
    Jim Keenan Guest

  3. #3

    Default Re: data structure from XML::LibXML

    Jim Keenan wrote:
    > Dave Roe wrote:
    >
    >> I am hunting for a way of dumping a data structure from an XML::LibXML
    >> doent or element.
    >
    > From which specific XML::LibXML package do you wish to dump a data
    > structure? The doentation
    > ([url]http://search.cpan.org/~phish/XML-LibXML-1.58_1/LibXML.pod[/url]) indicates
    > that the module is divided into approx. 16 packages.
    From a doent or an element, meaning an XML::LibXML::Doent or an
    XML::LibXML::Element (and any/all other packages, whether they be Text,
    Attribute, CDATASection, etc).

    Essentially, I would like to be able to either dump a whole
    XML::LibXML::Doent, or fetch a particular element and dump that, and
    the contained tree would be walked and dump out appropriately, depending
    on the type of element found.

    /dave
    Dave Roe Guest

Similar Threads

  1. cf structure and unicode data
    By shoalwater in forum Coldfusion - Advanced Techniques
    Replies: 3
    Last Post: May 3rd, 02:17 PM
  2. XML::LibXML and getting data from elements/nodes
    By Derrell Durrett in forum PERL Modules
    Replies: 4
    Last Post: November 3rd, 03:44 PM
  3. XML-Structure and Panel Data
    By Ulf_Schreiber@adobeforums.com in forum Adobe Indesign Windows
    Replies: 0
    Last Post: June 25th, 11:18 AM
  4. what is this data structure?
    By Jack Chen in forum PERL Beginners
    Replies: 10
    Last Post: February 6th, 05:54 AM
  5. data structure help
    By James E Keenan in forum PERL Miscellaneous
    Replies: 0
    Last Post: August 9th, 06:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139