I'm trying to learn how to use a XSL stylesheet after creating my XML file with XML::twig, but I think my end desire is a little too complicated for a begineer. Perhaps the XML file should be reordered. Looking at it now I think condensing the elements into attributes instead of children of the node was probably a big mistake. I would like a fresh view on the following...

I have this xml file, which I am trying to generate a table in html format.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <Volumetrics> <VolumeReport Name="v_example.gri" Version="1.0"> <CellSize CellSizeX="500.000" CellSizeY="500.000" Refinement="10"> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>147977918</CumulativeVol> </CellSize> <CellSize CellSizeX="500.000" CellSizeY="500.000" Refinement="4"> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>147751938</CumulativeVol> </CellSize> <CellSize CellSizeX="1000.000" CellSizeY="1000.000" Refinement="10 +"> <runtime units="seconds">8</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>134856090</CumulativeVol> </CellSize> <CellSize CellSizeX="1000.000" CellSizeY="1000.000" Refinement="4" +> <runtime units="seconds">9</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>134324000</CumulativeVol> </CellSize> <VolumeReport Name="south.gri" Version="1.0"> <CellSize CellSizeX="10.000" CellSizeY="10.000" Refinement="4"> <runtime units="seconds">7</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>125970002642</CumulativeVol> </CellSize> </VolumeReport> <VolumeReport Name="v_example.gri" Version="2.0"> <CellSize CellSizeX="500.000" CellSizeY="500.000" Refinement="10"> <runtime units="seconds">12</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>147977918</CumulativeVol> </CellSize> <CellSize CellSizeX="500.000" CellSizeY="500.000" Refinement="4"> <runtime units="seconds">10</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>147751938</CumulativeVol> </CellSize> <CellSize CellSizeX="1000.000" CellSizeY="1000.000" Refinement="10 +"> <runtime units="seconds">8</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>134880540</CumulativeVol> </CellSize> <CellSize CellSizeX="1000.000" CellSizeY="1000.000" Refinement="4" +> <runtime units="seconds">10</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>134324000</CumulativeVol> </CellSize> <VolumeReport Name="south.gri" Version="2.0"> <CellSize CellSizeX="10.000" CellSizeY="10.000" Refinement="4"> <runtime units="seconds">8</runtime> <VolumeUnits id="m3">Cubic Metres</VolumeUnits> <CumulativeVol>125970002642</CumulativeVol> </CellSize> </VolumeReport> </Volumetrics>

I desire my html to be a number of tables on the webpage. There should be a new table for each @Name, and new header rows for each different @Version. The rows should be the different CellSize/@CellSizeX and CellSize/@CellSizeY and the columns should be made up of CellSize/@Refinement,runtime and CumulativeVol. I desire these tables:
v_example.griGrid Refinements
Version 15.5410
CellSize Runtime Volume Runtime Volume
(500.000,500.000) 10 147751938 12 147977918
(1000.000,1000.000) 10 134856090 8 134472204
v_example.griGrid Refinements
Version 16.0410
CellSize Runtime Volume Runtime Volume
(500.000,500.000) 10 147751938 12 147977918
(1000.000,1000.000) 10 134324000 8 134880540

south.griGrid Refinements
Version 15.5410
CellSize Runtime Volume Runtime Volume
(10.000,10.000) 6 125970002642
south.griGrid Refinements
Version 16.0410
CellSize Runtime Volume Runtime Volume
(10.000,10.000) 8 125970002642

My XSL stylesheet is a slightly modified example off the internet, it doesn't even get close to producing the above so I don't think it would be very useful to post it here.

Firstly, should I reorder my XML?

Secondly, is there a kind soul out there who could show me what my stylesheet should look like?


In reply to XML to XHTML table by bladestonight

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.