Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I of course have no way to know just how big or how small your actual requirement may be, but I would point out that the XML industry standard, XSLT, essentially exists to allow the specification of XML transformations without writing custom-code to do it.   So, if you find that you can generalize your big-picture requirement into something that XSLT can take care of for you, it just might be an approach worth looking into.   (PerlMonks apparently won’t allow me to include a direct reference to the WikiPedia article.)

Of course I see that you are already using XML::LibXML, which leverages the venerable binary libxml2, thus giving you instant access to the definitive implementation of XSLT should it prove advantageous in this particular project.

Whether this will turn out to be “a viable approach, thanks for suggesting it,” or “overkill,” is only for you to decide.   For one-off cases it is probably overkill so, ignore this comment but if you have a lot of transformations to make it can be a very big win.   The very nice thing about Perl is that it gives you very easy access to either alternative and with the power to back it up.

In reply to Re: Update nodes in XML document by sundialsvc4
in thread Update nodes in XML document by corfuitl

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (4)
    As of 2020-02-23 17:38 GMT
    Find Nodes?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?

      Results (103 votes). Check out past polls.