Re: Pattern matching error in xsl:key

Ihe Onwuka <[email protected]>
Newsgroups gmane.text.xml.saxon.help,gmane.text.xml.xsl.general.mulberrytech
Message-ID <CALfs7+zGdoU0AnNrs0EX5H5St3DRd=7Z=GXpVPqBrZSYax5npA@mail.gmail.com>
Not using schema aware XSLT and the values concerned are version numbers
and should be treated as strings.

On Sat, Sep 5, 2020 at 1:07 PM Martin Honnen <[email protected]> wrote:

> On 05.09.2020 18:28, Ihe Onwuka wrote:
>
> >      > I am comparing parameters whose values are 4.0 and 4.1
> >     respectively to
> >      > attributes whose values are 4.0 and 4.1 respectively. Saxon has
> made
> >      > it's own assumptions about what types they are and come up with
> >     that error.
> >
> >     The types are not made up by Saxon but are defined in the XPath/XSLT
> >     specs. In the XSLT code if you declare
> >
> >         <xsl:param name="source" select="4.0"/>
> >
> >     the expression 4.0 in the select attribute is of type xs:decimal (in
> a
> >     version="2.0" or version="3.0" XSLT code).
> >
> >     However, in your untyped XML the attribute value of e.g. @from or
> @to is
> >     of type xs:untypedAtomic.
> >
> >
> > Illuminating.
> > So if we come up from the weeds of the spec you've basically got a
> > situation where the spec is assigning different types to the same
> > identical value because they are placed in different constructs.
> > So while being correct it's not a very good explanation to have to give.
> >
> > Note that AFAIA aware at least I cannot supply type information for
> > the @from and @to attributes in the context in which they are being used.
>
> With schema-aware XSLT and Saxon EE you can define a schema declaring
> the type of the attributes as xs:decimal and then using eq to compare to
> your variables of type xs:decimal will work.
>
>
>
>
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/saxon-help

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.