http://www.perlmonks.org?node_id=947961


in reply to Re^4: Is there any XML reader like this?
in thread Is there any XML reader like this?

I don't dispute that there is yet another XML::Simple option that can fix things again.

My point is that things appear to work for a while, and then a small change to your input data breaks everything, so you need to alter your code. And then another change to the input data requires another code change.

One of the major reasons people use config files is so that they can avoid having to make changes to running code when, say, a new IP address is assigned.

  • Comment on Re^5: Is there any XML reader like this?

Replies are listed 'Best First'.
Re^6: Is there any XML reader like this?
by BrowserUk (Patriarch) on Jan 15, 2012 at 13:52 UTC
    yet another XML::Simple option

    That's a joke right?

    XML::Simple has two entry points and 29 parse time options -- most of which you will never use -- that are all documented on a single page.

    XML::LibXML has 26 entrypoints and 40+ constructor options mentioned -- note: not "documented" -- on just the parser page. And there are hundreds more entrypoint 'mentions' plus innumerable importable constants scattered across another 31 more pages.

    One of the major reasons people use config files is so that they can avoid having to make changes to running code when, say, a new IP address is assigned.

    Just use the required parsing options from the get-go and no change is required.

    Of course, if the input file specifications change during the life of the program, then you will have to change program.

    But modifying one program line after a substantial modification to the file format is hardly onerous.

    If you are trying to claim that you wouldn't have to modify your program that used LibXML for a similar change, you are kidding yourself.

    What if the addition was:

    <ip note="UNDER NO CIRCUMSTANCES USE THIS IP ON PAIN OF SUBSTANTIAL LE +GAL REPRISALS; INCLUDING EXTRADITION AND LIFE IMPRISONMENT">67.215.65 +.132</ip>

    which your LibXML program will blithely process in just the same way as every other IP it finds -- including perhaps attempting to access it which may well be construed as attempted hacking in some quarters -- without noticing a thing.

    Personally, I prefer that my program either ignored that IP or issued a warning or error. At least until I'd had a chance to see what changed.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      What if the addition was:

      <ip note="UNDER NO CIRCUMSTANCES USE THIS IP ON PAIN OF SUBSTANTIAL LEGAL REPRISALS; INCLUDING EXTRADITION AND LIFE IMPRISONMENT">67.215.65.132</ip>

      which your LibXML program will blithely process in just the same way as every other IP it finds

      And your XML::Simple example with NoAttr => 1 will also blithely process in just the same way as every other IP it finds. What exactly was your point?

        . What exactly was your point?

        I had to add that configuration option, having encountered an anomaly, before it would make that mistake.

        LibXML code wouldn't notice the sudden additional attribute and would process that IP silently.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?