Project

Profile

Help

Compile error transforming xs:positiveInteger

Added by Anonymous about 17 years ago

Legacy ID: #4370352 Legacy Poster: jon (jonfaust)

I get a tranformation compile error compiling a transformation with type xs:positiveInteger. If I change it to xs:integer, then everything is fine, but I'd prefer not to have to use some hack workaround. I haven't looked at the SAXON code yet, but has anyone else encountered this? Jon Details: SAXON 8.9.0.1 Schema (input and output): <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="root"> <xs:complexType> <xs:sequence> <xs:element name="Value1" type="xs:positiveInteger"/> <xs:element name="Value2" type="xs:positiveInteger"/> <xs:element name="Value3" type="xs:positiveInteger"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Sample Input file: <root xsi:noNamespaceSchemaLocation="SourceSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Value1>10</Value1> <Value2>12</Value2> <Value3>14</Value3> </root> Transform xslt: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="fn xs"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> <xsl:template match="/root"> <root> <xsl:attribute name="xsi:noNamespaceSchemaLocation">C:/DOCUME~1/jon.faust/MYDOCU~1/Example/SourceSchema.xsd</xsl:attribute> <xsl:for-each select="Value3"> <xsl:variable name="VmarkerloopValue3" select="."/> <Value1> <xsl:value-of select="xs:positiveInteger( fn:number( $VmarkerloopValue3 ) )"/> </Value1> </xsl:for-each> <xsl:for-each select="Value1"> <xsl:variable name="VmarkerloopValue1" select="."/> <Value2> <xsl:value-of select="xs:positiveInteger( fn:number( $VmarkerloopValue1 ) )"/> </Value2> </xsl:for-each> <xsl:for-each select="Value2"> <xsl:variable name="VmarkerloopValue2" select="."/> <Value3> <xsl:value-of select="xs:positiveInteger( fn:number( $VmarkerloopValue2 ) )"/> </Value3> </xsl:for-each> </root> </xsl:template> </xsl:stylesheet>


Replies (1)

RE: Compile error transforming xs:positiveInt - Added by Anonymous about 17 years ago

Legacy ID: #4370439 Legacy Poster: Michael Kay (mhkay)

Saxon-B meets the conformance requirements for a Basic XSLT Processor http://www.w3.org/TR/xslt20/#basic-conformance which is required to signal an error if you use the type xs:positiveInteger. To use this type, you will have to use Saxon-SA.

    (1-1/1)

    Please register to reply