Ignoring your attempts at using an XML parser as an XML generator

Who said LibXML is just a parser?

XML::LibXML supports namespaces. XML::Smart doesn't (except when used to generate documents).

Yes, probably because it's too old for it. It doesn't support XSD, either, which is part of the reason I'm switching to LibXML.

I'm not debating that Smart is missing critical functionality. I'm frustrated that LibXML is this mature, and is a Perl module, and yet is this clunky at navigation. Nor are there any modules for XML::LibXML that enhance it to fix its navigation.

I mean seriously, this is what I have to do to check for a tag and fill data for it:

# Before $sn->{'SourceDBType'} ||= 'XML'; # After $sn->findvalue('SourceDBType') || ($sn->find('SourceDBType') ? $sn->fi +nd('SourceDBType')->setData('XML') : $sn->addNewChild(undef, 'SourceD +BType')->setData('XML'));

Are you kidding me?!?!  That's a horrible mess!  And god forbid I do something like $sn->find('SourceDBType')->setData('XML') without checking the existence of SourceDBType first.  That'll give me a fatal error.

XML::LibXML preserves the order of the children of elements. XML::Smart can't even list the children of an element.

Incorrect. Smart does both: $XML->{server}{address}[1]('@');  # there's your children of that <address> tag


In reply to Re^2: XML::LibXML - WHAR HASH TREES WHAR?! by SineSwiper
in thread XML::LibXML - WHAR HASH TREES WHAR?! by SineSwiper

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.