xslt-1.0

Find and replace entity in xslt

北城余情 提交于 2019-12-08 13:26:46
问题 i need to find and replace an entity in xslt. i need to do this without using template match. suppose my xml like this, <root> <p>Master&apos;s</p> <p><blockFixed type="quotation"><p>let&apos;s</p></blockFixed></p> <p>student&apos;s<featureFixed id=1/></p> <p><blockFixed type="quotation"><p>nurse&apos;s</p></blockFixed></p> <p>Master&apos;s</p> </root> i need to change &apos; into ’ so output should be like this, <root> <p>Master<apos>’</apos>s</p> <p><blockFixed type="quotation"><p>let<apos>

How to write a CSV-parser using XSLT 1.0?

烈酒焚心 提交于 2019-12-08 11:52:48
问题 I need to make a CSV-parser using XSLT 1.0. I have tried a recursive approach, but I can't seem to match the line endrings, so the input to the printLine-template is always empty. <xsl:template match="/"> <xsl:call-template name="printLine"> <xsl:with-param name="line"> <xsl:value-of select="substring-before(//csvText, '\n')"/> </xsl:with-param> <xsl:with-param name="remaining"> <xsl:value-of select="substring-after(//csvText, '\n')"/> </xsl:with-param> </xsl:call-template> </xsl:template>

How to build a recursive navigation in XSL/XML

拟墨画扇 提交于 2019-12-08 10:30:36
问题 I'm trying to build a navigation that in theory could recurse infinitely with XSL. Unfortunately my skills in this arena are still being built. Can anyone tell me where I'm going wrong with this code? The kicker here is that the first 2 levels of the nav are somewhat unique (class names and such) but after level 3 the nav is pretty much the same elements being nested over and over. To Update: There's no recursion after nav level 2, the output is non existent after level 2, and I can't figure

Complex selection of XSL 1.0 node set

懵懂的女人 提交于 2019-12-08 09:01:56
问题 (This question is a less simplified version of my problem. The more simplified version which was already answered can be found here. I'm posting this more complicated question due to a comment by michael.hor257k who suggested that there may be an alternative approach that could solve it - possibly using select in a loop, or possibly a completely different approach.) I'd like to process an XML file, over whose format I have no control, to generate C++ code. I need to process functions defined

backbone app not calling in xsl but works fine in my local

空扰寡人 提交于 2019-12-08 06:57:17
问题 I am trying to call the backbone app through xsl... its working fine...but the problem is when i put inside a function its not working... i tested with console.log inside that function..i am able to see console log...but its not calling backbone app,, providing my code below... the same function working fine when i dont put in xsl thats is when i test it in my local... do i need to include anything in my xslor upgrade xsl...i dont see my app rendering in browser through xsl...but it works

Display X distinct random node sets using XSLT 1.0

ⅰ亾dé卋堺 提交于 2019-12-08 06:56:48
问题 I've got a simple xsl code to display some dynamically xml. <xsl:template match="/"> <xsl:for-each select="NewDataSet/Vehicle"> <div class="item"> <xsl:value-of select="ManufacturerName" /><br /> <xsl:value-of select="Model" /><br /> <xsl:value-of select="Colour" /><br /> £<xsl:value-of select='format-number(Price, "###,###,##0.")' /> </div> </xsl:for-each> </xsl:template> What I'd like to be able to do is display X number of random distinct node sets instead of all of them. Is this possible

XSLT 1.0 - Remove duplicates fields

南笙酒味 提交于 2019-12-08 06:09:34
问题 I'm having a problem with XSLT V1.0 with removing the duplicated nodes. I have this for entry <?xml version="1.0" encoding="utf-8"?> <myRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Mappings> <Mapping fieldName="field1" > </Mapping> <Mapping fieldName="field1"> </Mapping> <Mapping fieldName="field2" > </Mapping> <Mapping fieldName="field3" > </Mapping> <Mapping fieldName="field4"> </Mapping> </Mappings> </myRoot> I have this XSL file <?xml version="1.0"?> <xsl:stylesheet

How “to fold recursively by a tag” a group of selected (neighbor) tags with XSLT1?

社会主义新天地 提交于 2019-12-08 05:57:50
问题 I was comment the present problem at this other one: the present is more complex because needs a recurrence. Detailing by example: <root> <c>cccc</c> <a gr="g1_1">aaaa</a> <b gr="g1_1">1111</b> <a gr="g2_1" into="g1_1">bbbb</a> <b gr="g2_1" into="g1_1">56565</b> <a gr="g3_1" into="g2_1">BB</a> <b gr="g3_1" into="g2_1">55</b> <a gr="g1_2">xxxx</a> <b gr="g1_2">2222</b> <a gr="g2_2" into="g1_2">wwww</a> <b gr="g2_2" into="g1_2">3433</b> </root> that must be enclosed by fold tags, resulting

trim mixed content to max number of characters with xslt

孤街醉人 提交于 2019-12-08 05:25:04
问题 I have the following xml: <p>Lorem ipsum dolor sit amet, <b>consectetur adipisicing</b> elit, <i>sed do<sup>2</sup></i> eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> And I want to show the first 200 characters only, but it may not cut off in the middle of a word, and I want to keep the formatting elements. So above fragment after transformation becomes: <p>Lorem ipsum

How to find the 3rd Wednesday of the month in XSLT 1.0

无人久伴 提交于 2019-12-08 04:25:53
问题 I have to find the next 3rd Wednesday of a month and I can't seem to come up with a good solution on XSLT to do this. For instance, today is August 11th so the next 3rd Wednesday of the month is August 16th. But if today is August 17th then the next 3rd Wednesday of the month will be Sept 20th. Is there anyway to do this in XSLT 1.0? 回答1: Interesting problem - let's make it more generic: Calculating N-th day-of-week in a given month, using pure XSLT 1.0: <xsl:template name="Nth-weekday-of