XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Posed. Why does distinct-values not yield distinctvalues on a non-atomized sequence

Hi Ihe,

    (
      <benefitStartDate>20170101</benefitStartDate>,<benefitEndDate>20170301</benefitEndDate>,
      <benefitStartDate>20170101</benefitStartDate>,<benefitEndDate>20170501</benefitEndDate>
    )/distinct-values(.)

is not the same as:

    distinct-values(
      <benefitStartDate>20170101</benefitStartDate>,<benefitEndDate>20170301</benefitEndDate>,
      <benefitStartDate>20170101</benefitStartDate>,<benefitEndDate>20170501</benefitEndDate>
    )

Which returns the distinct-values for a sequence of elements.

Your code returns the distinct-values for each of these (singleton) elements, it is like calling:

    (
      distinct-values(<benefitStartDate>20170101</benefitStartDate>),
      distinct-values(<benefitEndDate>20170301</benefitEndDate>),
      distinct-values(<benefitStartDate>20170101</benefitStartDate>),
      distinct-values(<benefitEndDate>20170501</benefitEndDate>)
    )


Another variant, that returns the result you expected is:

    (
      <benefitStartDate>20170101</benefitStartDate>,<benefitEndDate>20170301</benefitEndDate>,
      <benefitStartDate>20170101</benefitStartDate>,<benefitEndDate>20170501</benefitEndDate>
    ) => distinct-values()


Best

Michael

Am 27.08.2017 um 13:09 schrieb Ihe Onwuka <ihe.onwuka@gmail.com>:




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS