Best way to group data (in XML)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jehugaleahsa@gmail.com

    Best way to group data (in XML)

    Hello:

    I have an XML file that contains records with a Date attribute. I
    would like to group all the records together with a particular date,
    so that I can later iterate over the different dates to calculate
    information based on the contained records.

    So, for instance, I have sales records for every day in the year, I
    would like to calculate the total sales for each week in the year. So
    I need to be able to group by weeks. Is there a tool for XML that will
    allow me to group like this?

    Thanks,
    Travis
  • Martin Honnen

    #2
    Re: Best way to group data (in XML)

    jehugaleahsa@gm ail.com wrote:
    I have an XML file that contains records with a Date attribute. I
    would like to group all the records together with a particular date,
    so that I can later iterate over the different dates to calculate
    information based on the contained records.
    >
    So, for instance, I have sales records for every day in the year, I
    would like to calculate the total sales for each week in the year. So
    I need to be able to group by weeks. Is there a tool for XML that will
    allow me to group like this?
    XSLT 2.0 or XQuery are languages to perform the grouping. Saxon 9 from
    <http://saxon.sourcefor ge.net/implements both XSLT 2.0 and XQuery and
    has a .NET version.
    Grouping can also be done with XSLT 1.0 where the .NET framework has an
    implementation with System.Xml.Xsl. XslCompiledTran sform.

    --

    Martin Honnen --- MVP XML

    Comment

    • jehugaleahsa@gmail.com

      #3
      Re: Best way to group data (in XML)

      On Feb 9, 10:50 am, Martin Honnen <mahotr...@yaho o.dewrote:
      jehugalea...@gm ail.com wrote:
      I have an XML file that contains records with a Date attribute. I
      would like to group all the records together with a particular date,
      so that I can later iterate over the different dates to calculate
      information based on the contained records.
      >
      So, for instance, I have sales records for every day in the year, I
      would like to calculate the total sales for each week in the year. So
      I need to be able to group by weeks. Is there a tool for XML that will
      allow me to group like this?
      >
      XSLT 2.0 or XQuery are languages to perform the grouping. Saxon 9 from
      <http://saxon.sourcefor ge.net/implements both XSLT 2.0 and XQuery and
      has a .NET version.
      Grouping can also be done with XSLT 1.0 where the .NET framework has an
      implementation with System.Xml.Xsl. XslCompiledTran sform.
      >
      --
      >
              Martin Honnen --- MVP XML
             http://JavaScript.FAQTs.com/
      Thanks. I have an implementation using the xsl:key element with XSLT.
      I will stick with that. I think I will look at XQuery while I'm at it.

      Thanks again,
      Travis

      Comment

      Working...