Michel,

Respectfully we all know you have a bee in your bonnet about the DOM ;-). But regardless of the problems processing XML with the DOM brings up, I'm not entirely sure that covering those problems in the presented code would be the best way to do it -- I can't stand books that present massively long examples -- I'd much rather be given something simple I can build on. Perhaps a box-out would be better though. I haven't read this book yet, but I will be sure to suggest that to Ilya as a change for the second edition.

As far as encodings go, I seem to recall reading that the book covers this by simply stating that all XML parsers return their data in UTF-8, regardless of the input encoding, but then I've only flicked through it on the bookshelves so I can't be sure. I get the feeling that because XML::Twig deals with the encodings issue by messing with the original_string (which is possibly scarier than the alternatives of just leaving things in UTF-8) that you think it's terribly important that this be covered in detail, when I think that in the majority of situations people need to come out of their encoding-specific shells and get used to the world of unicode. I'd treat someone coding in perl4 style the same way.

Regarding discussing why you would want to use XSLT, I'd rather keep this out of a technical book. This is a wishy washy issue, and I'd rather just get into the code, thanks. I guess mileage varies on this - personally I prefer nutshell-style books that just get down and dirty without any discussion of the whys.

Overall I think your response is rather damning of what is a much better book than "Perl and XML" from O'Reilly, and given the choice of the two I'd pick this book any day.

All, respectfully, IMHO ;-)


In reply to Re: Re: XML and Perl by Matts
in thread XML and Perl by davorg

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.