xpath-3.0

XPath 3.1 in XSL-T 3.0 How to parse free format String to DateTime as in java.text.SimpleDateFormat?

早过忘川 提交于 2021-01-06 06:04:06
问题 I would like to parse almost free format String to DateTime in XSL-T 3.0 as one can do it in Java using java.text.SimpleDateFormat. Is it possible? I am using the latest Saxon HE 9.7.0.1 for Java and consulting it with the W3C CR 3.1 "XPath and XQuery Functions and Operators 3.1". There is the function "fn:parse-ietf-date" in W3C CR 3.1, but it does not look like it can parse String like "6.1.94 7:29" - the Exception: Error at char 17 in xsl:value-of/@select on line 20 column 47 of tr.xsl:

XPath recursive “parent”-selection in a flat structure

孤街醉人 提交于 2020-01-22 00:25:32
问题 The following XML is given: <root> <element> <id>1</id> </element> <element> <id>2</id> <parentId>1</parentId> </element> <element> <id>3</id> <parentId>2</parentId> </element> <element> <id>4</id> <parentId>3</parentId> </element> <element> <id>5</id> <parentId>2</parentId> </element> <element> <id>6</id> <parentId>5</parentId> </element> </root> Now, I want to select all "parent"-nodes for e.g. element 3. Let's say, the desired output for element 3 should be: element 1 element 2 The desired

XPath recursive “parent”-selection in a flat structure

六月ゝ 毕业季﹏ 提交于 2020-01-22 00:24:10
问题 The following XML is given: <root> <element> <id>1</id> </element> <element> <id>2</id> <parentId>1</parentId> </element> <element> <id>3</id> <parentId>2</parentId> </element> <element> <id>4</id> <parentId>3</parentId> </element> <element> <id>5</id> <parentId>2</parentId> </element> <element> <id>6</id> <parentId>5</parentId> </element> </root> Now, I want to select all "parent"-nodes for e.g. element 3. Let's say, the desired output for element 3 should be: element 1 element 2 The desired

How to find all numbers in a string

半城伤御伤魂 提交于 2019-12-08 04:16:27
问题 Ich versuche mit einer Funktion sämtliche Zahlen aus einem Element oder String zu ermitteln. Dabei soll die Anzahl der Zahlen und ihre Stelligkeit egal sein. Folgende Funktion habe ich bislang geschrieben: <xsl:function name="itp:find_num"> <xsl:param name="tmp"/> <xsl:if test="matches($tmp,'\d+')"> <xsl:analyze-string select="$tmp" regex="{'\d+'}"> <xsl:matching-substring> <xsl:sequence select="."/> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="''"/> </xsl:non