xslt

XSL change structure of ODT XML file

╄→尐↘猪︶ㄣ 提交于 2020-08-10 03:38:06
问题 I am trying to convert an fodt file into a different structure using XSLT. I have the following xml (extracted from an fodt file) <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"> <office:blablaTags> officeblabla </office:blablaTags> <office:body> <office:text text:use-soft-page-breaks="true"> <text:variable-decls> officeBlabla </text

XML cross-references in XSLT

余生颓废 提交于 2020-08-09 06:59:05
问题 Below are the input XML and XSL files I have. I need to transform XML into output.xml as mentioned below. I am facing issues with "ref" and "id" attributes of the component tag. input.xml:- <?xml version="1.0" encoding="UTF-8"?> <site id="w123" name="website 1" description="Lorem ipsum"> <views> <view id="p123" name="page 1"> <description>Lorem ipsum</description> <component ref="wg123"/> <component ref="wg1234"/> </view> <view id="p234" name="page 2"> <description>Lorem ipsum</description>

XSLT doc(uri) or document(uri) function not resolving uri in context of content database?

两盒软妹~` 提交于 2020-07-22 22:15:17
问题 Working with latest MarkLogic-10.0-2.1-amd64 on win10 In a xquery I invoke an xslt transformation: xdmp:xslt-invoke("/tidy2html.xslt", doc($docurl)) And within that xslt transformation, I want to retrieve an additional doc (with uri sdp/xref.xml) from the content database where $docurl resides. <xsl:variable name="xref-uri" select="doc('sdp/xref.xml')"/> I'm sure by looking at query console that doc('sdp/xref.xml') exists using XQuery context pointed to the content database. In XSLT I'm a bit

XSLT doc(uri) or document(uri) function not resolving uri in context of content database?

冷暖自知 提交于 2020-07-22 22:13:37
问题 Working with latest MarkLogic-10.0-2.1-amd64 on win10 In a xquery I invoke an xslt transformation: xdmp:xslt-invoke("/tidy2html.xslt", doc($docurl)) And within that xslt transformation, I want to retrieve an additional doc (with uri sdp/xref.xml) from the content database where $docurl resides. <xsl:variable name="xref-uri" select="doc('sdp/xref.xml')"/> I'm sure by looking at query console that doc('sdp/xref.xml') exists using XQuery context pointed to the content database. In XSLT I'm a bit

XSLT doc(uri) or document(uri) function not resolving uri in context of content database?

你说的曾经没有我的故事 提交于 2020-07-22 22:12:37
问题 Working with latest MarkLogic-10.0-2.1-amd64 on win10 In a xquery I invoke an xslt transformation: xdmp:xslt-invoke("/tidy2html.xslt", doc($docurl)) And within that xslt transformation, I want to retrieve an additional doc (with uri sdp/xref.xml) from the content database where $docurl resides. <xsl:variable name="xref-uri" select="doc('sdp/xref.xml')"/> I'm sure by looking at query console that doc('sdp/xref.xml') exists using XQuery context pointed to the content database. In XSLT I'm a bit

How to get number of secondes between two dates with XPath [duplicate]

倾然丶 夕夏残阳落幕 提交于 2020-07-22 21:41:59
问题 This question already has answers here : Finding the difference between two dateTimes in XSLT (4 answers) Closed last year . I am working with WSO2 ESB and i would like to know how can i get secondes betwenn date A and B. Basically, i would like to calcul time between system time and 12.00pm. Do you have any idea ? I found how to do get number of days but nothing for secondes with Xpath only. I am restricted with Xpath because i can't use a Java script. Thank you. 回答1: The basic is to turn

How to get number of secondes between two dates with XPath [duplicate]

╄→尐↘猪︶ㄣ 提交于 2020-07-22 21:38:12
问题 This question already has answers here : Finding the difference between two dateTimes in XSLT (4 answers) Closed last year . I am working with WSO2 ESB and i would like to know how can i get secondes betwenn date A and B. Basically, i would like to calcul time between system time and 12.00pm. Do you have any idea ? I found how to do get number of days but nothing for secondes with Xpath only. I am restricted with Xpath because i can't use a Java script. Thank you. 回答1: The basic is to turn

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

Using fn:random-number-generator to produce random numbers more than once

霸气de小男生 提交于 2020-07-09 05:58:30
问题 I try to write a simple function to provide me with a random letter each time i call it but I have difficulties combining my idea with the concept of a functional programing approach. Some help along the way would be appreciated! The code I have looks like: <xd:doc> <xd:desc>Provides one random letter, if the type is provided it returns a letter of thet type</xd:desc> <xd:param name="type">The type of letter to return, one of (A,a,B,b)</xd:param> </xd:doc> <xsl:function name="gdpr

XSLT lookup from external xml file

倖福魔咒の 提交于 2020-07-08 02:47:49
问题 I am aware that there are plenty of questions (and answers) here on the lookup from external xml files via xslt. However, I still haven't got my head around the logic of the key function so I'm having a hard time applying other solutions to my use case. I have two xml files: versA.xml <TEI> <div> <l id="A001" corresp="B001">First line of VersA</l> <l id="A002" corresp="B002">Second line of VersA</l> <l id="A003" corresp="B003">Third line of VersA</l> </div> </TEI> and versB.xml <TEI> <div> <l