exslt

XSLT 1.0: replace new line character with _

ⅰ亾dé卋堺 提交于 2019-12-10 20:00:57
问题 I am having this below variable <xsl:variable name="testvar"> d e d </xsl:variable> and I have this function: <xsl:choose> <xsl:when test="not($str-input)"> <func:result select="false()"/> </xsl:when> <xsl:otherwise> <func:result select="translate($str-input,$new-line,'_')"/> </xsl:otherwise> </xsl:choose> </func:function> And when I tested the function I saw my result is like this: _ d _ e _ d_ and I want my result to be only d _ e _ d 回答1: In XSLT 1.0: <xsl:stylesheet version="1.0" xmlns

How to get Regexp from EXSLT working in libxslt?

送分小仙女□ 提交于 2019-12-10 13:26:11
问题 Has anyone got Regexp working in libxslt? When yes, how? http://www.exslt.org/regexp/index.html When using the command xsltproc --dumpextensions with the latest libxslt I'm not getting any Regexp support :-( 回答1: xsltproc includes {http://exslt.org/strings}replace already these days. Bind some prefix to that namespace, e.g. string, and then call string:replace(). You can get the list of extensions compiled into the xsltproc program using the shell command: xsltproc --dumpextensions If your

XSLT Xalan dyn:evaluate example

我们两清 提交于 2019-12-08 02:41:47
问题 I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? I am running Windows. The XSLT file is included at the top of the XML document. Thanks Pete 回答1: Xalan has the EXSL dyn:evaluate function built-in, you don't need to import

XSLT Xalan dyn:evaluate example

旧城冷巷雨未停 提交于 2019-12-06 12:13:13
I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? I am running Windows. The XSLT file is included at the top of the XML document. Thanks Pete Xalan has the EXSL dyn:evaluate function built-in, you don't need to import anything in order to use it. You just need to declare the namespace. I'll give a small example: input.xml : <root>

How do I get EXSLT support in Saxon-HE?

青春壹個敷衍的年華 提交于 2019-12-05 04:46:15
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: These extensions are available in Saxon-PE and Saxon-EE "out of the box". They are not available in

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

久未见 提交于 2019-12-05 00:02:22
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 because it's always 1 --> <xsl:call-template name="SomeTemplate"/> </xsl:for-each> </xsl:for-each> <!--

Using non-core EXSLT date functions with Xalan Java

十年热恋 提交于 2019-12-02 19:51:13
问题 I have had EXSLT's core date functions working well in some XSL templates I've been using for years. I'd like to start using a new one: seconds . This function is not one of the "core" functions and therefore implementations can claim compliance with EXSLT without actually implementing it. I'm using Cocoon 2.1.11 with Xalan 2.7.1 which, it appears, has chosen not to implement date:seconds . Fortunately, the kind folks at EXSLT provide downloads to help you plug-in individual functions but I

replace namespace uri using XSLT in SOAP message

大兔子大兔子 提交于 2019-12-02 11:51:54
问题 i have an input soap message, trying to replace part of namespace uri with a different string. I am able to replace entire URI with a different URI, but not able to modify the existing URI. I need to look for 'OLDSTRING' and replace with 'NEWSTRING'. The string VARIABLESTRING varies in in every input xml, so I should keep as it is in the output xml Input XML: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:schemas-OLDSTRING-com:VARIABLESTRING">

Is dyn:evaluate extension function known to have issues in Xalan-J 2.7.1?

半腔热情 提交于 2019-12-01 11:42:06
I'm stumped as to why the following example program refuses to apply my stylesheet properly. It seems that dyn:evaluate in Xalan 2.7.1 is refusing to process certain XPath variables. Running the following program with xalan-j in classpath yields the following results: package com.testing2.xslt; import java.io.*; import java.util.logging.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class DynEvaluateTransform { private static final String XSLT = "" + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\

Is dyn:evaluate extension function known to have issues in Xalan-J 2.7.1?

孤街醉人 提交于 2019-12-01 11:10:35
问题 I'm stumped as to why the following example program refuses to apply my stylesheet properly. It seems that dyn:evaluate in Xalan 2.7.1 is refusing to process certain XPath variables. Running the following program with xalan-j in classpath yields the following results: package com.testing2.xslt; import java.io.*; import java.util.logging.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class DynEvaluateTransform { private static final String XSLT = "" + "<?xml