Thx for the replies. I tried with your code and yes it gets all BaseItemid but now it gets printed 16 times , 1 for each Invoice record. Is there anyway to make the code only print the coresponding BaseItemids. And not run trough the whole file each time. Or do i have to edit somwhat in the xml to achive this. Ill try explain.. I want to print all the info from the xml, not just the BaseItemIds, so that it gets this output.

Invoice1 (with all childs,all saved to string)

Invoice2

Invoice3

This is how it works Now (wich is a mess, As i cant tell wich BaseItemId(s) Belong to wich Invoice record.

Invoice1

BaseItemIds (x 16)

Invoice2

BaseItemIds (x 16)

------------

-------------

Been looking at a endless amount of torturials & stuff, really banging my head here :/

In reply to Re^2: Problems with multiple records in xml file , Xpath by joppei
in thread Problems with multiple records in xml file , Xpath by joppei

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.