xslt-1.0

Merge successive descendant nodes into one

我们两清 提交于 2019-12-24 01:54:27
问题 XML: <t> <ScreenSize> <Width>1440</Width> <Height>900</Height> </ScreenSize> <ConfigurationHotSpots> <Rectangle> <Location> <X>0</X> <Y>0</Y> </Location> <Size> <Width>50</Width> <Height>50</Height> </Size> <X>0</X> <Y>0</Y> <Width>50</Width> <Height>50</Height> </Rectangle> </ConfigurationHotSpots> </t> Desired Output XML: <t> <ScreenSizeWidth>1440</ScreenSizeWidth> <ScreenSizeWidth>900</ScreenSizeWidth> <ConfigurationHotSpotsRectangleLocationX>0</ConfigurationHotSpotsRectangleLocationX>

How to do xslt Muenchian grouping with some null attributes?

不打扰是莪最后的温柔 提交于 2019-12-24 01:50:48
问题 Slightly different to the standard Meunchain grouping as I'm dealing with a null(?) attribute for some of the tags that I'm transforming. I'd like the null groupings to be treated as their own individual group with the transformed output adding the grouped strings. Also if there is a grouping to do a count of how many there were. <root> <section> <subsection> <module> <comp>111</comp> </module> <module group='group01'> <comp>222</comp> </module> <module group='group01'> <comp>333</comp> <

Using a Map in XSL for expanding abbreviations

≡放荡痞女 提交于 2019-12-24 01:19:29
问题 I saw a similar question on creating a Map. That answer has this code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:template match="/"> <xsl:variable name="map"> <map> <entry key="key-1">value1</entry> <entry key="key-2">value2</entry> <entry key="key-3">value3</entry> </map> </xsl:variable> <output> <xsl:value-of select="msxsl:node-set($map)/map/entry[@key='key-1']"/> </output> </xsl:template> I would like

How to sort the elements (columns) in xslt to transform the xml file to csv format

泪湿孤枕 提交于 2019-12-24 00:05:49
问题 <?xml version="1.0" encoding="utf-8"?> <Report p1:schemaLocation="Customer details http://reportserver?%2fCustomer details&rs%3aFormat=XML&rc%3aSchema=True" Name="Customer details" xmlns:p1="http://www.w3.org/2001/XMLSchema-instance" xmlns="Customer details"> <table2> <Detail_Collection> <Detail Col1="aaa" col1_SeqID="2" col1_Include="1" Col2="aaa" col2_SeqID="1" col2_Include="1" Col3="aaa" col3_SeqID="" col3_Include="0" Col4="aaa" col4_SeqID="4" col4_Include="1" Col5="aaa" col5_SeqID="" col5

How to find min and max value using xsl 1.0?

我只是一个虾纸丫 提交于 2019-12-23 20:16:15
问题 file_1.xml <productlist> <items> <item>Pen</item> <price>8</item> </items> <items> <item>Pen</item> <price>5</item> </items> <items> <item>Pen</item> <price>10</item> </items> <items> <item>Bag</item> <price>15</item> </items> <items> <item>Bag</item> <price>22</item> </items> <items> <item>Bag</item> <price>20</item> </items> </productlist> file_2.xml <productlist> <items> <item>Pen</item> </items> <items> <item>Bag</item> </items> </productlist> need out put like below with max and min

How can I apply an xslt template to a string?

女生的网名这么多〃 提交于 2019-12-23 18:55:34
问题 Given a template used for building some html around a value, I want to pass in a string, rather than a node set. As an example I want to concat some values and pass that to the template. How can I achieve that sort of thing? <xsl:template match="text()" mode="kvp-print-single"> <tr> <td colspan="3"><xsl:value-of select="."/></td> </tr> </xsl:template> ... <xsl:apply-templates select="concat=(haba/hiba:text(), ' - ', huba/baba:text())" mode="kvp-print-single"/> ErrorMsg: xml or stylesheet file

Including a plain text file with XSLT 1.0

余生颓废 提交于 2019-12-23 14:57:37
问题 How can I include the content of a plain text file in a result document from within an XSLT 1.0 stylesheet? I.e., just like document() , but without parsing it: <xsl:value-of select="magic-method-to-include-plaintext(@xlink_href)" /> I am almost sure, that this doesn't work without extension, because: there is a special XPath function defined for this in XSLT/XPath 2.0: <xsl:value-of select="unparsed-text(@xlink:href, 'UTF-8')"/> the XSLT FAQ only lists a Java extension to achieve this via

How to subtract value in xslt?

南笙酒味 提交于 2019-12-23 13:27:32
问题 Could you please tell me how to subtract value in xslt using a variable? Here is my code: <xsl:variable name="currentCurpg" select="1"/> <xsl:variable name="tCurpg" select="($currentCurpg-1)"/> The variable tCurpg should be zero or 0 . Why I am getting error? <?xml version="1.0" encoding="UTF-8" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" />

How to shorten filename displayed in DSpace

吃可爱长大的小学妹 提交于 2019-12-23 12:10:20
问题 I would like to shorten the file name that is being displayed in the simple item view. If I have a very long file name, this is displayed in the simple item record: This example file name is shortened if you view the full item record: But if you edit this item and click the Item Bitstreams tab, the file name is being displayed like this: My goal is to apply what is being displayed in the edit bitstream (the 3rd picture) to the simple and full item view. I don't know where this transformation

How to insert CDATA into XML text markup exported from Access 2003?

放肆的年华 提交于 2019-12-23 11:57:43
问题 I've got an XML export from Access 2003 and I tried to insert CDATA tag on text field (latin...) with XSLT but I'm very bad in XSLT... Here the XML source : <?xml version="1.0" encoding="UTF-8"?> <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MESSAGES%20old.xsd" generated="2012-07-31T13:25:46"> <export_x005F_xml_message> <libelle>h euismod tincidu </libelle> <price>300</price> <libelle2>h euirci