xslt-1.0

How to do a for-each-group in XSLT 1.0 without keys/Muenchian grouping

帅比萌擦擦* 提交于 2021-02-19 05:34:04
问题 I am currently working with XSLT and trying to group nodes by a sub-string of an attribute. The only thing is I'm working in an environment where I can't use an xsl:key. I was wondering the best way to go about grouping something such as: <RESULTS> <RESULT ID="Result:1-1" Value="32" /> <RESULT ID="Result:1-2" Value="3225" /> <RESULT ID="Result:1-3" Value="372" /> <RESULT ID="Result:1-4" Value="64732" /> <RESULT ID="Test:2-1" Value="6362" /> <RESULT ID="Test:2-2" Value="352" /> <RESULT ID=

How to do a for-each-group in XSLT 1.0 without keys/Muenchian grouping

无人久伴 提交于 2021-02-19 05:33:43
问题 I am currently working with XSLT and trying to group nodes by a sub-string of an attribute. The only thing is I'm working in an environment where I can't use an xsl:key. I was wondering the best way to go about grouping something such as: <RESULTS> <RESULT ID="Result:1-1" Value="32" /> <RESULT ID="Result:1-2" Value="3225" /> <RESULT ID="Result:1-3" Value="372" /> <RESULT ID="Result:1-4" Value="64732" /> <RESULT ID="Test:2-1" Value="6362" /> <RESULT ID="Test:2-2" Value="352" /> <RESULT ID=

XSLT 1.0 escaping double quotes and backslash in a string

假装没事ソ 提交于 2021-02-19 03:14:42
问题 I have a string like below and trying to convert into json format: Test "out" and \new Expected output is Test \"out\" and \new I tried by calling templates for escapequote - working fine for escape quotes: <xsl:template name="escapeQuote"> <xsl:param name="pText" select="concat(normalize-space(.), '')" /> <xsl:if test="string-length($pText) >0"> <xsl:value-of select="substring-before(concat($pText, '"'), '"')" /> <xsl:if test="contains($pText, '"')"> <xsl:text>\"</xsl:text> <xsl:call

XSLT 1.0 escaping double quotes and backslash in a string

吃可爱长大的小学妹 提交于 2021-02-19 03:13:28
问题 I have a string like below and trying to convert into json format: Test "out" and \new Expected output is Test \"out\" and \new I tried by calling templates for escapequote - working fine for escape quotes: <xsl:template name="escapeQuote"> <xsl:param name="pText" select="concat(normalize-space(.), '')" /> <xsl:if test="string-length($pText) >0"> <xsl:value-of select="substring-before(concat($pText, '"'), '"')" /> <xsl:if test="contains($pText, '"')"> <xsl:text>\"</xsl:text> <xsl:call

XSLT 1.0 Kludge cleanup

℡╲_俬逩灬. 提交于 2021-02-17 05:46:33
问题 I am printing a line in reverse font (black background, white text), spread over the width of my receipt tape (41 characters). I have functional code, but I am wondering if there is a better way to do this: Here's my existing code: <text lang="en" align="center" smooth="true" reverse="1"><xsl:value-of select="substring($spaces21, 1, (string-length($spaces21) - ((string-length(SavingsSegment) div 2) + string-length(SavingsSegment) mod 2)))"/> <xsl:value-of select="SavingsSegment"/><xsl:value

XSLT 1.0 Kludge cleanup

一个人想着一个人 提交于 2021-02-17 05:46:31
问题 I am printing a line in reverse font (black background, white text), spread over the width of my receipt tape (41 characters). I have functional code, but I am wondering if there is a better way to do this: Here's my existing code: <text lang="en" align="center" smooth="true" reverse="1"><xsl:value-of select="substring($spaces21, 1, (string-length($spaces21) - ((string-length(SavingsSegment) div 2) + string-length(SavingsSegment) mod 2)))"/> <xsl:value-of select="SavingsSegment"/><xsl:value

How padding char using xsl

别来无恙 提交于 2021-02-17 05:21:30
问题 I want padding the data with extra space(any char) using XSL version 1.0. Name field max chars length is 10 (length must be dyanamic) chars. Need to transfer data using XSL. In XML: <emp> <name>Test</name> </emp> Expected Output : <emp> <name>Test******</name> </emp> Please let me know if anyone have any solution. Thanks in advance. 回答1: Try: substring(concat($yourstring, '**********'), 1, 10) Example using your input: XSLT 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999

Multiple groupings of XML nodes

风格不统一 提交于 2021-02-13 17:37:21
问题 I'm trying to group the input below by the destination and assortment values using muenchian-grouping which is new for me so I'm not sure how to do it properly. The input files will be much larger than this so performance is important. <?xml version="1.0"?> <ns0:Data xmlns:ns0="http://BizTalk_Projects.input"> <transports> <destination>destination 1</destination> <assortment>Volvo_GA961</assortment> <quantity>10</quantity> </transports> <transports> <destination>destination 1</destination>

Multiple groupings of XML nodes

与世无争的帅哥 提交于 2021-02-13 17:36:49
问题 I'm trying to group the input below by the destination and assortment values using muenchian-grouping which is new for me so I'm not sure how to do it properly. The input files will be much larger than this so performance is important. <?xml version="1.0"?> <ns0:Data xmlns:ns0="http://BizTalk_Projects.input"> <transports> <destination>destination 1</destination> <assortment>Volvo_GA961</assortment> <quantity>10</quantity> </transports> <transports> <destination>destination 1</destination>

Testing XML data for being midweek or weekend with XSLT-1?

纵然是瞬间 提交于 2021-02-11 15:33:08
问题 Take the following XML sample: <Meeting BookmarkId="0" PageBreak="0" NumberClasses="1" SpecialEvent="1"> <Date ThisWeek="W20200406" NextWeek="W20200413">April 6-12</Date> <SpecialEvent> <Event>Memorial</Event> <Location>Address goes here</Location> <Date Day="7" DayShort="Tue" DayFull="Tuesday" Month="4" MonthShort="Apr" MonthFull="April" Year="2020">07/04/2020</Date> </SpecialEvent> </Meeting> Bear in mind that this XML content is automatically created for about 50 languages so the locales