xslt-1.0

How can I sort elements by new counted values in their child element. XSLT 1.0

心已入冬 提交于 2019-12-10 22:06:51
问题 I have an xml sheet of this kind: <houses> <house number="1"> <mainroom> <roomprice>5</roomprice> <roomtax>2</roomtax> </mainroom> <roompricefull> <price value="8"/> </roompricefull> </house> <house number="2"> <mainroom> <roomprice>3</roomprice> <roomtax>1</roomtax> </mainroom> <roompricefull> <price value="7"/> </roompricefull> </house> <house number="3"> <mainroom> <roomprice>9</roomprice> <roomtax>1</roomtax> </mainroom> <roompricefull> <price value="4"/> </roompricefull> </house> <house

AngularJS expressions in XSLT

旧城冷巷雨未停 提交于 2019-12-10 20:09:31
问题 I'm using AngularJS' expressions as attribute values in .xsl templates, like this: <div attribute="{{angularjs.expression}}" data-stuff="{./someId}"> But XSLT takes notice of the curly brackets and tries to process the expression. How can I escape the double curly brackets? 回答1: I think you need to duplicate them: attribute="{{{{angularjs.expression}}}}" . 来源: https://stackoverflow.com/questions/23030507/angularjs-expressions-in-xslt

Formatting date in xslt

陌路散爱 提交于 2019-12-10 19:51:58
问题 I'm trying to format a certain date format in xslt. This is the format: 2012-7-19 I'd like to convert this to a numerical value in xslt for sorting, so that the above would become: 20120719 The problem is that single months/days don't have a 0 in front of them. So I need to somehow add that in front of single digit months/days, but not in front of months/days that have two digits. Does anyone know how I can do this? I have this so far: <xsl:value-of select="concat( substring(substring-after

XSLT open other xml files

怎甘沉沦 提交于 2019-12-10 19:12:52
问题 I am about to merge XML files (and adding meta information) whose relative path is specified in my input XML file. The files I want to merge are located in a subdirectory called "files" The structure of the input file is the following <files> <file> <path>files/firstfile.xml</path> </file> <file> <path>files/secondfile.xml</path> </file> </files> The firstfile.xml and secondfile.xml have the following structure <tables> <table name = "..."> ... </table> ... <tables> I would like to put all

how to group elements in XSLT

允我心安 提交于 2019-12-10 17:27:19
问题 Faced with difficulties in solving the problem by means of grouping elements XSLT. Do I have to use the xsl: key? if so, how to do it or more xsl: for-each? Here is my problem. My XML file: <page> <name>test</name> <property id="416" name="country" type="relation"> <title>Country</title> <value> <item id="1014" name="Canada"/> </value> </property> </page> and items such pieces 20, each has a name (non-recurring, and their own country, can be repeated) How to derive such elements grouped by

Selecting the lowest value from and xml without sorting

谁都会走 提交于 2019-12-10 16:21:30
问题 I'm transforming an xml document to an html table using xslt, and now what I want to do is to change the background color of the cell containing the lowest "price" value without sorting my list. I'm new on this, so what I'm doing is following the W3C schools examples. The xml file looks like this: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Edited by XMLSpy® --> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company>

XSLT Filter result using XSLT array

前提是你 提交于 2019-12-10 16:17:57
问题 I am a beginner in XSLT. Below is source XML which i receive. Request tag constains the FlightId which is being used to filter the Result tag. Source XML: <Response> <Request> <RequestedFlights> <FlightId>2121</FlightId> <FlightId>2584</FlightId> </RequestedFlights> </Request> <Result> <Flights> <Flight> <Segments> <Segment> <Id>1</Id> <FlightNumber>2121</FlightNumber> </Segment> <Segment> <Id>2</Id> <FlightNumber>1121</FlightNumber> </Segment> </Segments> </Flight> <Flight> <Segments>

Check text string against an array in if-test

隐身守侯 提交于 2019-12-10 12:25:30
问题 Is there any way to check if a text string contains any of the entries in pre-determined array? The use case is I am parsing through a large amount of text and looking for text links. As a result I am scrubbing through each word and doing checks on each word looking for popular top level domains to see if they are a link. Here is some broken code but gives you an idea: XML: <feed> <description>You can come here to yourwebsite.org to learn more</description> </feed> XSL: <xsl:variable name=

XSLT define a variable and check if it exists after

99封情书 提交于 2019-12-10 11:09:50
问题 I am attempting to transform an XML document. First, I am defining a global variable: <xsl:variable name="foo"><xsl:value-of select="bar"/></xsl:variable> Now there is a chance that the XML I'm transforming has <bar>some data</bar> defined. There is also a chance that it is not defined. Once I declare the global variable below, I'm trying to output the following if it is defined: <foo>DEFINED</foo> and if it's not defined: <foo>NOT DEFINED</foo> I am using <xsl:stylesheet version="1.0" xmlns

How to display thumbnails from harvested items in DSpace?

徘徊边缘 提交于 2019-12-10 10:18:19
问题 I am trying to display the thumbnails from harvested items. The settings I have for the harvesting options is Harvest metadata and references to bitstreams (requires ORE support) . When looking for the code on how DSpace displays the filenames and file sizes of the bitstreams of the harvested items in simple view, I found that in https://github.com/DSpace/DSpace/blob/dspace-6.1/dspace-xmlui-mirage2/src/main/webapp/xsl/aspect/artifactbrowser/item-view.xsl#L375-L378 <!-- Special case for