xslt

sum of alternate numbers (XML/XSL)

≡放荡痞女 提交于 2020-08-25 05:03:10
问题 Need to add alternate digits in a number receiving from XML file using XSLT, for instance If I am receiving a 123456789, I need to calculate alternate digit sum from right most using XSLT function, can i have any suggestions on this ? Thanks, Laxmikanth.S 回答1: This is extremely easy to do with XSLT 2.0 (actually just with a single XPath 2.0 expression): The following XSLT transformation: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="text"

XSL substring and indexOf

人盡茶涼 提交于 2020-08-21 07:53:13
问题 I'm new to XSLT. I wonder if it is possible to select a substring of an item. I'm trying to parse an RSS feed. The description value has more text than what I want to show. I'd like to get a subtring of it based on the index of some substring. Basically, I want to show the result of a substring call passing indxOf('some_substring') and a length as parameters. Is this possible? From comments : I want to select the text of a string that is located after the occurrence of substring 回答1: It's not

XSLT Parsing XML with &lt and &gt

一个人想着一个人 提交于 2020-08-20 05:59:27
问题 I have an XML document that has a TextBlock that contains the below samplecode. <TextBlock> <config>This is a config.</config> <path>This is a file path.</path> </TextBlock> The actual XML file contains the below <TextBlock> <config>This is a config.</config> <path>This is a file path.</path> </TextBlock> I'm trying to get the value of path tag using XSLT 1.0 <h1> <xsl:value-of select="/TextBlock/path" disable-output-escaping="yes"/> </h1> I don't get the value because the XML structure is

Need to include the working code with multiple cyclic mode is not working

喜你入骨 提交于 2020-08-10 20:13:51
问题 I need to run all templates on the mode based, So I'm having firstmode which is needs to run the corresponding template based mode Input I'm having: <section> <p class="p heading">Heading</p> <p class="normal">Text</p> </section> Working XSL: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all" version="3.0"> <xsl:template match="*"> <xsl:variable name="firstmode"> <xsl:element name="{name()}"> <xsl:copy-of

Need to include the working code with multiple cyclic mode is not working

≯℡__Kan透↙ 提交于 2020-08-10 20:13:11
问题 I need to run all templates on the mode based, So I'm having firstmode which is needs to run the corresponding template based mode Input I'm having: <section> <p class="p heading">Heading</p> <p class="normal">Text</p> </section> Working XSL: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all" version="3.0"> <xsl:template match="*"> <xsl:variable name="firstmode"> <xsl:element name="{name()}"> <xsl:copy-of

How to convert flat xml data to hierarchical data xml 2

我的梦境 提交于 2020-08-10 19:14:27
问题 Following my question XSL change structure of ODT XML file, I cannot work out the solution given in this thread How to convert flat xml data to hierarchical data xml in my case. I slightly changed the input xml (h instead of p for titles) : <body> <h class="head1">1: Heading level 1</h> <p>some text here</p> <p>some text here</p> <h class="head2">1.1: Heading level 2</h> <p>some text here</p> <p>some text here</p> <h class="head3">1.1.1: Heading level 3</h> <p>some text here</p> <p>some text

Need to remove the extra normal element

我们两清 提交于 2020-08-10 17:41:46
问题 I'm having the element which coming repeatedly, need to remove the element and rearrange it Input XML: <section> <p class="p heading">Heading</p> <p class="normal">Text</p> <ul> <li><p class="p"><span class="bold">Check</span> - Remaining</p></li> </ul> </section> XSL I'm having, In that I'm changing list para and into normal para: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:math="http://www.w3.org/2005/xpath-functions

Need to remove the extra normal element

徘徊边缘 提交于 2020-08-10 17:41:26
问题 I'm having the element which coming repeatedly, need to remove the element and rearrange it Input XML: <section> <p class="p heading">Heading</p> <p class="normal">Text</p> <ul> <li><p class="p"><span class="bold">Check</span> - Remaining</p></li> </ul> </section> XSL I'm having, In that I'm changing list para and into normal para: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:math="http://www.w3.org/2005/xpath-functions