xslt-1.0

Specific order for XSL Template output

淺唱寂寞╮ 提交于 2019-12-11 18:37:44
问题 I've got the following xml file: <section> <templateId root="2.16.840.1.113883.10.20.22.2.4" /> <text> <list listType="ordered"> <item>9/18/2013 - Weight - 125 lbs</item> <item>9/18/2013 - Blood Pressure - 120/80 mm Hg</item> <item>9/18/2013 - BMI - 19 98</item> <item>9/11/2013 - Weight - 125 lbs</item> <item>9/11/2013 - Blood Pressure - 120/80 mm Hg</item> <item>9/11/2013 - BMI - 19 98</item> <item>9/11/2013 - Pulse - 32</item> </list> </text> </section> I have the following xsl template

Parsing html with xslt

青春壹個敷衍的年華 提交于 2019-12-11 18:26:21
问题 Can someone help me take the following: <rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> <channel> <title>This is a test</title> <link>http://somelink.html</link> <description>RSS Feed</description> <item> <title>This is a title</title> <link>http://somelink.html</link> <description><div style='font-size: 9px;'><div class="rendering rendering_researchoutput rendering_researchoutput_short rendering_contributiontojournal rendering_short rendering_contributiontojournal_short"><h2

How to print element tags in XML document using XSL

只谈情不闲聊 提交于 2019-12-11 18:07:46
问题 Very much a beginner with XSL. I'm trying transform 2 XML documents into a new XML document. I can't seem to get the tags to print to the new document. Only the content of the elements is printing. XML <books> <book> <name>Cat in the Hat</name> <author>Me</name> ... ... </book> ... ... </book> XSL <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method = "xml" indent = "yes" /> <xsl:template match="/"> <xsl

How to use xslt 1.0 keys with computed instead of static node values?

 ̄綄美尐妖づ 提交于 2019-12-11 18:07:07
问题 With this small XSL transformation, I can give a "flat" xml structure a little bit of hierarchy: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:key name="child1" match="item[meta/para/level]" use="generate-id(preceding-sibling::item[meta/para/level < current()/meta/para/level][1])"/> <xsl:key name="child2" match="item[meta/text]"

Merging two XML files with XSLT

泄露秘密 提交于 2019-12-11 17:13:25
问题 I've searched for a solution for my problem. I found some similar questions and answers but none of them fitted to my problem. I'm an XML newbie and never used XSLT before. I have Linux and could use xsltproc or xmllint (or whatever would be best). The problem is rather easy. I have to XML files with identical layout. At the beginning is a counter for the nodes included in one file. I just need the counters of both files added and then all nodes from both files as a single list. (Sorted would

Conver EDT to GMT in XSLT 1.0

为君一笑 提交于 2019-12-11 17:05:57
问题 My input values are "Tue, 12 Sep 2017 15:03:22 EDT" or "2017-09-12T15:03:22.0000000". I need something like: ""2017-09-12T19:03:22Z"" Is it possible to convert EDT date-time to GMT format in XSLT 1.0? 回答1: To convert between two timezones with a known offset between them in pure XSLT 1.0, you can use the following example: XML <input>2017-09-12T15:03:22.0000000</input> XSLT 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1

Unable to put href links to expand results in xml using xslt file

孤街醉人 提交于 2019-12-11 16:31:40
问题 I designed a xslt file for a list view of house names from xml. And when a house name is clicked from the list, it should show full detail of the house which is in same xml file. But in my case it's redirecting to another place. Can someone help me? <Houses> <search> <id>1</id> <name>horror</name> <address>09, west Road</address> <city>London</city> <pcode>se4 7jk</pcode> <contact>020574110832</contact> </search> </Houses> And the problem part of xslt file <xsl:template match="name"> <xsl

Convert dd/mm/yy to dd-MM-YYYY format in xsl

泄露秘密 提交于 2019-12-11 15:48:38
问题 Thanks in advance for your support. I have the date formats as dd/MMM/YY and need to be converted into the another format dd-MM-YYYY using XSL . The problem here is, year is in short format need to be converted into long format. How can the year be determined ? Here are few examples, dd/MMM/YY - dd-MM-YYYY 01/FEB/91 - 01-02-1991. 13/APR/13 - 13-04-2013. Using string manipulations, XSL it can be converted to long format but actual year cannot be determined. For example 01/FEB/91 can be

find xpath to pick following sibling not after another tag same as current in xsl

会有一股神秘感。 提交于 2019-12-11 15:47:09
问题 I would like to get the following sibling C when I'm matching A or A1 template in the following, for the second A or A1 only: <root> <A/> <!-- first A --> <B/> <A/> <!-- second A --> <C/> <A1/> <B/> <A1/> <B/> <C/> </root> If I'm matching the first A, I have not to retrieve anything as there is another A before my C tag. If I'm matching the second A, I have to retrieve the C tag. I tried the following without success: <xsl:template match="A|A1"> <xsl:if test="following-sibling::C[preceding

Generating PDF from XML using XSL:FO. Transforming the hyperlink content from XML to PDF

♀尐吖头ヾ 提交于 2019-12-11 15:44:18
问题 How to transform the below XML that contains the hyperlink tag to PDF using XSL:FO <paragraphs> <paragraph>ahsbdgdgdg<a href="https://aaaa.com/xsd &did=jsjsj">Test</a> </paragraph> </paragraphs> 回答1: Use fo:basic-link (https://www.w3.org/TR/xsl11/#fo_basic-link) and put the URI in external-destination (https://www.w3.org/TR/xsl11/#external-destination): <fo:basic-link external-destination="url(https://aaaa.com/xsd%20&did=jsjsj)">test</fo:basic-link> The URI has to be well-formed XML, so the &