ShaileshShinde
asked on
XPTY0004: A sequence of more than one item is not allowed as the first argument of string-length()
Hello Expert,
I am getting an error for the xsl code..
<xsl:if test="string-length($desti nation) > 0"> where destination contains like...("mx.events.AIREven t.APPLICAT ION...", "mx.events.AIREvent.APPLIC ATION...", ...)
While processing it gives an error...
XPTY0004: A sequence of more than one item is not allowed as the first argument of string-length().
can you pls suggest the alternative for the line of code?
Thanks,
Shailesh
I am getting an error for the xsl code..
<xsl:if test="string-length($desti
While processing it gives an error...
XPTY0004: A sequence of more than one item is not allowed as the first argument of string-length().
can you pls suggest the alternative for the line of code?
Thanks,
Shailesh
always the same problem,
If you have a selection of nodes, there is no automatic concatenation,
and a string-length requires one single string-type (XPath2 is very tricky about types)
If you want a concatenation, you should use string-join
<xsl:variable name="product" select="string-join((./@pr oduct|./@c lass | ./@outputclass), '')"/>
I don't like the disable-output-encoding here
<xsl:value-of disable-output-escaping="y es" select="'<b>'"/>
<xsl:call-template name="processTags"/>
<xsl:value-of disable-output-escaping="y es" select="'</b>'"/>
why don't you do this?
<b>
<xsl:call-template name="processTags"/>
</b>
your first example could be done the same way,
cheers
Geert
If you have a selection of nodes, there is no automatic concatenation,
and a string-length requires one single string-type (XPath2 is very tricky about types)
If you want a concatenation, you should use string-join
<xsl:variable name="product" select="string-join((./@pr
I don't like the disable-output-encoding here
<xsl:value-of disable-output-escaping="y
<xsl:call-template name="processTags"/>
<xsl:value-of disable-output-escaping="y
why don't you do this?
<b>
<xsl:call-template name="processTags"/>
</b>
your first example could be done the same way,
cheers
Geert
ASKER
Hello expert,
Is this applicable for ...<xsl:variable name="firstPassToken" select="substring-before($ dest,conca t('.',$las tToken))"/ >
Thanks,
Shailesh
Is this applicable for ...<xsl:variable name="firstPassToken" select="substring-before($
Thanks,
Shailesh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello expert,
<xsl:variable name="firstPassToken" select="substring-before(s tring-join ($dest ,concat('.',$lastToken), ''))"/> gives an error saying string-join() must have two arguments.
Thanks,
Shailesh
<xsl:variable name="firstPassToken" select="substring-before(s
Thanks,
Shailesh
this seems more like it
<xsl:variable name="firstPassToken" select="substring-before(s tring-join ($dest , ''),concat('.',$lastToken) )"/>
<xsl:variable name="firstPassToken" select="substring-before(s
ASKER
There is one more query with the same xslt...
the code is like...
<xsl:variable name="product" select="./@product|./@clas
<xsl:if test="string-length($produ
<xsl:value-of disable-output-escaping="y
<xsl:call-template name="processTags"/>
<xsl:value-of disable-output-escaping="y
</xsl:if>
The error is appearing for <xsl:variable name="product" select="./@product|./@clas
as it contains more than one sequence...
Can you pls suggest the what change will required for the same?
Thanks,
Shailesh