in reply to Re: Perl panicking XML::LibXML::Reader copyCurrentNode (updated)
in thread Perl panicking XML::LibXML::Reader copyCurrentNode

Thank you for your feedbacks. While I was preparing a snippet of my input data, I discovered the following: if I delete from my input file the first two lines

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE martif SYSTEM "TBXcoreStructV02.dtd">

my Perl doesn't crash. (My XML-LibXML: 2.0125). Is this normal?

ADDED: actually it is the second line which causes Perl to crash...as I do not have any TBXcoreStructV02.dtd, how can I jump this line? As the XML is huge, I do not want to manipulate it.

  • Comment on Re^2: Perl panicking XML::LibXML::Reader copyCurrentNode (updated)
  • Download Code

Replies are listed 'Best First'.
Re^3: Perl panicking XML::LibXML::Reader copyCurrentNode
by haukex (Archbishop) on Apr 30, 2018 at 13:49 UTC
    Is this normal?

    Nope :-)

    As with choroba, even with the DTD, it works for me.

    as I do not have any TBXcoreStructV02.dtd, how can I jump this line? As the XML is huge, I do not want to manipulate it.

    Well, you could add load_ext_dtd=>0 to the XML::LibXML::Reader constructor, but that's really just a workaround, and I can't even say if it'll help fix your crashes. The better solutions would be to either obtain the right file(s), and fix the crashes overall, such as by trying to upgrade your libraries.

    BTW, since you just added that in a third edit to your node, please see How do I change/delete my post? to avoid confusion.

      Brilliant. Turning off the validation works for now.

      Sorry for my bad editing... today I am really under big pressure!

Re^3: Perl panicking XML::LibXML::Reader copyCurrentNode (updated)
by choroba (Cardinal) on Apr 30, 2018 at 13:40 UTC
    I downloaded the DTD from ttt.org in order to run the script (with the data shown in my previous reply), but it still doesn't crash.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,