xslt-1.0

<xsl:decimal-format group-separator=“{$myseparator}”/> in XSL

爷,独闯天下 提交于 2019-12-11 07:29:37
问题 is it possible to set decimal-format in any way by using a variable or similar? Example: The error I get : "The element 'xsl:decimal-format' has an attribute 'grouping-separator' with an illegal value of '$grouping_separator" Setting the decimal-format via a xsl:attribute is not possible also. Any hints appreciated. Cheers, Ranjith 回答1: The spec for XSLT 1.0 and XSLT 2.0 both state that the value for the grouping-separator attribute must be a single character. It appears that AVT is not

XSL: Comparing nodes by comparing their child nodes

倖福魔咒の 提交于 2019-12-11 07:27:03
问题 I would like to be able to compare two nodes based on the values of their child nodes. Testing node equality with the = operator just compares the string values of the respective nodes. I would like to compare them based on values in their child nodes. To be a bit more specific, I would like <a> and <b> (below) to be equal, because the values of @id are the same for <c> elements that have matching @type attributes also have matching @id attributes. <a> <c type="type-one" id="5675"/> <c type=

Replacing more than one attributes in XSLT (with identity template)

独自空忆成欢 提交于 2019-12-11 06:27:20
问题 Hi I have to replace more than one attributes of a given tag using XSLT while copying the entire file with identity template. With my given XSLT I'm able to replace one attribute (value of class) but not the other one. Input file: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 11

Calculate and show sum from nested elements XSLT

无人久伴 提交于 2019-12-11 06:25:25
问题 The XML is: <?xml version="1.0" encoding="UTF-8"?> <rows> <row id="FOLDER1"> <cell image="blank.gif">Folder 1</cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell sum="1">$23</cell> <row id="FOLDER2"> <cell image="blank.gif">Folder 2</cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell sum="2">$11</cell> <row id="FOLDER3"> <cell image="blank.gif">Folder 3</cell> <cell></cell> <cell></cell> <cell></cell>

XSL Invalid Type Error - Setting Variable using Value-of

ε祈祈猫儿з 提交于 2019-12-11 05:37:43
问题 I am trying to get value-of $deal/total_price . In the first block, I am able to get value and everything works great. In the second block where I am using value-of to set the variable named deal , I get an error when trying to display $deal/total_price . How can I return $deal/total_price using setup in second block? Works: <xsl:variable name="deal" select="/webpage/results/cars/*[partner_name = $company_name and vehicle_class_description = $vehicle_class_description_full]" /> <xsl:value-of

Remove recurring values from string

a 夏天 提交于 2019-12-11 05:37:31
问题 I need to remove the filepath in this xmlvia xslt <?xml version="1.0" encoding="ISO-8859-1"?> <InvoiceCapture> <Invoice> <CaptureDate>2014-02-19</CaptureDate> <CaptureTime>14:04:07</CaptureTime> <Company>bygg</Company> <Type>0</Type> <Supplier>11111111</Supplier> <SupplierInvoiceNo>11111111</SupplierInvoiceNo> <InvoiceDate>2013-12-30</InvoiceDate> <DueDate>2014-01-29</DueDate> <Reference1>11111111</Reference1> <Reference2>11111111</Reference2> <Currency>SEK</Currency> <Amount>11111111</Amount

XSLT transformation to group similar tags with XSLT 1.0

北城以北 提交于 2019-12-11 05:28:26
问题 I have this XML with players and citizens sections. Each section has multiple person tags. <?xml version="1.0" encoding="UTF-8"?> <test> <players> <person> <name>joe</name> <age>20</age> </person> <person> <name>sam</name> <age>23</age> </person> </players> <citizens> <person> <name>joe</name> <city>ny</city> </person> <person> <name>sam</name> <city>london</city> </person> </citizens> </test> Now I want to transform this so that person tags of, players and citizens sections are merged

how can i transform this using keys

[亡魂溺海] 提交于 2019-12-11 05:26:23
问题 I'm able to write a horribly bad xslt without using keys but it's quite slow and messy. Does anyone know how i would transform the following XML file into the expected result cleanly? Thanks! input: <testExecution> <test> <test.1/> <test.2/> <test.3/> </test> <comment> <comment.1/> <comment.2/> <comment.3/> </comment> <executor> <executor.1/> <executor.2/> <executor.3/> </executor> <comment> <comment.1/> <comment.2/> <comment.3/> </comment> <comment> <comment.1/> <comment.2/> <comment.3/> <

How can I use XSLT 1.0 to add structure to a non-heirarchal XML file?

怎甘沉沦 提交于 2019-12-11 05:24:24
问题 I have some non-heirarchal xml that has pseudo-structure. Every object declares a parent (except the "root" object) and zero or more children, but does so using ids and reference attributes rather than a nested structure. I would like to convert this to a nested structure. <document> <object id="6" children="12,15"/> <object id="12" parent="6" children="13,18"/> <object id="13" parent="12" children="14,16,17"/> <object id="14" parent="13"/> <object id="15" parent="6" children="21,22"/>

How do I sort a list of XML items into rows for an HTML table?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 04:36:56
问题 I have the following XML: <items> <item x="1" y="3"/> <item x="2" y="4"/> <item x="3" y="4"/> <item x="4" y="2"/> <item x="5" y="1"/> </items> I want to ultimately put them into an HTML table (the x and y are coordinates of cells in that table), and to make it easier I want to put the items into rows, like this: <items> <row y="1"> <item x="1" y="1"/> </row> <row y="2"> <item x="2" y="2"/> </row> <row y="3"> <item x="5" y="3"/> </row> <row y="4"> <item x="3" y="4"/> <item x="4" y="4"/> </row>