You can either write your program to check whether a value is a reference or not, using ref or you can provide parameters to XML::Simple to make it load the elements and tags consistently. Which approach is better will depend on what you are doing. You may want to learn both methods so you can decide which is most appropriate.

I will create a check whether it is a reference or not. Will look into this right now and will keep you (guys) posted. Providing parameters to XML::Simple is not an option because I want to create a script that runs universal. Both on element depth and on attributes. So the reusability will be high.

@ grandfather: thank you for the suggestion, but you use indent size = 4. This can be variable. I will write the complete script using XML::Simple cause it feels so simple :) (after a lot of coarsing by this perl newbie). This will also mean that the for loops for $Sub1 2, 3, 4 will need to be put in a loop aswell. Probably together with the 'ref' method

Keeping you guys posted

Sporti

PS: For whom is interested, the excel part will be multiple worksheets with data from various tags and elements in a table style


In reply to Re^4: XML Attribute vs Element by Sporti69
in thread XML Attribute vs Element by Sporti69

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.