xslt

modify part of XML element name and replace with increment number

妖精的绣舞 提交于 2020-01-24 17:08:29
问题 Is it possible to use XSLT to change part of the element name to another element name with increment number. Like I only want to change the element name with UPC_ at the beginning <product> <UPC_US>123</UPC_US> <UPC_UK>223</UPC_UK> <UPC_JP>345</UPC_JP> <other>unchange</other> </product> <product> <UPC_US>1234</UPC_US> <UPC_CA>1235</UPC_CA> <other>unchange</other> </product> to this? <product> <UPC_1>123</UPC_1> <UPC_2>223</UPC_2> <UPC_3>345</UPC_3> <other>unchange</other> </product> <product>

How is wordwrap in XSLT?

爷,独闯天下 提交于 2020-01-24 13:18:10
问题 I am extracting data from XML using XSLT. I want to see data in xml-editor.How to wrap text to fit window in XSLT? <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match='/'> <wawes> <xsl:for-each select="//VARIABLE"> <xsl:sort select="@ID" order="descending"/> <wave> <id> <xsl:value-of select="@ID" ></xsl:value-of> </id> <NAME> <xsl:value-of select="NAME"/> </NAME> </wave> </xsl:for-each> </wawes> </xsl

XSLT Document Function - Folder Hierarchy

此生再无相见时 提交于 2020-01-24 12:26:47
问题 I am working with xslt 1.0 and trying to use the XSLT document function to apply the stylesheet to a hierarchy of folders. The folder structures is as below, but I cannot seem to find any reliable references on the Web on how to do this. a/ └── b └── c ├── d ├── e ├── f Is there a way I can apply my stylesheet to nodes, in a file, in folder f via a file in folder a (a has links to file names in folder hierarchy). Update #2 book01.xml <?xml version="1.0" encoding="utf-8" ?> <book location="..

XSLT select nodes with namespace

℡╲_俬逩灬. 提交于 2020-01-24 12:26:12
问题 I am trying to obtain the values of few tags from a xml using xslt. My list.xml: <a> <na:Data xmlns:na="http://some_site.com#" Ref="http://another_site.com" Key="value"> <b> <c>some_c_attrib</c> <d>some_d_attrib</d> <e>some_e_attrib</e> <f>some_f_attrib</f> <g>some_g_attrib</g> </b> <h> <i>some_i_attrib</i> <j>some_j_attrib</j> </h> </na:Data> <da:Newtag xmlns:da="http://new_site.com"> <k name="http://new_new_site.com"/> </da:Newtag> </a> My list.xsl: <?xml version="1.0" encoding="ISO-8859-1"

Conditional test around xsl:apply-templates

左心房为你撑大大i 提交于 2020-01-24 11:30:05
问题 I've been trying to learn how to code in xslt and currently am stuck on how to use conditional tests around the xsl:apply-templates tag. Here's the xml that I am testing. <?xml version="1.0" encoding="utf-8"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>UK</country> <company>CBS Records</company

Using XSLT to select after EACH instance in a string/substring

我的梦境 提交于 2020-01-24 10:23:27
问题 I'm attempting to write an XSLT stylesheet that will handle a Dublin Core (XML) cataloging record and create Chicago, APA, and MLA versions of the citation for each book. I've got everything worked out fine except the APA author one. APA's style for authors requires the author's last name (done), comma, first initial (done), any other initials (my stuck place problem). What I have right now (and sample DC element is below): <xsl:value-of select="substring-before(dc:creator[1],',')" /><xsl

how to change xml by browser

北城余情 提交于 2020-01-23 18:03:44
问题 I would like to change some rules in my XML depending on the browser. For example, the 'fontcolor' should be black when using IE. So far I googled it, I found this could be possible using XSLT. But unfortunately, after googling/trying&error after 1/2 days, I still didn't get the clue how to do this. Could someone help me how to solve this? Any help would be highly appreciated. Thanks !! EetieD. My current XML: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href=

how to change xml by browser

匆匆过客 提交于 2020-01-23 18:03:33
问题 I would like to change some rules in my XML depending on the browser. For example, the 'fontcolor' should be black when using IE. So far I googled it, I found this could be possible using XSLT. But unfortunately, after googling/trying&error after 1/2 days, I still didn't get the clue how to do this. Could someone help me how to solve this? Any help would be highly appreciated. Thanks !! EetieD. My current XML: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href=

How to use embedded EXSLT from XSLTProcessor?

风格不统一 提交于 2020-01-23 17:57:04
问题 XSLTProcessor::hasExsltSupport() returns true. Now what do I have to modify so I can use it? I have <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date"> Transformation what I'm trying to do: <td> <xsl:value-of select="date:format-date(translate(property[@name='changedate']/value, ' ', 'T'), 'd.m.y h:i')" /> </td> property[@name='changedate']/value is stamp from SQL DB (yyyy-mm-dd hh:mm

Table of contents XSL

余生长醉 提交于 2020-01-23 12:42:55
问题 Problem : I'm doing a table of contents, with chapters, sections, subsections and subsubsections. What I want is to process the information (that is in XML) with xsl, transforming into an HTML page. XML : <chapter id="c1"> <title>Chapter 1</title> <section id="s1.1"> <title>Motivation</title> (...) <section id= "s1.2"> (...) <chapter id="c2"> <title>Chapter 2 </title> <section id="s2.1"> <title> Genetics </title> <subsection id="ss2.1.1"> <title> Brief History </title> (...) XSL : <xsl