Altova Mailing List Archives


XML to XML: group depending on two atriutes (Urgent)

From: "Filipe" <filipepereira@-------.--->
To: NULL
Date: 10/3/2003 4:11:00 AM
Hi all,
This is a urgent situation. I=B4m counting on you guys to=20
give some clue to get the right XSL Transformation.
I need do group all nested tags <Entry> inside tag=20
<Record> according to an unique combination of two=20
atributes ('Product' and 'Customer'). Something like: for=20
each concatenation of 'Product' and 'Customers' find all=20
<Entry> because this last tag as different 'Periods'

ORIGINAL XML (with lots of <Records>):

<HistoricSales>
<Record Product=3D"1053865" Customer=3D"10127876">
  <Entry Period=3D"6">
    <Units Sold=3D"0" Free=3D"0" Return=3D"0"/>
    <Amounts Cost=3D"0" Gross=3D"0" Return=3D"0"/>
  </Entry>
</Record>
<Record Product=3D"1053865" Customer=3D"10127876">
  <Entry Period=3D"2">
    <Units Sold=3D"0" Free=3D"0" Return=3D"0"/>
    <Amounts Cost=3D"0" Gross=3D"0" Return=3D"0"/>
  </Entry>
</Record>
<Record Product=3D"1022222" Customer=3D"0999999">
  <Entry Period=3D"3">
    <Units Sold=3D"0" Free=3D"0" Return=3D"0"/>
    <Amounts Cost=3D"0" Gross=3D"0" Return=3D"0"/>
  </Entry>
</Record>
(...)
</HistoricSales>

FINAL XML:

<HistoricSales>
<Record Product=3D"1053865" Customer=3D"10127876">
  <Entry Period=3D"6">
    <Units Sold=3D"0" Free=3D"0" Return=3D"0"/>
    <Amounts Cost=3D"0" Gross=3D"0" Return=3D"0"/>
  </Entry>
  <Entry Period=3D"2">
    <Units Sold=3D"0" Free=3D"0" Return=3D"0"/>
    <Amounts Cost=3D"0" Gross=3D"0" Return=3D"0"/>
  </Entry>
</Record>
<Record Product=3D"1022222" Customer=3D"0999999">
  <Entry Period=3D"3">
    <Units Sold=3D"0" Free=3D"0" Return=3D"0"/>
    <Amounts Cost=3D"0" Gross=3D"0" Return=3D"0"/>
  </Entry>
</Record>
(...)
</HistoricSales>

At this moment I trying Muenchian Method. Is this the=20
best way. Thanks in advance.


Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.