[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: strong typed variable with restriction ?

Subject: Re: strong typed variable with restriction ?
From: Matthieu Ricaud-Dussarget <matthieu.ricaud@xxxxxxxxx>
Date: Wed, 02 Feb 2011 12:23:37 +0100
Re:  strong typed variable with restriction ?
Hi Martin,

I use Saxon9 HE.

But I have to say the code I sent in this mail is a simplified version of the real one.
I thought it is the same problem but after what you say, I have to test this more.

This is actually a variable within the function which is typed as element() (not the function itself)

This is my real function (see the FIXME) :

<xsl:function name="igs:get-css-rule" as="element()*">
<xsl:param name="e" as="element()"/>
<xsl:param name="csspath" as="xs:string"/>
<xsl:param name="mode" as="xs:string"/><!--(override|not-override)-->
<xsl:param name="css" as="xs:string"/><!--(csstidy|css)-->
<xsl:variable name="class" select="string($e/@class)" as="xs:string"/>
<xsl:variable name="css" as="element()">
<!--FIXME : would works with element()* here -->
<xsl:when test="$css='csstidy'">
<xsl:sequence select="igs:get-css-tidy($csspath,$mode)"/>
<xsl:when test="$css='css'">
<xsl:sequence select="igs:get-css($csspath)"/>
<xsl:if test="$e/@class='nt' and $e='Attention'">
<xsl:message>css=<xsl:copy-of select="$css"/></xsl:message>
<xsl:when test="$mode='both'">
<xsl:sequence select="igs:get-css-rule($e,$csspath,'override',$css)"/>
<xsl:sequence select="igs:get-css-rule($e,$csspath,'not-override',$css)"/>
<xsl:when test="$mode='override'">
<xsl:variable name="classOver" select="igs:get-class-over($e)" as="xs:string"/>
<xsl:variable name="selector" select="concat(if (name($e)='p') then () else (name($e)),'.',$classOver)"/>
<xsl:sequence select="$css/igs:rule[@selector=$selector]"/>
<xsl:when test="$mode='not-override'">
<xsl:variable name="classIndd" select="igs:get-class-indd($e)" as="xs:string"/>
<xsl:variable name="selector" select="concat(if (name($e)='p') then () else (name($e)),'.',$classIndd)"/>
<xsl:sequence select="$css/igs:rule[@selector=$selector]"/>

Le 02/02/2011 12:14, Martin Honnen a icrit :
Matthieu Ricaud-Dussarget wrote:

I don't really want to return an error node that I'll have to test
afterwards, at best I'd like the xslt processor to raise this error for
me when the passed param has not the good value.

I tried to reproduce the issue with XQSharp and AltovaXML Tools but I couldn't.
Which XSLT processor gives the error?

Matthieu Ricaud
Service Livre numirique

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.