[xquery-talk] [saxon] getting around the built in type restriction of a Basic XSLT processor

Ihe Onwuka ihe.onwuka at gmail.com
Mon Dec 1 00:13:47 PST 2014


ah hah... the regex needs to start with a ^ and is '^\i\c*'

On Mon, Dec 1, 2014 at 8:06 AM, Ihe Onwuka <ihe.onwuka at gmail.com> wrote:

>
> On Sun, Nov 30, 2014 at 10:32 PM, Michael Kay <mike at saxonica.com> wrote:
>
>> The XSLT 2.0 spec restricts the set of types available in a
>> non-schema-aware processor. Schema awareness comes only with Saxon-EE.
>>
>> The extension attribute saxon:allow-all-built-in-types removes the
>> restriction (making the processor non-conformant), but like all extensions
>> in the Saxon namespace, it is available only with Saxon-PE or higher.
>>
>> If it's only the castable test you are after, you could use matches(.,
>> '\i\c*')
>>
>>
> This returns true for matches('1880s','\i\c*') in Saxon XSLT and Zorba.
>
>
>> On 30 Nov 2014, at 20:28, Ihe Onwuka <ihe.onwuka at gmail.com> wrote:
>>
>> I have a sequence of keywords which I would like to create as empty
>> elements if their content constitutes a valid element name but I cannot
>> execute the following because of the above restriction that prevents the
>> comparison to xs:NCName
>>
>> Code is below.
>>
>>         <xsl:for-each select="tokenize(substring-after(.,'	'),'\t')">
>>           <xsl:choose>
>>             <xsl:when test=". castable as xs:NCName">
>>               <xsl:element name="{.}"/>
>>             </xsl:when>
>>             <xsl:otherwise>
>>               <keyword name="{.}"/>
>>             </xsl:otherwise>
>>          </xsl:for-each>
>>
>> I have tried the allow-all-built-in-types saxon attribute and that hasn't
>> worked.
>>
>> Any other suggestions.
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20141201/ec2f0ad1/attachment.html>


More information about the talk mailing list