xslt

How to set overflow content to go underneath instead of fitting in one row

笑着哭i 提交于 2020-01-15 09:38:12
问题 I have an XSL file set up: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template name="homeArticleThumb" match="/"> <xsl:for-each select="Collection/Content"> <div class="setTableCell vertAlignT"> <div class="articleTeaserHolder"> <div class="imgHolder"> <xsl:variable name="imageSrc" select="Html/root/NewsArticle/artThumb/img/@src" /> <xsl:variable name="imageId"> <xsl:text>NewsArticle_</xsl:text> <xsl:value-of

How to iterate multiple cross-references?

£可爱£侵袭症+ 提交于 2020-01-15 09:14:11
问题 My XML source specifies cross-references in linkGrp . Based on those cross-references specified by the @target attribute, I need to group the values of the s elements. If the target attribute contains one-to-one reference, the code I have works well as follows: <DIV> <div id="e"> <s id="e1">AAAAA</s> <s id="e2">BBBBB</s> <s id="e3">CCCCC</s> </div> <div id="fr"> <s id="fr1">DDDDD</s> <s id="fr2">EEEEE</s> <s id="fr3">FFFFF</s> </div> <linkGrp type="alignment" domains="e fr"> <link target="#e1

Using for loop in XSLT

本秂侑毒 提交于 2020-01-15 08:08:33
问题 I have an xml in the following format: <?xml version="1.0" encoding="UTF-8"?> <response> <cases> <case>CASE-ONE</case> <case>CASE-TWO</case> </cases> <results> <Final-Results> <issues> <row> <IKEY>2014-03-26-05.22.22.193840T01</IKEY> <PRTY>999</PRTY> </row> </issues> </Final-Results> <Final-Results> <issues> <row> <IKEY>2014-03-26-05.05.51.077840T01</IKEY> <PRTY>999</PRTY> </row> <row> <IKEY>2014-03-26-05.10.51.077840T01</IKEY> <PRTY>999</PRTY> </row> </issues> </Final-Results> </results> <

Expanding datetime ranges in XSLT 1.0

你说的曾经没有我的故事 提交于 2020-01-15 07:43:06
问题 I have an XML feed of events whose dates I would like to interact with. Source XML: <?xml version="1.0" encoding="UTF-8"?> <events> <event> <!-- various elements --> <start_datetime value="2012-02-09 10:00:00"/> <end_datetime value="2012-02-09 11:00:00"/> <!-- various elements --> </event> <event> <!-- various elements --> <start_datetime value="2012-02-09 10:00:00"/> <end_datetime value="2012-02-10 15:00:00"/> <!-- various elements --> </event> <!-- other events --> </events> Notice that

Expanding datetime ranges in XSLT 1.0

百般思念 提交于 2020-01-15 07:42:17
问题 I have an XML feed of events whose dates I would like to interact with. Source XML: <?xml version="1.0" encoding="UTF-8"?> <events> <event> <!-- various elements --> <start_datetime value="2012-02-09 10:00:00"/> <end_datetime value="2012-02-09 11:00:00"/> <!-- various elements --> </event> <event> <!-- various elements --> <start_datetime value="2012-02-09 10:00:00"/> <end_datetime value="2012-02-10 15:00:00"/> <!-- various elements --> </event> <!-- other events --> </events> Notice that

Last day of previous month in XSLT

时光毁灭记忆、已成空白 提交于 2020-01-15 07:35:21
问题 Is it possible to get the last day of the previous month in XSLT? I found this function: http://www.xsltfunctions.com/xsl/functx_last-day-of-month.html but I'm not sure how to use it to get the previous month. 回答1: Use : current-date() - xs:dayTimeDuration(concat('P', day-from-date(current-date()), 'D')) This produces (when evaluated on any day of May 2012): 2012-04-30-07:00 来源: https://stackoverflow.com/questions/10483246/last-day-of-previous-month-in-xslt

Define default namespace (unprefixed) in lxml

限于喜欢 提交于 2020-01-15 07:01:27
问题 When rendering XHTML with lxml, everything is fine, unless you happen to use Firefox, which seems unable to deal with namespace-prefixed XHTML elements and javascript. While Opera is able to execute the javascript (this applies to both jQuery and MathJax) fine, no matter whether the XHTML namespace has a prefix ( h: in my case) or not, in Firefox the scripts will abort with weird errors ( this.head is undefined in the case of MathJax). I know about the register_namespace function, but it does

XSLT 1.0 Grouping with multiple elements with same name

╄→尐↘猪︶ㄣ 提交于 2020-01-15 06:59:12
问题 I have an XML that looks like - <resultset> <hit> <content> <ITEM> <TITLE>Office Cleaning</TITLE> <DESCRIPTION>blah blah blah</DESCRIPTION> <Hierarchy>level1A:level2A:level3A</Hierarchy> <Hierarchy>level1B:level2B:level3B</Hierarchy> </ITEM> </content> </hit> <hit> <content> <ITEM> <TITLE>Office Cleaning1</TITLE> <DESCRIPTION>blah blah blah</DESCRIPTION> <Hierarchy>level1A:level2A:level3A</Hierarchy> </ITEM> </content> </hit> <hit> <content> <ITEM> <TITLE>Office Cleaning2</TITLE> <DESCRIPTION

XSL - Copy tree, copying some nodes twice and changing attribute in second copy

我与影子孤独终老i 提交于 2020-01-15 06:01:32
问题 I need to copy a tree. But for certain nodes (where attr2="yyy") I want to make 2 copies: First one "as it is" Second one modifying attr2 value. Input: <root> <element> <node1 attr1="xxx">copy once</node1> <node2 attr2="yyy">copy twice, modify attr2 in 2nd copy</node2> <node3 attr2="yyy" attr3="zzz">copy twice, modify attr2 in 2nd copy</node3> </element> </root> Desired output: <root> <element> <node1 attr1="xxx">copy once</node1> <node2 attr2="yyy">copy twice, modify attr2 in 2nd copy</node2

'Characters only' check in xsl string?

一笑奈何 提交于 2020-01-15 05:33:16
问题 How can i check if a string include only characters (XSLT File)? <xsl:variable name="IsValid1"> <xsl:choose> <xsl:when test="string-length(//FirstName) > 0 and string-length(//LastName) > 0 and substring(//FirstName, 1, 3) != 'TST' and XXXX//FirtName only charactersXXXXX "> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </xsl:variable> 回答1: In XPath 1.0 (XSLT 1.0) you can use contains() . In XPath 2.0 (XSLT 2.0) you use matches() . You may want for example check for alphabetic