xslt-2.0

How to create a boolean value?

痴心易碎 提交于 2019-11-27 10:04:03
问题 I am totally new to XSLT and can't work out where I am going wrong with the following code. <xsl:variable name="var" select="boolean('false')"/> <xsl:if test="$var'">variable is true</xsl:if> It is always returning true when it is meant to be false. Why? 回答1: The value of the $var variable as defined in: <xsl:variable name="var" select="boolean('false')"/> is true() This is because in XPath " false " is an ordinary string, as opposed to false() , which is the constructor for the boolean value

Can one give me the example for “mode” of template in xsl?

梦想与她 提交于 2019-11-27 09:56:25
问题 In <xsl:template name="temp_name" mode="mode"> What is the meaning of mode ? I searched many many resource, but i couldn't find example for that. So can anybody explain with an example? 回答1: It isn't too meaningful to give a template both a name and a mode . The name attribute fully identifies a template and there cannot be two templates with the same name and different modes. The mode attribute allows the same nodes to be processed more than once, using different modes . Here is a short

Upgrading XSLT 1.0 to XSLT 2.0

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 09:09:20
问题 What is involved in upgrading from XSLT 1.0 to 2.0? 1 - What are the possible reasons for upgrading? 2 - What are the possible reasons for NOT upgrading? 3 - And finally, what are the steps to upgrading? I'm hoping for an executive summary--the short version :) 回答1: What is involved in upgrading from XSLT 1.0 to 2.0? 1 - What are the possible reasons for upgrading? If you are an XSLT programmer you'll benefit largely from the more convenient and expressive XSLT 2.0 language + XPath 2.0 and

Two phase processing: Do not output empty tags from phase-1 XSLT 2.0 processing

纵然是瞬间 提交于 2019-11-27 09:06:37
I have some complex XSLT 2.0 transformations. I'm trying to find out if there is general purpose way to ensure that no empty tags are output. So... conceptually, a final stage of processing that recursively removes all empty tags. I understand this could be done by a separate XSLT that did nothing but filter out empty tags, but I need to have it all packaged together in a single one. This XSLT 2.0 transformation illustrates how multi-pass (in this case 2-pass) processing can be done : <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org

xslt 1 and sum function

微笑、不失礼 提交于 2019-11-27 07:18:20
问题 I create an invoice management system using xml and PHP but the latest PHP version does not support XSLT 2.0 - therefore I have to look for an sum() alternative. How can I transform the valid xslt 2 function "sum(unitprice * quantity)" to xslt 1.0 ? The XML stuff is based on John's Examples I tried it with a node-set, but it is not supported "xmlXPathCompOpEval: function node-set not found in" 回答1: Actually, sum(price*quantity) isn't valid XSLT 2.0 syntax. I guess you mean something like `sum

XSLT: Remove namespace prefix from elements

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:15:43
问题 I need to remove the namespace prefix from an un-SOAP'd message. This is the message that has had the SOAP envelope removed. As you can see it contains ns1 prefix on the elements: <ns1:BookingSource xmlns:ns1="urn:EDI/Booking/artifacts"> <ns1:BookingHeader> <ns1:BookingNo>000123</ns1:BookingNo> <ns1:BookingDate>01/01/2012</ns1:BookingDate> <ns1:DSBookingDetail> <ns1:BookingNo>000123</ns1:BookingNo> <ns1:SeqNo>1</ns1:SeqNo> <ns1:LineType>Item</ns1:LineType> <ns1:ProductCode>Box</ns1

Using for-each-group for high performance XSLT

和自甴很熟 提交于 2019-11-27 07:14:41
问题 I have an XSLT (1.0) style sheet. It works with no problem. I want to make it to 2.0. I want to use xsl:for-each-group (and make it have high performance). It is possible? How? Please explain. I have many places like <xsl:if test="test condition"> <xsl:for-each select="wo:tent"> <width aidwidth='{/wo:document/styles [@wo:name=current()/@wo:style-name]/@wo:width}' </xsl:for-each> </xsl:if> ADDED <xsl:template match="wo:country"> <xsl:for-each select="@*"> <xsl:copy/> </xsl:for-each> <xsl

What browsers support XSLT 2.0?

﹥>﹥吖頭↗ 提交于 2019-11-27 04:35:45
The Safari browser does not support XSLT 2.0 documents. What browsers, if any, support XSLT 2.0? Martin Honnen Browsers do not yet support XSLT 2.0, natively. Saxon 9 CE is a JavaScript-based XSLT 2.0 implementation. Frameless is another, more light-weight XSLT 2.0 implementation in the browser, supporting large parts of the XSLT 2.0 and XPath 2.0 functionality See also: How can I make XSLT work in chrome? https://developer.mozilla.org/en/docs/XSLT_2.0 http://blogs.msdn.com/b/dareobasanjo/archive/2004/05/13/131166.aspx 来源: https://stackoverflow.com/questions/6282340/what-browsers-support-xslt

Use saxon with python

╄→尐↘猪︶ㄣ 提交于 2019-11-27 04:32:32
问题 I need to process XSLT using python, currently I'm using lxml which only support XSLT 1, now I need to process XSLT 2 is there any way to use saxon XSLT processor with python? 回答1: There are two possible approaches: set up an HTTP service that accepts tranformation requests and implements them by invoking Saxon from Java; you can then send the transformation requests from Python over HTTP use the Saxon/C product , currently available on prerelease : details here: http://www.saxonica.com/saxon

Finding the difference between 2 dates in xslt

杀马特。学长 韩版系。学妹 提交于 2019-11-27 02:23:34
问题 Is there a less then kludgey way of finding the difference in days between 2 dates in xslt? If so can you point me in the right direction. I am receiving dates in the format of mm/dd/yyyy. 回答1: Use XSLT 2.0 (XPath 2.0) for this : <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:my="my:my"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:template match="/"> <xsl:variable name="vDate1" select="my