xslt-2.0

merge two elements using xslt based on attribute values

帅比萌擦擦* 提交于 2019-12-02 10:03:58
问题 This is how my source file looks like: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <book> <mbean code="org.book.mybooks" name="mycompany.props.jndi:name=mybookprops"> <attribute name="bookprops"> abc.mybook.onebook=@Value@ def.mybook.twobook=@Value@ ghi.myebook.threebook=@Value@ </attribute> </mbean> <book> <mbean code="org.book.mybooks" name="mycompany.props.jndi:name=mybookprops"> <attribute name="bookprops"> abc.mybook.onebook=@New_Value@ def.mybook.twobook=@New_Value@ ghi

Concatenate xml file in ant script

微笑、不失礼 提交于 2019-12-02 09:39:22
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 another using xmltask. I am not sure how to copy all the xml files content in a folder into a single xml

Get value after each last colon

倖福魔咒の 提交于 2019-12-02 09:06:05
I need to get the value of each data after the last colon. For example, I have this file: <Data> :20:PmtReferenceID000012 :21:Not used :25: PHMNLBICXXX/Account00010203 :28c:00001/0001 (The 'c' in :28 can be either in upper or lower case) :20:PmtReferenceID000012 :21:Not used :25: PHMNLBICXXX/Account00010203 :28c:00001/0001 (The 'c' in :28 can be either in upper or lower case) </Data> I need to store the value after the ':20:' to <ABCD> , ':21:' to <EFGH> , ':25:' to <IJKL> and ':28c:' to <MNOP> . Here is my XSLT: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

check condition in xslt

大憨熊 提交于 2019-12-02 08:35:31
问题 Below is the input XML (Little Big) sorry for the bigger input XML and as well as output xml <tutorial> <lessons> <lesson> chapter unit 1 page </lesson> <lesson> chapter unit 10~ page </lesson> <lesson> chapter unit page </lesson> <lesson> note lesson </lesson> <lessons1> <lesson> chapter unit 1 page </lesson> <lesson> description page </lesson> <lesson> chapter unit page </lesson> </lessons1> </lessons> </tutorial> Below is my Output Xml <?xml version="1.0" encoding="ISO-8859-1"?> <Geography

eXist - loading XSLT collection() - Exception thrown by URIResolver

情到浓时终转凉″ 提交于 2019-12-02 08:24:04
Environment: eXist-db 4.2.1 , XQuery 3.1, XSLT 2.0 In eXist-db I am loading an XSLT file which includes a reference to a collection in eXist (in order to perform a search on documents found there, using a key). This reference seems to throw an error from Saxon. Exception while transforming node: Exception thrown by URIResolver XML docs are located at /db/apps/deheresi/data/ XSLT docs are located at /db/apps/deheresi/data/styles In the transform function, I am passing a parameter from XQuery to the XSLT file for the absolute path to the data folder: <param name="paramDatauri" value="xmldb:exist

xslt remove duplicate elements

冷暖自知 提交于 2019-12-02 07:45:23
问题 I am trying to remove elements with the same href attribute form this file: <?xml version="1.0" encoding="UTF-8"?> <images> <item id="d1e152_1" href="Pic/104764.jpg" media-type="image/jpeg"/> <item id="d1e163_2" href="Pic/104764.jpg" media-type="image/jpeg"/> <item id="d1e174_3" href="Pic/104764.jpg" media-type="image/jpeg"/> <item id="d1e218_4" href="Pic/104763.jpg" media-type="image/jpeg"/> <item id="d1e349_5" href="Pic/110001.tif" media-type="image/tif"/> <item id="d1e681_6" href="Pic

Number of rows in a flat file transformed from xml using xslt

对着背影说爱祢 提交于 2019-12-02 06:52:39
问题 Below is the xsl I have used for transforming an xml to a flat file, whci also satisfies various other required conditions. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ext="http://exslt.org/common"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:variable name="vrtfDefaults"> <termCat/> <termVocab/> </xsl:variable> <xsl:variable name="vDefaults" select="ext:node-set($vrtfDefaults)"/> <xsl:variable name="vQ">"<

Merge different products belong to each standard

家住魔仙堡 提交于 2019-12-02 05:58:28
I have to transform the following xml content, <Standards xmlns="http://ws.wso2.org/dataservice"> <Standard> <ProductID>200057</ProductID> <Prefix>ISO</Prefix> <SNumber>1001</SNumber> <DraftProducts> <RelatedProduct> <ProductID>1500163</ProductID> </RelatedProduct> </DraftProducts> <ReferenceProducts> <RelatedProduct> <ProductID>263973</ProductID> <RelationId>708519</RelationId> <Designation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/> </RelatedProduct> <RelatedProduct> <ProductID>320056</ProductID> <RelationId>934789</RelationId> <Designation xmlns:xsi="http://www.w3

check condition in xslt

∥☆過路亽.° 提交于 2019-12-02 05:51:26
Below is the input XML (Little Big) sorry for the bigger input XML and as well as output xml <tutorial> <lessons> <lesson> chapter unit 1 page </lesson> <lesson> chapter unit 10~ page </lesson> <lesson> chapter unit page </lesson> <lesson> note lesson </lesson> <lessons1> <lesson> chapter unit 1 page </lesson> <lesson> description page </lesson> <lesson> chapter unit page </lesson> </lessons1> </lessons> </tutorial> Below is my Output Xml <?xml version="1.0" encoding="ISO-8859-1"?> <Geography> <historical> <social> <toc1> <toc> <chapter>chapter</chapter> <unit>unit 1</unit> <pages>page</pages>

Annotating an xml instance from a list of xpath statements with xslt

时光总嘲笑我的痴心妄想 提交于 2019-12-02 05:43:39
问题 Given a list of xpath statements, I want to write a stylesheet that will run through an xml document and output the same document but with a comment inserted before the node identified in each xpath statement. Let's make up an example. Start with an xml instance holding the xpath statements: <paths> <xpath location="/root/a" annotate="1"/> <xpath location="/root/a/b" annotate="2"/> </paths> Given the input: <root> <a> <b>B</b> </a> <c>C</c> </root> It should produce: <root> <!-- 1 --> <a> <!-