Limit XSLT/XPATH Processor
Posted: Wed Jul 13, 2022 4:59 pm
Hi,
I am making a data feed for a vendor. I am transforming the data to meet their format using XSLT. I developed a transformation, and within it it had
This works ok in the oxygen xml debug, but when i attempted to do the transformation with vendor it broke. They explained to me that this function uses xpath 3.0, and that they process their xpath on 2.0 which causes it to fail.
My question is, how can i limit the version of xpath that oxygen uses for its intelli-sense and execution? I found a thread that said to go to
Options -> Preferences -> XML -> XSLT-XQuery -> XSLT and then change the validation engine, but I dont understand what all this means. I'm super new to XSLT stuff; I normally live in C# land x_x
My full function
I am making a data feed for a vendor. I am transforming the data to meet their format using XSLT. I developed a transformation, and within it it had
Code: Select all
select="string-join((for $i in (l to $length) return '0'))"
My question is, how can i limit the version of xpath that oxygen uses for its intelli-sense and execution? I found a thread that said to go to
Options -> Preferences -> XML -> XSLT-XQuery -> XSLT and then change the validation engine, but I dont understand what all this means. I'm super new to XSLT stuff; I normally live in C# land x_x
My full function
Code: Select all
<xsl:function name="this:pad" as="xsd:string">
<xsl:param name="direction" as="xsd:string"/>
<xsl:param name="length" as="xsd:integer"/>
<xsl:param name="padChar" as="xsd:string"/>
<xsl:param name="value"/>
<xsl:variable name="padding" select="
string-join((for $i in (1 to $length)
return
$padChar))"/>
<xsl:choose>
<xsl:when test="string-length($value) = $length">
<xsl:sequence select="$value"/>
</xsl:when>
<xsl:when test="string-length($value) > $length">
<xsl:choose>
<xsl:when test="$direction = $Direction_Left">
<xsl:sequence select="substring($value, 1, $length)"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence
select="substring($value, string-length($value) - $length + 1, $length)"
/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$direction = $Direction_Left">
<xsl:sequence
select="concat(substring($padding, string-length($padding) - ($length - string-length($value)) + 1), $value)"
/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence
select="concat($value, substring($padding, string-length($padding) - ($length - string-length($value)) + 1))"
/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>