Hi Monks,

The code shown in Re: Removing duplicate subtrees from XML works very well with the data shown in this posting. But with my data (as below)

<species name = "hs"> <sequence id = "1" title = "chromosome 1"> <genome_feature type = "CDS"> <gene id = "01"> <gene_seq number = "1"></gene_seq> </gene> </genome_feature> </sequence> </species> <species name = "hs"> <sequence id = "1" title = "chromosome 1"> <genome_feature type = "CDS"> <gene id = "17"> <gene_seq number = "2"></gene_seq> </gene> </genome_feature> </sequence> </species>
I get the following error messages:
bash-2.05$ perl perl_monks_F.pl sorted doc generation NOK: expected: <species name = "hs"> <sequence id = "1" title = "chromosome 1"> <genome_feature type = "CDS"> <gene id = "17"> <gene_seq number = "2"></gene_seq> </gene> </genome_feature> </sequence> </species> found: <species name="hs"> <sequence id="1" title="chromosome 1"> <genome_feature type="CDS"> <gene id="01"> <gene_seq number="1"></gene_seq> </gene> </genome_feature> </sequence> </species> Use of uninitialized value in substitution (s///) at perl_monks_F.pl l +ine 143, <DATA> chunk 2. Use of uninitialized value in substitution (s///) at perl_monks_F.pl l +ine 144, <DATA> chunk 2. Use of uninitialized value in substitution (s///) at perl_monks_F.pl l +ine 145, <DATA> chunk 2. Use of uninitialized value in string eq at perl_monks_F.pl line 50, <D +ATA> chunk 2. Use of uninitialized value in concatenation (.) or string at perl_monk +s_F.pl line 56, <DATA> chunk 2. merged doc generation NOK: expected: found: <species name="hs"> <sequence id="1" title="chromosome 1"> <genome_feature type="CDS"> <gene id="01"> <gene_seq number="1"></gene_seq> </gene> </genome_feature> </sequence> </species> bash-2.05$

Alterations that I made to the provided script were the addition of a few ErrorContext => 1 statements. And I have tested these slight alterations with the data used in the top posting link.


In reply to XML::Twig by matth

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.