Project

Profile

Help

xs:long not supported??? saxon-b problem

Added by Anonymous over 16 years ago

Legacy ID: #4466323 Legacy Poster: mark salisbury (gonar)

I am trying to use Saxon-B to process xslt2 generated by altova MapForce below is the output of a trial run and the relevant source code, xs:long seems a bit trivial to be unsupported, so I am assuming I have done something wrong, any pointers? I get the exact same error in Saxon-SA here is the command and first few lines of output, the other 200 lines are more of the same: $ java -jar saxon8.jar -t input.xml rules.xsl > output.xml Saxon 8.9.0.4J from Saxonica Java version 1.5.0_11 Error at xsl:value-of on line 20 of file:/c:/Program%20Files/saxonsa/rules.xsl: XPST0080: XPath syntax error at char 36 on line 20 in {...g( fn:number( $Vvar1_CONST ...}: The type xs:long is not recognized by a Basic XSLT Processor. Error at xsl:value-of on line 29 of file:/c:/Program%20Files/saxonsa/rules.xsl: XPST0080: XPath syntax error at char 49 on line 29 in {... $Vvar7_RESULTOF_xsinteger ...}: The type xs:long is not recognized by a Basic XSLT Processor. here is the relevant source code: 01 <?xml version="1.0" encoding="UTF-8"?> 02 <!-- 03 This file was generated by Altova MapForce 2007r3sp1 04 05 YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE 06 OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION. 07 08 Refer to the Altova MapForce Documentation for further details. 09 http://www.altova.com/mapforce 10 --> 11 <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"> 12<xsl:output method="xml" encoding="UTF-8" indent="yes"/> 13<xsl:template match="/AircraftCollectionTaskingMessage"> 14<RadarServiceRequest> 15<xsl:attribute name="xsi:noNamespaceSchemaLocation">C:/DOCUME~1/XXXXX/MYDOCU~1/schemas/XXXXX.xsd</xsl:attribute> 16<XXXXXXXX_t> 17<sXXXXHeader> 18<xsl:variable name="Vvar1_CONST" select="1097752"/> 19<lMessageID> 20<xsl:value-of select="xs:long( fn:number( $Vvar1_CONST ) )"/> 21</lMessageID> 22<sMessageTime> 23<xsl:for-each select="XXXXXXMetadata"> 24<xsl:for-each select="TaskGenerationTimestamp"> 25<xsl:variable name="VmarkerloopTaskGenerationTimestamp" select="."/> 26<xsl:variable name="Vvar6_RESULTOF_yearfromdateTime" select="fn:year-from-dateTime(xs:dateTime( $VmarkerloopTaskGenerationTimestamp ))"/> 27<xsl:variable name="Vvar7_RESULTOF_xsinteger" select="xs:integer(fn:string( $Vvar6_RESULTOF_yearfromdateTime ))"/> 28<lGregorianYear> 29<xsl:value-of select="xs:long( fn:number( $Vvar7_RESULTOF_xsinteger ) )"/> 30</lGregorianYear> 31</xsl:for-each>


Replies (14)

Please register to reply

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

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

The two products Saxon-B and Saxon-SA correspond to the two conformance levels defined in the XSLT 2.0 specification, "basic" and "schema-aware". The basic conformance level does not allow derived types like xs:long. There's a workaround for this in Saxon, though it's on the borderlines of what the conformance rules permit: saxon:allow-all-built-in-types="yes" http://www.saxonica.com/documentation/extensions/attributes/allowallbuiltintypes.html If you set this attribute, xs:long will be recognized. If you want to be fully conformant, you should process this stylesheet using a schema-aware XSLT processor.

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

Legacy ID: #4466359 Legacy Poster: mark salisbury (gonar)

ok, so how come when I run it in saxon-SA (using the eval license you just sent me ( thanks! :-) ) I get the same error? is there a flag I must set or an arg I must pass in SA?

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

Legacy ID: #4466373 Legacy Poster: mark salisbury (gonar)

I get the same results regardless of weather I use Saxon B or SA (here is a saxon-B example) $ java -jar saxon8.jar -t input.xml rules.xsl > output.xml Saxon 8.9J from Saxonica Java version 1.5.0_11 Error on line 11 column 297 of file:/c:/Program%20Files/saxon/rules.xs l: SXXP0003: Error reported by XML parser: The prefix "saxon" for attribute "saxon:allow-all-built-in-types" associated with an element type "xsl:styleshe et" is not bound. Failed to compile stylesheet. 1 error detected.

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

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

To run Saxon-SA in schema-aware mode, use the -sa flag on the command line.

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

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

Firstly, saxon8.jar is Saxon-B, even if you got it as part of the Saxon-SA package. You need to run saxon8sa.jar and to use the -sa option (or the com.saxonica.Transform entry point). Secondly: you can't use a Saxon extension attribute unless you declare the Saxon namespace. That's basic XML hygiene. The namespace is http://saxon.sf.net/ Michael Kay http://www.saxonica.com/

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

Legacy ID: #4466454 Legacy Poster: mark salisbury (gonar)

sorry for being a noob. this is my first XML project. so now it says: Failed to load Main-Class manifest attribute from saxon8sa.jar I really want this to work, so that I can tell my boss to buy a copy for my project.

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

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

Please read (a) http://www.saxonica.com/documentation/using-xsl/commandline.html for a description of how to use Saxon XSLT from the command line, and (b) http://www.saxonica.com/documentation/index/installationjava/licensefaq.html for some of the things that go wrong if you don't read (a) carefully enough. Michael Kay Saxonica

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

Legacy ID: #4466980 Legacy Poster: mark salisbury (gonar)

ok, read those and many more. still no joy. here is my latest command line: C:\saxonsa> java -cp c:\saxonsa\saxon-license.lic;c:\saxonsa\saxon8sa.jar -t inp ut.xml rules.xsl > output.xml Unrecognized option: -Xt Could not create the Java virtual machine. can you please just give me an example command line that should work assuming the following things: saxon-SA, the licence file, all xml, xsl and xsd files are in the same dir

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

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

if both the license file and the saxon8sa.jar are in c:\saxonsa, you need java -cp c:\saxonsa;c:saxonsa\saxon8sa.jar net.sf.saxon.Transform -sa -t source.xml style.xsl Michael Kay

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

Legacy ID: #4468175 Legacy Poster: mark salisbury (gonar)

:-( C:\saxonsa>java -cp c:\saxonsa;c:saxonsa\saxon8sa.jar net.sf.saxon.Transform -sa -t input.xml rules.xsl Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/saxon/Transfor m this is getting to be a big pain.

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

Legacy ID: #4468200 Legacy Poster: mark salisbury (gonar)

progress? or just different failure. C:\saxonsa>set classpath=c:\saxonsa;c:\saxonsa\saxon8sa.jar C:\saxonsa>java -cp saxon8sa.jar net.sf.saxon.Transform -sa -t input.xml rules.x sl Exception in thread "main" java.lang.RuntimeException: License file saxon-licens e.lic not found at com.saxonica.validate.JavaVerifier.loadLicense(JavaVerifier.java:48) at com.saxonica.validate.PlatformVerifier.getFeature(PlatformVerifier.ja va:63) at com.saxonica.validate.SchemaAwareConfiguration.getFeature(SchemaAware Configuration.java:85) at com.saxonica.validate.SchemaAwareConfiguration.isSchemaAware(SchemaAw areConfiguration.java:104) at net.sf.saxon.Transform.doTransform(Transform.java:126) at net.sf.saxon.Transform.main(Transform.java:60)

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

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

Sorry, I mistyped, that should be java -cp c:\saxonsa;c:\saxonsa\saxon8sa.jar net.sf.saxon.Transform -sa -t input.xml rules.xsl The message from Java (NoClassDefFoundError) is what you get when you invoke a class that isn't on the classpath. There's no error from having a file on the classpath that doesn't exist, so you learn to recognize that this message means a typing error in the classpath.

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

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

>License file saxon-license.lic not found As explained on the troubleshooting page, this means that the directory containing the license file isn't on the classpath.

RE: xs:long not supported??? saxon-b problem - Added by Anonymous over 16 years ago

Legacy ID: #4468351 Legacy Poster: mark salisbury (gonar)

finally, it works. thanks! now that i can see it work from the command line, I can start integrating it into an app.

    (1-14/14)

    Please register to reply