Project

Profile

Help

Bug #4532 » array.xsl

Dependency of al3-dictionary - Jeremy Cronk, 2020-05-08 18:47

 
<?xml version="1.0"?>
<xsl:package name="com.ivans.connect.utils.array" package-version="0.1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:nx="http://www.ivansinsurance.com/connect" xmlns:array-ext="http://www.ivansinsurance.com/connect/array"
xmlns:map-ext="http://www.ivansinsurance.com/connect/map" xmlns:array="http://www.w3.org/2005/xpath-functions/array"
xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:map="http://www.w3.org/2005/xpath-functions/map"
exclude-result-prefixes="#all" expand-text="true" version="3.0">
<xsl:expose component="function" names="array-ext:*" visibility="public"/>
<xsl:function name="array-ext:interlace" as="array(*)*">
<xsl:param name="first-item" as="item()*"/>
<xsl:param name="second-item" as="item()*"/>
<xsl:sequence
select="
for-each-pair($first-item, $second-item, function ($x, $y) {
[$x, $y]
})"
/>
</xsl:function>
<xsl:function name="array-ext:shallow-flatten">
<xsl:param name="ary" as="array(*)"/>
<xsl:sequence select="(1 to array:size($ary)) ! $ary(.)"/>
</xsl:function>
</xsl:package>
(6-6/6)