Project

Profile

Help

XPathException: Unknown source class

Added by Anonymous over 14 years ago

Legacy ID: #7611478 Legacy Poster: Max Toro (maxtoroq)

Hello Michael, I'm getting the following exception when calling Saxon.Api.DocumentBuilder.Build(XmlReader reader): saxon9he, Version=9.2.0.2 net.sf.saxon.trans.XPathException: Unknown source class My application works fine with 9.1, so I suspect this is a bug in 9.2.0.2 . The stack trace shows that net.sf.saxon.Configuration.buildDocument(Source source) is called, but the net.sf.saxon.Configuration.resolveSource(Source source, Configuration config) method it's not recognizing the source type and returning null. Thanks in advance, -maxtoroq


Replies (6)

Please register to reply

RE: XPathException: Unknown source class - Added by Anonymous over 14 years ago

Legacy ID: #7625529 Legacy Poster: Max Toro (maxtoroq)

Here's a test: using System; using System.IO; using System.Xml; using Saxon.Api; namespace SaxonBugTest { class Program { static void Main() { XmlDocument doc = new XmlDocument(); doc.LoadXml("<a>hello!</a>"); XmlReader docReader = new XmlNodeReader(doc); XmlDocument xsl = new XmlDocument(); xsl.LoadXml("<foo xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xsl:version='2.0'><a/></foo>"); XmlReader xslReader = new XmlNodeReader(xsl); Processor proc = new Processor(); XsltCompiler compiler = proc.NewXsltCompiler(); compiler.BaseUri = new Uri(Directory.GetCurrentDirectory()); XsltTransformer transformer = compiler.Compile(xslReader).Load(); // The following line fails XdmNode saxonDoc = proc.NewDocumentBuilder().Build(docReader); Serializer serializer = new Serializer(); serializer.SetOutputWriter(Console.Out); transformer.InitialContextNode = saxonDoc; transformer.Run(serializer); } } }

RE: XPathException: Unknown source class - Added by Anonymous over 14 years ago

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

Thanks for reporting this, I will attempt to reproduce it.

RE: XPathException: Unknown source class - Added by Anonymous over 14 years ago

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

Interim progress report: I've reproduced the problem when running in a "clean" environment with the issued Saxon-HE 9.2 code. Currently I cant' reproduce it when running in my debugging environment; so it's a little difficult to see where it's failing!

RE: XPathException: Unknown source class - Added by Anonymous over 14 years ago

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

OK, it's a packaging error: it seems that the PullSource class isn't recognized by a Saxon-HE configuration even though PullSource is actually present in Saxon-HE. And PullSource is needed when the input comes from a .NET XmlReader. I'll produce a patch for this: though I recognize that building Saxon on .NET is not easy, and you'll probably want to wait for the first maintenance release (which should be within a couple of weeks).

RE: XPathException: Unknown source class - Added by Anonymous over 14 years ago

Legacy ID: #7631672 Legacy Poster: Max Toro (maxtoroq)

I can wait for the maintenance release. BTW, congratulations on 9.2, integrated extension functions are great! It's the cleanest extension mechanism, similar to extension objects on Microsoft .NET .

RE: XPathException: Unknown source class - Added by Anonymous over 14 years ago

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

I've logged this bug at https://sourceforge.net/tracker/?func=detail&amp;aid=2860136&amp;group_id=29872&amp;atid=397617 and committed a patch to fix it, which seems to be working.

    (1-6/6)

    Please register to reply