saxon

Are there any XSLT and XQuery Processors available for .NET Core 3.0 apps?

夙愿已清 提交于 2020-08-20 07:02:20
问题 I've been using Saxon XSLT and XQuery processor - Free home edition for some of my .NET apps. I need only XSLT 2.0 (since .NET does not support XSLT 3.0). Now that I've moved from .NET Framework to .NET Core , I noticed that the Saxon has not yet supported .NET Core since when installing a Nuget package for Saxon, I get the following error. Question : Are there other alternatives that someone knows I can use for my .NET Core projects that need XSLT 2.0 and XQuery processing? Because of the

How do I call fn:sort() in Saxon from Java with multiple sort keys

浪子不回头ぞ 提交于 2020-08-10 19:17:33
问题 How do I use the sort function in Saxon when calling it from Java (not from XSLT). For example, for the query (data modeled on the Northwind database) I can get unsorted data using: /windward-studios/Employees/Employee But I want to get it sorted like the following (using SQL syntax here): /windward-studios/Employees/Employee order by City descending, LastName ascending How do I write the query to accomplish this? The full code for this is in SaxonQuestions.zip (minus license key) - TestSort

Is this the best way to get all elements & attributes in an XML file using Saxon?

送分小仙女□ 提交于 2020-08-10 19:17:20
问题 Our program displays a tree control showing the metadata structure of the XML file they are using as a datasource. So it displays all elements & attributes in use in the XML file, like this: Employees Employee FirstName LastName Orders Order OrderId For the case where the user does not pass us a XSD file, we need to walk the XML file and build up the metadata structure. The full code for this is at SaxonQuestions.zip, TestBuildTree.java and is also listed below. I am concerned that my code is

How do I load a JSON file into the DOM in Saxon running in Java?

空扰寡人 提交于 2020-08-10 19:17:19
问题 In my Java code I am trying to create a Saxon document (DOM) that is the contents of a JSON file. This should be possible but the code I have fails. The full code for this is at SaxonQuestions.zip, TestLoadJson.java and is also listed below. In this code the evaluate() fails. TestLoadJson.java import net.sf.saxon.Configuration; import net.sf.saxon.s9api.*; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; import javax.xml.transform.sax.SAXSource; import java.io.*; import java.nio

近千年之谜被解开!科学家找到900年前月亮消失的原因

℡╲_俬逩灬. 提交于 2020-07-28 04:13:34
  对于月亮,相信大家都见怪不怪,几乎每天都能看到它。即使由于天气原因偶尔看不到月亮,时间也不会太长。但如果你连续一个月没有看到月亮,一定会很诧异吧。而在近千年前,欧洲的月亮就凭空“消失”了一个月。   5 月 16 日,据外媒报道,发表在《科学报告》上的一项新研究,揭示了 900 年前月亮“消失”的原因,科学家认为这是由于地球上的火山造成的。   报道称,一位观测者用盎格鲁-撒克逊(Anglo-Saxon)语写的《彼得伯勒纪事报》记录了这场来自千年前异象:5 月的第 5 个晚上,月球在傍晚时分闪烁着明亮的光芒,此后,月球的亮度逐渐减弱,以至于在接下来的几个夜晚,月球最终消失在天空中,大地一片黑暗。”更加离奇的是,在月球最终消失之后,天空中仍然能够看到闪闪发光的星星,这表明月球似乎确实是“消失”了。   对于当时观测到这种景象的人来说,月亮不见了,但是星星还在,这确实很奇怪。但现在的研究人员能够将这一奇怪的现象与冰芯样本和树木年轮数据证实的火山活动增加联系起来。   研究小组注意到,在 1108 年到 1113 年之间沉积下来的火山物质在冰样本中被发现,这表明可能是一场“被遗忘的火山活动”导致了月亮突然消失。之所以被称为“被遗忘的火山活动”是由于科学家科学家并未发现与此次月亮消失事件相匹配的火山活动。   研究人员表示,此次火山大量的喷发物一直蔓延到欧洲,引发了一系列天文和气象事件

removing an element from xml using saxon xquery

懵懂的女人 提交于 2020-07-22 04:26:09
问题 Hi I have an xml like this: <ns1:books><ns2:book category="WEB"><ns3:title lang="en">Learning XML</ns3:title> <ns3:author>Erik T. Ray</ns3:author><ns3:year>2003</ns3:year><ns3:price>39.95</price> Using Saxon xquery I want to remove the ns3:author element, could anyone let me know how can I do it ? I know there is a fn:remove(..) method but I don't want to use that as it takes an integer as a 2nd argument Any complete code will be much appreciated Also with saxon I am facing the error like

Retaining entity in xslt stylesheet output without using character-map

久未见 提交于 2020-06-17 13:12:25
问题 Where did we go wrong? When I process this xml with xslt 2 on saxon he: <data> <grab>Grab me and print me back "</grab> </data> using this stylesheet: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="/"> <xsl:apply-templates select="/data/grab"/> </xsl:template> <xsl:template match="/data/grab"> <node><xsl:value-of select="text()"/></node> </xsl:template> </xsl:stylesheet> I get this output: <?xml version="1.0" encoding="UTF-8"?><node>Grab

How to return document node from Saxon's extension function?

僤鯓⒐⒋嵵緔 提交于 2020-04-30 08:46:46
问题 I'm looking at Integrated extension functions in Saxon-HE 10 (Java). I need the function to return a document-node()? which is constructed from StreamSource . Answer to a similar question mentions this code: context.getConfiguration().buildDocument() However context is not passed to ExtensionFunction , only XdmValue[] arguments . ExtensionFunctionDefinition does accept XPathContext context , but it looks like getConfiguration().buildDocument() is not present in 10. Instead, there is context

Saxon 9, Java, NullPointer from doc-available

蹲街弑〆低调 提交于 2020-04-18 12:35:46
问题 This is an error seen after fixing the issue in Saxon 9 HE, Java - Static errors, XTSE0210, XTSE0165, XPST0017 When invoking an XSLT transform from the following java code public static Document transformAsDocument(Document inputDoc, String xslDoc, Map<String, Object> params, String xslContextPath, String fullXsltFilePath) throws XmlException { try { System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); TransformerFactory factory =

Alternative XSLT processor to Apache Xalan

半世苍凉 提交于 2020-04-18 02:56:44
问题 I am currently using the Apache Xalan XSLT processor in my Java application, but I would like to use some alternative solution which supports use of extension functions. Xalan seems to be out of date and buggy. I know of Saxonixa Saxon, but it is closed sourced. Is there some open source and well working alternative? 回答1: The current open source version of Saxon, Saxon-HE 9.9, supports "integrated extension functions" (functions written to a particular Saxon-defined Java interface). It doesn