xsl

Copy node and add value to attribute with Xslt

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Basiccly i have problem with xml and xslt which i do not know how to solve, and would appreciate any help regarding this matter where to start. I have XML: <root> <test value = "1" setting = "3" > <tag1> data.... </tag1> <tag2> data.... </tag2> <tag n +1 > data.... </tag n +1 > </test> <test value ... . . . </test> </root> Now i would now need to copy, all nodes in "test" node in this way and add always value 3 to settings value (settings value is changing in test node) in 4 new nodes like shown below so i would get: <root> <test

Converting decimal hours to hours minutes and seconds

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a more elegant solution to the following in xslt 1.0? I understand there are built in functions to xslt 2.0. I'm taking a number in decimal hours and need to represent it as HH:MM:SS. At the moment I have the following which functions well. <xsl:variable name="decimal_hours" select="pre_lab_cost div pre_labour_rate"/> <xsl:variable name="decimal_minutes" select="number(concat('0.',substring-after($decimal_hours, '.')))*60"/> <xsl:variable name="decimal_seconds" select="number(concat('0.',substring-after($decimal_minutes, '.')))*60"/

Transform xml structure to another xml structure with xslt

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a question. I have the following source xml file: Source xml: <Container> <DataHeader> <c id="b" value="TAG" /> <c id="g" value="Info" /> </DataHeader> <Data> <Rows> <r no="1"> <c id="b" value="uid1" uid="T.A.uid1" /> <c id="g" value="uid1|tag1|attr1|somevalue1" /> </r> <r no="1"> <c id="b" value="uid1" uid="T.A.uid1" /> <c id="g" value="uid1|tag1|attr2|somevalue2" /> </r> <r no="2"> <c id="b" value="uid1" uid="T.A.uid1" /> <c id="g" value="uid1|tag2|attr3|somevalue3" /> </r> <r no="10"> <c id="b" value="uid2" uid="T.A.uid2" /> <c id=

Assign to &lt;xsl:variable&gt; after thedecleration

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the below way to assign value to a variable. <xsl:variable name="NewValue"> <xsl:value-of select="normalize-space(//root/id/amount)"/> </xsl:variable> After the assignment I want to assign new value to the same variable. Like this:- <xsl:variable name="NewValue" select="normalize-space(//root/id/amountnew)"> Is there any way for this? Here the sample of XML that I have: <VolLien> <Vest_DocType>SDD</Vest_DocType> <Vest_Instrument>395072</Vest_Instrument> <Vest_OfOfficialEntity>eee</Vest_OfOfficialEntity> <Vest_RecDate>12/24/2009<

Flatten XML to HTML table

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: There must be a generic way to transform some hierachical XML such as: <element1 A = "AValue" B = "BValue" > <element2 C = "DValue" D = "CValue" > <element3 E = "EValue1" F = "FValue1" /> <element3 E = "EValue2" F = "FValue2" /> </element2> ... </element1> into the flattened XML (html) picking up selected attributes along the way and providing different labels for the attributes that become column headers. <table> <tr> <th> A_Label </th> <th> D_Label </th> <th> E_Label </th> <th> F_Label </th> </tr> <tr> <td> AValue </td> <td>

using xslt stylesheet to convert xhtml blank lines to an XSL-FO blank line

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using an XSLT stylesheet (by Antennahouse) to convert XHTML to an XSL-FO file. I defined a blank line in my XHTML file as 2 consecutive HTML BR tags. Now there is no native support for a blank line in the XSL-FO format. I want to work around this limitation by adding a height to the fo:block that the stylesheet inserts for a BR tag. However I'm new to the XSLT language and I'm having some problems doing this. I can figure out how to insert this height for every BR tag I encounter, but I only want the blank line to be inserted when there

What browsers support XSLT 2.0?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The Safari browser does not support XSLT 2.0 documents. What browsers, if any, support XSLT 2.0? 回答1: 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 文章来源: What browsers support

Saxon 9 XSLT transformer vs Xalan 2.7

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am currently using Xalan 2.7.0 for XSLT transformations over XML, but thinking over to switch to Saxon 9 version for XSLT transformations. So could someone list me the major cons and prons of using Saxon over Xalan . Although i know that Saxon supports XSLT 2.0 and other major changes but instead i would like to know more about personal experiences with Saxon 9 and its prons and cons and other benefits. 回答1: I used Xalan 10 years ago. I have been using Saxon almost exclusively for the last 10 years. Not only is Saxon an XSLT 2.0 and XSLT 3

XSLT Concatenating the values with comma (,)

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: i need to loop through all the nodes in the xml document and append the values with comma ( , ) finally after the last element i should not have commma (,) can any body help me. thanking you, Ramana kumar. 回答1: You can do something like this: <xsl:for-each select = "element" > <xsl:value-of select = "whatever" /> <xsl:if test = "position() != last()" > , </xsl:if> </xsl:for-each> The position() function returns the index of the current element in the for-each context, and last() returns the index of the last element. The

Why has XSLT never seen the popularity of many other languages that came out during the internet boom? [closed]

匿名 (未验证) 提交于 2019-12-03 08:35:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The use of XSLT (XML Stylesheet Language Transform) has never seen the same popularity of many of the other languages that came out during the internet boom. While it is in use, and in some cases by large successful companies (i.e. Blizzard Entertainment), it has never seemed to reach mainstream. Why do you think this is? 回答1: One problem is that XSLT looks complicated. Any developer should be able to pick up the language constructs as there are analogs in most other languages. The problem is that the constructs and data all look exactly the