xslt-1.0

Override recently added list in home page

大城市里の小女人 提交于 2019-12-04 05:10:59
问题 I wonder if it's possible to override the Recently Added list in the home page. The default behavior is that any new submitted items are displayed in the list regardless of its issue date. Is there a way to override it such that only the latest submitted publications issued for example within two years (or a conditional if dc.date.issued => 2014 ) are displayed? I am using DSpace 5.3 Mirage 2 theme. UPDATE Using @terry's answer, here is the code I tried: <xsl:template match="dri:referenceSet[

How to eliminate all <TAG/> and all attribute=“” by XSLT?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 05:08:00
问题 In a xsl:stylesheet I have this "identity like" transform, to eliminate comments, empty (terminal) tags and empty attributes... But the second xsl:when not works <xsl:template match="node()"> <xsl:choose> <xsl:when test="name()='p' and not(./*) and not(normalize-space(.))"></xsl:when> <xsl:when test="not(name()='img') and not(name()='br') and not(./*) and not(text())" ></xsl:when> <!-- this line NOT WORKS --> <xsl:otherwise><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl

Sort given order with xslt sort

一笑奈何 提交于 2019-12-04 04:53:47
问题 I'm using <xsl:sort /> to sort the rows in a table. The value of @result can be Failed, Ignored or Passed. As it is sorted alphabetically it will not come out in the order I want. Which is Failed - Ignored - Passed How do I achieve this I am using xslt 1.0 This is my code <xsl:apply-templates select="results/test-case"> <xsl:sort select="@result" /> </xsl:apply-templates> 回答1: In your question the ordering you've asked for is consistent with alphabetical order, so a plain <xsl:sort select="

Transform to remove duplicate and copy rest

社会主义新天地 提交于 2019-12-04 04:39:30
问题 I want the output xml to have grouped for the element 'c', according to the attribute 'f'. Here is my input xml and the xslt. I want the group to occur only once and the other nodes should be copied as is to the output. The xslt i tried, copies the entire input xml. So if there are two or more elements with c element and same attribute value for 'f', want the first occurence of that group to the output. My wanted result is also copied. input xml <M> <a> <b> <c f="123"> <d>Al</d> <e NO="678">

Truncate XML with XSLT

故事扮演 提交于 2019-12-04 04:06:44
I have a question for the clever people of the SO community. Below is a snippet of XML generated by the Symphony CMS . <news> <entry> <title>Lorem Ipsum</title> <body> <p><strong>Lorem Ipsum</strong></p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada auctor magna. Vivamus urna justo, pulvinar nec, sagittis malesuada, accumsan in, massa. Quisque mi purus, gravida eget, ultricies a, porta in, sem. Maecenas justo elit, elementum vel, feugiat vulputate, pulvinar nec, velit. Fusce vel ante et diam bibendum euismod. Nunc vel nulla non lorem dignissim placerat. Nulla magna

How to get maximum value under same node in xslt

烈酒焚心 提交于 2019-12-04 02:16:21
I have a xml like below : <Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Name>HourlyReport</Name> <Id>8</Id> <TotalResults>1</TotalResults> <TotalPages>1</TotalPages> <Items> <Item> <Id>1</Id> <Hour0>23</Hour0> <Hour1>12</Hour1> <Hour2>7</Hour2> <Hour3>18</Hour3> <Hour4>32</Hour4> . . . <Hour20>28</Hour20> <Hour21>39</Hour21> <Hour22>51</Hour22> <Hour23>49</Hour23> </Item> </Items> </Report> i Need maximum value from above XML using xslt . In above case maximum value is 51 . How i can get that? Also is it possible to get this

mapping a string containing xml in BizTalk

坚强是说给别人听的谎言 提交于 2019-12-04 01:54:46
问题 I have an xml document with a node that may optionally contain a string of escaped xml. I'd like to be able to transform that content using xsl in a BizTalk map. Any suggestion how? I've tried: msxsl:node-set(string). This creates a nameless single node with no content. The document() function using a url prefix of 'data:text/xml' as suggested by helderdarocha here. for-each selecting the text() of the node containing the string using xpath() in an orchestration to extract the string then

Remove characters using xsl

妖精的绣舞 提交于 2019-12-03 22:54:24
I need to remove the following characters from a string value using xsl 1.0 *, /, \, #, %, !, @, $, (, ), & I have come up with the following: translate(translate(translate(string(//xpath/@value),'.',''),'/',''),',','') In the above approach, I would have to duplicate the same code many times (one time per character). How can I achieve the same goal without duplicating the code? Thanks :-) You simply need translate(//foo/@value, '*\%!@$&', '') in pure XPath respectively inside of an XML document like an XSLT stylesheet you need to escape the ampersand <xsl:value-of select="translate(//foo/

How to convert .csv file to xml using XSLT 1.0?

橙三吉。 提交于 2019-12-03 21:52:05
I have a .csv file generated and I want to transform it to xml using xslt. How to do that? I'm not good in xslt. Please, help me. Thank you. Here's my .csv file CONTRACT_NUMBER,CLIENT_NAME_FULL,STREET_ADDRESS,REGISTRY_NO,DATE_RECEIVED,STATUS,REMARKS 3300016335,name,"address",1_A,3/26/2014,Received,with signature Desired xml: <root> <row> <CONTRACT_NUMBER>CONTRACT_NUMBER</CONTRACT_NUMBER> <CLIENT_NAME_FULL>CLIENT_NAME_FULL</CLIENT_NAME_FULL> <STREET_ADDRESS>STREET_ADDRESS</STREET_ADDRESS> <REGISTRY_NO>REGISTRY_NO</REGISTRY_NO> <DATE_RECEIVED>DATE_RECEIVED</DATE_RECEIVED> <STATUS>STATUS</STATUS>

How to print source XML into a PDF using XSL-FO?

佐手、 提交于 2019-12-03 20:25:36
Good day! I need to write a xsl-fo template but I don't have access to the source XML. Is there a way how top print the source XML into a PDF so that I can copy it from the PDF then and paste into a file? It should have the same structure as the source xml including attributes. Please how to do it? Thank you in advance! Vojtech Edited: I have a web interface where I can paste my template and a PDF is generated. But I don't exactly know what is the structure of the XML used as data source. So I need to write another template which will read input XML (elements, attributes, structure) and write