xslt-1.0

xslt 1.0 base64 encode the content of a template

你。 提交于 2019-12-17 20:54:13
问题 How can I encode the content of a template in base64, using XSLT 1.0? Edit: using serialization mode, runing in PHP enviroment It's like i have a template like this: <xsl:template name="test"> <test gender="male" name1="TEST" name2="TEST"> <sometags> <tag></tag> </sometags> </test> </xsl:template> and I want the output to be like this: <base64

Testing xslt code using your browser

故事扮演 提交于 2019-12-17 20:43:05
问题 Using my browser, I want to test if my xslt code is working. Currently I am copy pasting my xml and xslt code into w3school's example page and test it there. However, this is a real pain, since inserting tabs don't work there, syntax highlighting isn't active and the output window is too small. It is inconvenient to test your code there in general. So: What do I have to setup to test my xslt code? Do I have to change the name of the xslt file to xhtml or html? How do you test xslt code in

Date operations on xsl 1.0

北慕城南 提交于 2019-12-17 14:24:54
问题 I need to get 3 days before and after a given date defined in a variable, and store each one of them in a new individual variable in xsl 1.0. i can't use any extensions or third party tools. Looking trough the answers in the forums, i found this: Expanding datetime ranges in XSLT 1.0 for a similar problem, but i dont fully understand if and how it would aply to my code. Mi date variable is in standard dateTime format, like this: <xsl:variable name="Date" select="2014-05-13T00:00:00"/> And i

Date operations on xsl 1.0

℡╲_俬逩灬. 提交于 2019-12-17 14:23:24
问题 I need to get 3 days before and after a given date defined in a variable, and store each one of them in a new individual variable in xsl 1.0. i can't use any extensions or third party tools. Looking trough the answers in the forums, i found this: Expanding datetime ranges in XSLT 1.0 for a similar problem, but i dont fully understand if and how it would aply to my code. Mi date variable is in standard dateTime format, like this: <xsl:variable name="Date" select="2014-05-13T00:00:00"/> And i

xslt 1.0 string replace function

为君一笑 提交于 2019-12-17 02:51:40
问题 I have a string "aa::bb::aa" and need to turn it in to "aa, bb, aa" I have tried translate(string,':',', ') but this returns "aa,,bb,,aa" How can this be done. 回答1: A very simple solution (that will work as long as your string value doesn't have spaces): translate(normalize-space(translate('aa::bb::cc',':',' ')),' ',',') translate ":' into " " normalize-space() to collapse multiple whitespace characters into a single space " " translate single spaces " " into "," A more robust solution would

xslt 1.0 string replace function

喜你入骨 提交于 2019-12-17 02:50:00
问题 I have a string "aa::bb::aa" and need to turn it in to "aa, bb, aa" I have tried translate(string,':',', ') but this returns "aa,,bb,,aa" How can this be done. 回答1: A very simple solution (that will work as long as your string value doesn't have spaces): translate(normalize-space(translate('aa::bb::cc',':',' ')),' ',',') translate ":' into " " normalize-space() to collapse multiple whitespace characters into a single space " " translate single spaces " " into "," A more robust solution would

Tokenize and compare dates in xslt 1.0

空扰寡人 提交于 2019-12-14 04:23:54
问题 I have a variable in xslt1.0 which contains dates with a separator like ";Aug 11, 2015 11:16;Aug 07, 2015 08:27;Aug12, 2015 15:14" I want to tokenize this variable value and get the latest date and store it in a variable. Can someone please help me. 回答1: Xalan supports the EXSLT str:tokenize() function, so that will take care of that. After that, you just need to sort the tokens by the individual date & time components, and grab the last one. <xsl:for-each select="str:tokenize($dates, ';')">

Lowercase all tag names and attributes inside RSS XML using XSLT

ぐ巨炮叔叔 提交于 2019-12-14 04:20:01
问题 How can I please turn the below (capital letter tags i.e. <RSS> and capital letter attributes i.e. TYPE="audio/mpeg" ) <RSS xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> <CHANNEL> <title>Example Title</title> <LINK>Example Link</link> <atom:link HREF="http://example.com/feed" REL="self" TYPE="application/rss+xml"/> <itunes:subtitle>Example subtitle with itunes namespace</itunes:subtitle> <itunes:owner> <itunes:name>OWNER NAME

xsl get element values from another node tree

左心房为你撑大大i 提交于 2019-12-14 04:19:57
问题 I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim..." xmlns="http://www.loc.gov/MARC21/slim"> <record> <leader>01877nz a2200433o 4500</leader> <controlfield tag="001">1</controlfield> <datafield tag="013" ind1=" " ind2=" "> <subfield code="a">formerge</subfield> </datafield> ... <datafield tag="150" ind1=" " ind2=" "> <subfield code="a">Borneo</subfield> <

Accessing a variable outside the for loop in xsl

余生颓废 提交于 2019-12-14 04:08:18
问题 I am setting a variable as shown below.. <xsl:variable name="FoundFloating"> <xsl:value-of select="'no'" /> </xsl:variable> Now I am doing some processing as shown below .. <xsl:if test="$abcid=$def_id"> <xsl:for-each "$abcd"> <xsl:variable name="abcRate"> <xsl:value-of select="./def_Period/"/> </xsl:variable> <xsl:choose> <xsl:when test="$abcdf !=$abcRate"> <xsl:variable name="$FoundFloating"> <xsl:value-of select="yes" /> </xsl:variable> </xsl:when> </xsl:choose> </xsl:for-each> Now after