Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT 2.0 space separated list type access with Saxon 9.1 -sa -val >Thread Next - Re: XSLT 2.0 space separated list type access with Saxon 9.1 -sa -val Re: XSLT 2.0 space separated list type access with Saxon 9.1 -sa -valTo: NULL Date: 2/6/2009 5:08:00 AM On 6 Feb., 13:34, Martin Honnen <mahotr...@yahoo.de> wrote:
> RolfK wrote:
> > Basically I imagine to do something like this to do this:
> > <xsl:variable select=3D"Agenda/@CSSColorNames[position()=3D2]"/>
>
> I think using the data function gives you the typed value so doing e.g.
> =A0 =A0data(Agenda/@CSSColorNames)[2]
> should work to access the second item in the list that is the typed
> value of the CSSColorNames attribute.
>
> --
>
> =A0 =A0 =A0 =A0 Martin Honnen
> =A0 =A0 =A0 =A0http://JavaScript.FAQTs.com/
Martin,
thanks a lot! This workes fine.
It is still not clear to me why e.g. $vAgenda/@CSSColorNames[position()
=3D2] does not lead to the same result !?
Regarding the type I tried to declare the type bt the "as" attribute.
But this does not work. I have defined the complex type in my schema
as shown.
But how to use it in xslt?
Do I have to import the schema ?
<xsl:stylesheet version=3D"2.0" xmlns:mgt=3D"MarginTable" ......
<xsl:import-schema namespace=3D"MarginTable" schema-location=3D"../_xsd/
MarginTable.xsd"/>
<xsl:template match=3D"/">
<xsl:variable name=3D"vColorNames" select=3D"$vAgenda/@CSSColorNames"
as=3D"mgt:tCSSColorNames"/>
....
Saxon shows this error:
XPST0051: SequenceType syntax error at char 0 in {mgt:tCSSColorNames}:
Type (mgt:tCSSColorNames) is a list or union type
How to declare it correctly ?
Thanks a lot for your help
Rolf
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
