exslt

How can we use EXSLT without downloading its source?

对着背影说爱祢 提交于 2019-12-24 02:57:43
问题 XSLTSL seems to claim that we can use EXSLT without downloading its source: Import or include either the main stylesheet, or the stylesheet module you wish to use, directly from the library website; http://xsltsl.sourceforge.net/modules/. The modules directory always contains the latest stable release. I've tried this: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="http://xsltsl.sourceforge.net/modules

Using a Map in XSL for expanding abbreviations

≡放荡痞女 提交于 2019-12-24 01:19:29
问题 I saw a similar question on creating a Map. That answer has this code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:template match="/"> <xsl:variable name="map"> <map> <entry key="key-1">value1</entry> <entry key="key-2">value2</entry> <entry key="key-3">value3</entry> </map> </xsl:variable> <output> <xsl:value-of select="msxsl:node-set($map)/map/entry[@key='key-1']"/> </output> </xsl:template> I would like

how do i not repeat repeated logic in my xslt code?

百般思念 提交于 2019-12-23 20:26:33
问题 what's a better way to write this code: <xsl:template name="CamelChain"> <xsl:param name="input"/> <xsl:param name="position"/> <xsl:if test="$position <= string-length($input)"> <xsl:choose> <xsl:when test="substring($input, $position, 1) = '_'"> <xsl:value-of select="translate(substring($input, $position + 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> <xsl:call-template name="CamelChain"> <xsl:with-param name="input" select="$input"/> <xsl:with-param name="position"

How do I get EXSLT support in Saxon-HE?

◇◆丶佛笑我妖孽 提交于 2019-12-22 04:42:38
问题 I have a bunch of XSLT files that I need to process against some XML files. I cannot change the XSLT files as they come from a 3rd party. The XSLT's are version 2.0. I'm on Mac OS X 10.6 and it looks like Saxon-HE is the only XSLT 2.0 processor available. Most of the XSLT's work fine, however, some give errors regarding missing functions, specifically month-in-year() and other date/time related functions. According to http://www.saxonica.com/documentation/extensions/exslt.xml regarding EXSLT:

Find the position of an element within its parent with XSLT / XPath

冷暖自知 提交于 2019-12-22 03:43:07
问题 Apart from rewriting a lot of XSLT code (which I'm not going to do), is there a way to find the position of an element within its parent, when the context is arbitrarily set to something else? Here's an example: <!-- Here are my records--> <xsl:for-each select="/path/to/record"> <xsl:variable name="record" select="."/> <!-- At this point, I could use position() --> <!-- Set the context to the current record --> <xsl:for-each select="$record"> <!-- At this point, position() is meaningless

Convert 31-DEC-2016 to 2016-12-31

随声附和 提交于 2019-12-18 09:44:40
问题 I want to convert the 31-DEC-2016 i.e., dd-mmm-yyyy to yyyy-mm-dd in the XSLT using format-dateTime function but the output is not as expected.Can anyone help on this? <ns1:QuoteDate> <xsl:value-of select='concat(xp20:format-dateTime(/Quote/QuoteHeader/QuoteDate,"[Y0001]-[M01]-[D01]"),"T00:00:00")'/> </ns1:QuoteDate> I want to get the value for this particular thing.31-DEC-2016 : This is the input and i have to transform over here in the code Once that is converted, How to concat the the

Exception loading external XSLT

泄露秘密 提交于 2019-12-13 16:41:27
问题 I have a load of XSLT from a third party which i need to use to transform some data. If I use xsltproc it works fine and outputs data as expected. I have the following C# code to try and use it in-process: sXML is the lump of XML oJob.ContentTemplate is the local file path to the XSLT file try { using (StringWriter oOutputString = new StringWriter()) { using (XmlTextWriter oOutputWriter = new XmlTextWriter(oOutputString)) { using (StringReader oInputString = new StringReader(sXML)) { using

XSL 1.0 date:difference EXSLT

此生再无相见时 提交于 2019-12-13 02:28:04
问题 I have struggled with finding (and using) the difference between two dates. XSL 2.0 is not an option, but I have found EXSLT date:difference http://exslt.org/date/functions/difference/ that might solve my problem comparing dates in XSL 1.0 - but, I haven't found any good examples on how to use it. I have an XML-file that looks like this: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="gall.xsl"?> <report> <title>Individual Item Display</title> <dateCreated>2016

error when calling exslt in Saxon

对着背影说爱祢 提交于 2019-12-13 00:09:28
问题 I get the error message: "Cannot find a matching 1-argument function named {http://exslt.org/common}node-set()" when running a xslt transformation with the Saxon engine. I've tried using Saxon PE and EE on Windows XP and it gives the same error. EXSLT should work out of the box with Saxon. Does anyone have a solution on how I may resolve this, please? 回答1: Saxon PE and EE are XSLT 2.0 processor implementations where you don't need a node-set extension function as in XSLT 2.0 the difference

Jython : Issues executing XSLT

家住魔仙堡 提交于 2019-12-11 15:03:40
问题 Ignoring identation, below Jython code when executed from command line produces, output with self-closing tags(No data), as shown in the picture below from java.io import * import javax.xml from java.io import StringReader, StringWriter from javax.xml.transform import Transformer, TransformerFactory from javax.xml.transform.stream import StreamResult, StreamSource def obtainservicexslts(): print "In obtainservicexslts" print source_xform_xml = """<?xml version='1.0' encoding='UTF-8'?>