xslt-2.0

Converting to text to lowercase in nodes and child nodes in xsl

喜你入骨 提交于 2019-12-04 04:00:52
问题 Using xsl 2.0 I'm trying to convert all uppercase text to having only the first letter of text in each node upper-case. Their are a large number of possible child elements. <text> text text text <head>BLAH <unkownTag>BLAH</unkownTag> BLAH </head> </text> I'd like to transform this to read <text> text text text <head>Blah <unkownTag>Blah</unkownTag> Blah </head> </text> The closest I've come is <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org

Use XSLT to mark up text matching regex?

微笑、不失礼 提交于 2019-12-04 03:41:06
问题 I am trying to use XSLT 2.0 (Saxon-PE 9.6) on an HTML document to create tags that surround all contiguous runs of characters from a specified non-Latin Unicode block (spaces allowed). I need to apply this process to every text() node in the document. I have made some progress with two approaches that use <xsl:analyze-string> and using fn:replace() but I've not been able to arrive at a satisfactory and complete solution. For example, here is some text containing Hindi: Input: <p>चाय का कप

How to get maximum value under same node in xslt

烈酒焚心 提交于 2019-12-04 02:16:21
I have a xml like below : <Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Name>HourlyReport</Name> <Id>8</Id> <TotalResults>1</TotalResults> <TotalPages>1</TotalPages> <Items> <Item> <Id>1</Id> <Hour0>23</Hour0> <Hour1>12</Hour1> <Hour2>7</Hour2> <Hour3>18</Hour3> <Hour4>32</Hour4> . . . <Hour20>28</Hour20> <Hour21>39</Hour21> <Hour22>51</Hour22> <Hour23>49</Hour23> </Item> </Items> </Report> i Need maximum value from above XML using xslt . In above case maximum value is 51 . How i can get that? Also is it possible to get this

How to find a word within text using XSLT 2.0 and REGEX (which doesn't have \b word boundary)?

余生颓废 提交于 2019-12-04 02:02:05
问题 I am attempting to scan a string of words and look for the presence of a particular word(case insensitive) in an XSLT 2.0 stylesheet using REGEX. I have a list of words that I wish to iterate over and determine whether or not they exist within a given string. I want to match on a word anywhere within the given text, but I do not want to match within a word (i.e. A search for foo should not match on " foo d" and a search for bar should not match on "re bar "). XSLT 2.0 REGEX does not have a

XSL Analyze-String -> Matching-Substring into multiple variables

匆匆过客 提交于 2019-12-03 14:54:53
I was wondering if it is possible to use analyze-string and set multiple groups within the RegEx and then store all of the matching groups in variables to use later on. like so: <xsl:analyze-string regex="^Blah\s+(\d+)\s+Bloo\s+(\d+)\s+Blee" select="."> <xsl:matching-substring> <xsl:variable name="varX"> <xsl:value-of select="regex-group(1)"/> </xsl:variable> <xsl:variable name="varY"> <xsl:value-of select="regex-group(2)"/> </xsl:variable> </xsl:matching-substring> </xsl:analyze-string> This doesn't actually work, but that's the sort of thing I'm after, I know I can wrap the analyze-string in

XSLT xsl:sequence. What is it good for..?

烈酒焚心 提交于 2019-12-03 04:57:59
问题 I know the following question is a little bit of beginners but I need your help to understand a basic concept. I would like to say first that I'm a XSLT programmer for 3 years and yet there are some new and quite basics things I've been learning here I never knew (In my job anyone learns how to program alone, there is no course involved). My question is: What is the usage of xsl:sequence ? I have been using xsl:copy-of in order to copy node as is, xsl:apply-templates in order to modifiy nodes

XSLT - regex select only one digit number from text() node

你离开我真会死。 提交于 2019-12-02 22:26:09
问题 I've xml like this, <section> <para>height 4cm, width 5cm, weight 343</para> <para>height 2cm, width 6cm, weight 410</para> <para>height 3cm, width 1cm, weight 590</para> </section> here I need to doubled the single digit numbers of the para/text() . desired output should looks like, <section> <para>height 8cm, width 10cm, weight 343</para> <para>height 4cm, width 12cm, weight 410</para> <para>height 6cm, width 2cm, weight 590</para> </section> To do this I've a template like this, <xsl

grouping following-siblings with same name and same attributes causes exception in saxon

时间秒杀一切 提交于 2019-12-02 20:33:35
问题 I have some xml documents (similar to docbook) that have to be transformed to xsl-fo. Some of the documents contains poems, and the lines of the poems are written in separate p tags. The verses are separated by br tags. There are "page" tags that are irrelevant and should be ignored. Typical code example: <h4>Headline</h4> <p>1st line of 1st verse</p> <p>2nd line of 1st verse</p> <br/> <p>1st line of 2nd verse</p> <p>2nd line of 2nd verse</p> <page n="100"/> <p>3rd line of 2nd verse</p> <h4

Split XML file into multiple files using XSLT

六眼飞鱼酱① 提交于 2019-12-02 18:07:38
问题 I am having trouble splitting an XML file into multiple files using XSLT. I've tried splitting the file based on the attached XSLT code. I've succeeded in getting the file to split. However, I haven't been able to figure out how to replicate the file and create one for each in the original file. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" name="xml"/> <xsl:template match="/"> <xsl

Concatenate xml file in ant script

五迷三道 提交于 2019-12-02 17:48:54
问题 I am new to ant script. I am looking for how to concatenate all the xml file in a folder into a single xml file in ant script. In my project n number of xml files will be generated dynamically in a folder eg: server1.xml, manager.xml, server2.xml, server3.xml. I need to merge all the xml files having server in their filename alone (server1.xml, server2.xml, server3.xml) into a single xml eg: server.xml. and need to deploy it in jboss. I have found that copying content from one xml file to