Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 

Go Back   XSL - XML - RSS Forums > XSLForum: Main > XSL Coding General

Tags:



Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-02-2008, 02:05 PM
Susan Harris
 
Posts: n/a

Default XSLT 2.0 under .NET



Are there any powerful native .NET royalty free solution for working with
XSLT 2.0? The Altova engine uses a COM object, which I prefer not to deploy,
and the basic Saxon parser can't handle xsl:sequence, etc. And it doesn't
look like you can distribute the commerical one freely.

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-02-2008, 02:05 PM
Martin Honnen
 
Posts: n/a

Default Re: XSLT 2.0 under .NET

Susan Harris wrote:
> Are there any powerful native .NET royalty free solution for working
> with XSLT 2.0? The Altova engine uses a COM object, which I prefer not
> to deploy, and the basic Saxon parser can't handle xsl:sequence, etc.
> And it doesn't look like you can distribute the commerical one freely.


Saxon is not a parser, it is an XSLT 2.0 and XQuery 1.0 engine. Saxon
uses the XML parser in the .NET framework or the Java runtime.

And I am sure the basic Saxon version can handle the XSLT 2.0
instruction xsl:sequence, otherwise it would not comply with the XSLT
2.0 specification. What the basic Saxon version does not support is
schema aware XSLT 2.0 or XQuery 1.0. What exactly do you think the basic
Saxon version does not support?

Otherwise I am afraid there are no current options for XSLT 2.0 under .NET.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Reply With Quote
  #3 (permalink)  
Old 10-02-2008, 02:05 PM
Susan Harris
 
Posts: n/a

Default Re: XSLT 2.0 under .NET

Sorry, I meant it was failing on xs:token, xsositiveInteger, etc. I
misread the error messages. Presumably the use of those requires the engine
to be schema aware?

"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:u$JrdyIJJHA.3424@TK2MSFTNGP05.phx.gbl...
> Susan Harris wrote:
>> Are there any powerful native .NET royalty free solution for working with
>> XSLT 2.0? The Altova engine uses a COM object, which I prefer not to
>> deploy, and the basic Saxon parser can't handle xsl:sequence, etc. And it
>> doesn't look like you can distribute the commerical one freely.

>
> Saxon is not a parser, it is an XSLT 2.0 and XQuery 1.0 engine. Saxon uses
> the XML parser in the .NET framework or the Java runtime.
>
> And I am sure the basic Saxon version can handle the XSLT 2.0 instruction
> xsl:sequence, otherwise it would not comply with the XSLT 2.0
> specification. What the basic Saxon version does not support is schema
> aware XSLT 2.0 or XQuery 1.0. What exactly do you think the basic Saxon
> version does not support?
>
> Otherwise I am afraid there are no current options for XSLT 2.0 under
> .NET.
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/


Reply With Quote
  #4 (permalink)  
Old 10-02-2008, 02:49 PM
Susan Harris
 
Posts: n/a

Default Re: XSLT 2.0 under .NET

Doing a search and replace in the xslt file as follows seems to work:

xs:token -> xs:string
xs:ID -> xs:string
xs:IDREF -> xs:string
xsositiveInteger -> xs:integer
xs:nonNegativeInteger -> xs:integer

Should that be safe, or am I creating problems for myself?

"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:u$JrdyIJJHA.3424@TK2MSFTNGP05.phx.gbl...
> Susan Harris wrote:
>> Are there any powerful native .NET royalty free solution for working with
>> XSLT 2.0? The Altova engine uses a COM object, which I prefer not to
>> deploy, and the basic Saxon parser can't handle xsl:sequence, etc. And it
>> doesn't look like you can distribute the commerical one freely.

>
> Saxon is not a parser, it is an XSLT 2.0 and XQuery 1.0 engine. Saxon uses
> the XML parser in the .NET framework or the Java runtime.
>
> And I am sure the basic Saxon version can handle the XSLT 2.0 instruction
> xsl:sequence, otherwise it would not comply with the XSLT 2.0
> specification. What the basic Saxon version does not support is schema
> aware XSLT 2.0 or XQuery 1.0. What exactly do you think the basic Saxon
> version does not support?
>
> Otherwise I am afraid there are no current options for XSLT 2.0 under
> .NET.
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/


Reply With Quote
  #5 (permalink)  
Old 10-02-2008, 02:49 PM
Martin Honnen
 
Posts: n/a

Default Re: XSLT 2.0 under .NET

Susan Harris wrote:
> Sorry, I meant it was failing on xs:token, xsositiveInteger, etc. I
> misread the error messages. Presumably the use of those requires the
> engine to be schema aware?


http://www.w3.org/TR/xslt20/#built-in-types lists the types a basic
processor supports. However with Saxon 9 you can set
http://www.saxonica.com/documentatio...ltintypes.html
to allow those types nevertheless with the basic processor.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Reply With Quote
  #6 (permalink)  
Old 10-02-2008, 08:40 PM
Susan Harris
 
Posts: n/a

Default Re: XSLT 2.0 under .NET

Thanks Martin. I'm trying to add this attribute (see below), but having
problems (e.g. XMLSpy doesn't like it where I've put it). Do you know where
I would place this attribute?

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:n="http://www.company.info/schemas"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
exclude-result-prefixes="fn n vmf xs xsi xsl">
<xsl:attribute name="saxon:allow-all-built-in-types">yes</xsl:attribute>
<xsl:template name="vmf:inputtoresult">
<xslaram name="input" select="()"/>
<xsl:choose>
<xsl:when test="$input='A'">



"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:Od2p5IJJJHA.716@TK2MSFTNGP04.phx.gbl...
> Susan Harris wrote:
>> Sorry, I meant it was failing on xs:token, xsositiveInteger, etc. I
>> misread the error messages. Presumably the use of those requires the
>> engine to be schema aware?

>
> http://www.w3.org/TR/xslt20/#built-in-types lists the types a basic
> processor supports. However with Saxon 9 you can set
> http://www.saxonica.com/documentatio...ltintypes.html
> to allow those types nevertheless with the basic processor.
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/


Reply With Quote
  #7 (permalink)  
Old 10-02-2008, 08:40 PM
Martin Honnen
 
Posts: n/a

Default Re: XSLT 2.0 under .NET

Susan Harris wrote:
> Thanks Martin. I'm trying to add this attribute (see below), but having
> problems (e.g. XMLSpy doesn't like it where I've put it). Do you know
> where I would place this attribute?
>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:n="http://www.company.info/schemas"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf"
> xmlns:fn="http://www.w3.org/2005/xpath-functions"
> exclude-result-prefixes="fn n vmf xs xsi xsl">


You need to put it on the xsl:stylesheet element e.g.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
saxon:allow-all-built-in-types="yes"
version="2.0">
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Contact Us -|- XSL - XML - RSS Forums -|- Archive -|- Top -|-Rules/Disclaimer-|-Help/Support -|-Advertise
© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
All times are GMT. The time now is 10:20 PM.
Style Developed by Epic Designz