Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSLT 2.0 space separated list type access with Saxon 9.1 -sa -val

From: RolfK <Rolf.Kemper@--.-----.--->
To: 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


transparent
Print
Mail
Like It
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.

.
.

transparent

transparent