xslt-2.0

XSL - create well formed xml from text file

倾然丶 夕夏残阳落幕 提交于 2019-12-11 05:52:36
问题 I have a pipe delimited text file as shown below, which I need to transform into a well formed xml structure (example shown below) using xsl. The xsl below is my (latest) attempt at solving this - however I cannot seem to find a way to encapsulate the level 002 elements in level 001, i.e. maintain the parent-child relationship, when iterating through the file line by line. Could anyone help here ? Pipe delimited file - input 001|XXX|YYY 002|AAA|BBB 002|CCC|DD 001|EEF|XXX 002|HHH|GGG XML File

Xslt generic to convert xml file to json

China☆狼群 提交于 2019-12-11 05:39:07
问题 I would like to create a generic xslt for my java application that converts an xml file into a json output.To try to make software as dynamic as possible My xml input : <?xml version="1.0"?> <notice> <driver> <forward> <system> <type>xxx</type> <parameters> <parameter key="test1">test1</parameter> <parameter key="test2">test2</parameter> <parameter key="test3">test3</parameter> <parameter key="test4">test4</parameter> <parameter key="test5">test5</parameter> <parameter key="test6">test6<

why function is not called in xslt?

血红的双手。 提交于 2019-12-11 04:28:51
问题 I am trying to call function .But it not display out .here is my code https://plnkr.co/edit/TN1BN5Yao5Z63RDcBGlN?p=preview <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template name="dosomething"> <xsl:text>A function that does something</xsl:text> </xsl:template> <xsl:call-template name="dosomething"/> </xsl:stylesheet> 回答1: xsl:call-template cannot be at the top level of your stylesheet. It must only be used within a template body, for example: <xsl

How do I change the XSLT provider for Spring MVC (i.e. Plug in Saxon 9.x)?

泄露秘密 提交于 2019-12-11 04:21:56
问题 I've done a google but can't see anyone talking about a solution. Is there a proper way of plugging in Saxon so that Spring MVC uses it for its XSLT views instead of whatever comes with the JDK, which is still 1.0 ? (Haven't tried myself, in a rush, so just wondered if anyone out there has already done this and if so how). Thanks. 回答1: Its as Michael says. Basically just put the Saxon jar(s) on the classpath. I imagined it could be, but didn't like to assume, and simply couldn't find a

Convert date format in xslt from YYYYMMDD to MM/DD/YYYY

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 04:17:48
问题 I am Having date in xml file in format like YYYYMMDD Applying the xslt transformation i want to change the format to MM/DD/YYYY . For example, Incoming format - 20160513 Output format - 05/13/2016 回答1: Given: <date>20160513</date> the following: <xsl:template match="date"> <xsl:copy> <xsl:value-of select="substring(., 5, 2)"/> <xsl:text>/</xsl:text> <xsl:value-of select="substring(., 7, 2)"/> <xsl:text>/</xsl:text> <xsl:value-of select="substring(., 1, 4)"/> </xsl:copy> </xsl:template> will

XSLT 2.0 - Sorting issue

♀尐吖头ヾ 提交于 2019-12-11 04:05:41
问题 I have below input XML and I am facing issue while sorting number using XSLT. I have tried multiple logic but not able to generate expected result. I am able to sort the data when it is having only one AccountNo but facing issue when record is having multiple AccountNo and throwing error that too many sort key values. I want to sort the data by AccountNo. <-------XML Data----------> <?XML version="1.0" encoding="UTF-8"> <Bank> <Customer> <Account> <AccountNo>999</AccountNo> <AccountNo>1004<

Using XSLT to create JSON output single quote conversion (XML to JSON)

╄→尐↘猪︶ㄣ 提交于 2019-12-11 04:05:22
问题 While I'm converting input XML file to JSON output, single quote attributes are converted into double quotes. Please anyone guide me to resolve above issue. My input XML file is: <items> <mlu1_item> <title> <strong>Creatinine</strong> </title> <content> <p>Creatinine is a normal waste product</p> <ul> <li>males</li> <li>females</li> </ul> <p>If your creatinine level kidneys.</p> </content> <mlu1_button/> <button_class/> <link/> <image>icon.png</image> </mlu1_item> </items> XSL which I have

what's the relationship between XSL and XSLT

巧了我就是萌 提交于 2019-12-11 04:03:11
问题 I know xsl is description language of style sheets associated with the W3C XML but i don't his relationship with XSLT ? someone can give me an example 回答1: XSL stands for Extensible Stylesheet Language. Historically, the XSL Working Group in W3C produced a draft specification under the name XSL, which eventually split into three parts: XSL Transformation (XSLT): is an XML language for transforming XML documents XSL Formatting Objects (XSL-FO): an XML language for specifying the visual

XSLT - Identify consecutive nodes which has same patterns of attribute values

谁说我不能喝 提交于 2019-12-11 04:01:03
问题 I have xml like this, <section> <p id="ss_main">aa</p> <p id="ss_chap">bb</p> <p id="main">cc</p> <p id="main">dd</p> <p id="main">ee</p> <p id="ss_main">ff</p> <p id="main">gg</p> <p id="main">hh</p> <p id="main">ii</p> <p id="main">jj</p> <p id="ss_chap">xx</p> <p id="ss_main">yy</p> <p id="ss_chap">zz</p> </section> what my requirement is place new nodes named <ss_start> and <ss_end> by covering existing nodes witch are start with ss . so the output should be, <section> <ss_start/> <p id=

How to pass document type parameter to xslt using saxon?

冷暖自知 提交于 2019-12-11 03:41:00
问题 For sending atomic data types will use like transformer.SetParameter(new QName("", "", customXml), new XdmAtomicValue("true")); how to pass a XML/Node as a param to XSLT from C# ? Can you please help me followed your code it's working fine but i am getting only text inside the xml(what i am passing in parameter) but not Nodes XSLT : <xsl:param name="look-up" as="document-node()"/> <xsl:template match="xpp:document"> <w:document xml:space="preserve"> <xsl:value-of select="$look-up"/> </w