Thanks for your reply, John.

Yes, I thought about implementing my objects as wrappers around XML::LibXML::Element objects. However, the problem is that I need to be able to link my objects into a hierarchical structure, and then export that structure into an XML document that reflects the structure of this hierarchy. And, of course, to re-import the XML document by parsing it with the XML::LibXML::Parser, which would build a DOM tree. I would then bless the DOM objects into my classes, magically re-creating the hierarchy of my application's data... (can you see how beautiful it is?) The simplest way to accomplish this is to have my objects be the DOM objects themselves, and use the DOM tree's structure to represent my application's structure.

To wrap the DOM objects would be to require that I link the wrapper objects together to represent my application's structure, and then to link their underlying DOM objects in parallel. This would be a lot of duplication, as well as complexity in keeping the two sets of links consistent. Unfortunately, I might be stuck using a solution like this. It's either that, or revert to using XML::DOM (for which my subclassing scheme worked, but which is sub-optimal for other reasons).

Thanks again,
-brian


In reply to Re: Re: Is it a bad idea to subclass XML::LibXML ? by nenbrian
in thread Is it a bad idea to subclass XML::LibXML ? by nenbrian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.