Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 21st, 2006, 08:32 PM
Authorized User
 
Join Date: May 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do you have a link? thanks

 
Old May 22nd, 2006, 07:14 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If you mean you want a link to the Saxon 8.7 resources file:

http://prdownloads.sourceforge.net/s...sources8-7.zip

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 22nd, 2006, 08:36 AM
Authorized User
 
Join Date: May 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am doing transformation on .NET 1.1 using XslTransform with XPathDocument and xslstring will it do the same thing?

                using (MemoryStream mStream = new MemoryStream())
                {
                    XslTransform xsl = new XslTransform();
                    xsl.Load(XslFile);

                    //zk XsltArgumentList xslarg = new XsltArgumentList();
                    //zk Xslarg.AddParam("pageid", "", pageId);

                    xsl.Transform(XPDoc, null, mStream, null);

thanks

 
Old May 22nd, 2006, 09:03 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I don't understand the question. You want to know if X does the same as Y, but I don't know what X and Y are.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 22nd, 2006, 09:39 AM
Authorized User
 
Join Date: May 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi let me rephrase the question I am using XslTransform from .NET 1.1 to transform xml and xsl into server controls will the XsltTransformer from saxon do the same job?

 
Old May 22nd, 2006, 10:04 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Saxon supports XSLT 2.0 rather than XSLT 1.0, but if you put a 1.0 stylesheet through it you're very unlikely to hit any incompatibilities (unless you go out of your way to find them). You might however hit some aspects of the language that are implementation-defined or that have been quirkily implemented by Microsoft, for example System.Xml tends to accept a Windows filename containing backslashes in places where the W3C specs require a URI.

Saxon doesn't support the same API as .NET System.Xml.Xsl (it can't, because it's defined using concrete classes rather than interfaces). But it shouldn't be too much work to convert.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 22nd, 2006, 10:15 AM
Authorized User
 
Join Date: May 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I Am trying to run this example I found in the internet

                String sourceUri = Server.MapPath("saxon.xml");
                String xsltUri = Server.MapPath("saxon.xslt");
                FileStream sXml = File.OpenRead(sourceUri);
                FileStream sXsl = File.OpenRead(xsltUri);
                Processor processor = new Processor();
                DocumentBuilder builder = processor.NewDocumentBuilder();
                Uri sUri = new Uri(sourceUri);
                builder.BaseUri = sUri;
                XdmNode input = builder.Build(sXml);
                XsltTransformer transformer = processor.NewXsltCompiler().Compile(sXsl).Load();
                transformer.InitialContextNode = input;
                Serializer serializer = new Serializer();
                serializer.SetOutputWriter(Response.Output);
                transformer.Run(serializer);

xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="text"/>

    <xsl:template match="/">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="message">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="Hello">
        Hello <xsl:value-of select="." />
    </xsl:template>

</xsl:transform>

and xml

<?xml version="1.0" encoding="utf-8"?>
<message>
    <Hello>Saxon on .NET!</Hello>
</message>


and its giving me error on

XsltTransformer transformer = processor.NewXsltCompiler().Compile(sXsl).Load();


"Object reference not set to an instance of an object."

I have reference
using Saxon.Api;

why is this sample not working? thanks


 
Old May 22nd, 2006, 10:50 AM
Authorized User
 
Join Date: May 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got this..thanks...

 
Old May 23rd, 2006, 04:06 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You should really be asking a Saxon-specific question like this on the saxon-help list or forum at sourceforge.net.

I think the answer is probably that the BaseURI property on the XsltCompiler has not been set. This needs a better diagnostic!



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 23rd, 2006, 02:32 PM
Authorized User
 
Join Date: May 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser Support for XSLT 2.0 dennis_wimer XSLT 6 May 8th, 2010 04:25 PM
using .net framework 2.0 with vb.net 2005 vb1720 .NET Framework 2.0 1 July 28th, 2007 04:47 PM
Visual Studio .NET 2003 with .NET 2 Framework testsubject VS.NET 2002/2003 1 July 27th, 2006 03:25 PM
running .net apps w/o installing .net framework connect2sandep General .NET 2 June 24th, 2005 04:45 AM
Is .NET framework req. to install .NET application tact_259 VS.NET 2002/2003 2 May 20th, 2004 08:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.