xslt-2.0

How to apply a function to a sequence of nodes in XSLT

巧了我就是萌 提交于 2021-01-04 04:27:33
问题 I need to write an XSLT function that transforms a sequence of nodes into a sequence of strings. What I need to do is to apply a function to all the nodes in the sequence and return a sequence as long as the original one. This is the input document <article id="4"> <author ref="#Guy1"/> <author ref="#Guy2"/> </article> This is how the calling site: <xsl:template match="article"> <xsl:text>Author for </xsl:text> <xsl:value-of select="@id"/> <xsl:variable name="names" select="func:author-names(

Are there any XSLT and XQuery Processors available for .NET Core 3.0 apps?

夙愿已清 提交于 2020-08-20 07:02:20
问题 I've been using Saxon XSLT and XQuery processor - Free home edition for some of my .NET apps. I need only XSLT 2.0 (since .NET does not support XSLT 3.0). Now that I've moved from .NET Framework to .NET Core , I noticed that the Saxon has not yet supported .NET Core since when installing a Nuget package for Saxon, I get the following error. Question : Are there other alternatives that someone knows I can use for my .NET Core projects that need XSLT 2.0 and XQuery processing? Because of the

From xml want to fetch subchapter number in xref in html using XSL

删除回忆录丶 提交于 2020-07-22 11:19:09
问题 From xml want to fetch subchapter number of subchapter in xref in html using XSL. I am not able to count and fetch the correct sub-chapter numbering in xref link text. Scenario in xml: xref is added in subchapter 2.2 and referenced to subchapter 1.2, subchapter 2.1 and 1.3 Expected result in html from xml In html output xref should append the correct number such as Sub-section 1.2, Sub-section 2.1 and Sub-section 1.3 respectively. Note: Number in subchapter as 1.1, 1.2, 1.3 etc is given for

How to limit the number of words in XSLT?

醉酒当歌 提交于 2020-07-10 10:25:40
问题 Given the following XML document: <books> <book> <name>The problem of the ages</name> </book> <book> <name>Filtering the tap</name> </book> <book> <name>Legend of Atlantis</name> </book> </books> I want to take at most 2 words from the name of each book. Words can be assumed as being sequences of whitespace-separated characters. Example of output: <library> <record>The problem</record> <record>Filtering the</record> <record>Legend of</record> </library> How would I achieve this using a single

Extract value from one XML while matching template in other XML using XSLT

Deadly 提交于 2020-06-17 13:22:08
问题 I have 2 XMLs. I am trying to run XSLT on 1st XML and matching data in 2nd XML using keys. While doing template-match on 2nd XML,I am unable to pull data from 1st XML's matching node(dont know how to pull any data from there per say) and populate it in there. Below are samples and expected output. 1st XML- <parent> <child> <name>John</name> <city>Boston</city> <shortCityCode>B</shortCityCode> </child> <child> <name>John</name> <city>Seattle</city> <shortCityCode>S</shortCityCode> </child>

Evaluate Xpath2.0 in python

隐身守侯 提交于 2020-05-29 03:18:06
问题 I have an XPath expression as shown below. if(replace(//p[1]/text(),'H','h') = 'hello') then //p[1]/text() else if(//p[1]/text() = 'world') then //p[2]/text() else 'notFound' I want to display which 'if ' expression worked. e.g //p[1]/text() if first 'if' expression worked. 'If' expression can have nested if, for loops and xpath2.0 functions. I can't find any xpath2.0 library for python. So I tried to convert this Js library to python still I can able to split xpath2.0 expression to lexers