I'm transforming xml and want to strip out null characters in the elements.
The elements look like this:
<myEl>���</myEl>
My XSL rules look like this:
<xsl:if test="string-length(/myEl) > 0">
<outEl><xsl:value-of select="/myEl"/></outEl>
</xsl:if>
For the 'select=' attribute, I've tried:
- translate(/myEl, �, 'x')
- translate(/myEl, '�', 'x')
- translate(/myEl, '�', 'x')
- translate(/myEl, '�', 'x')
- translate(/myEl, '�', 'x')
- translate(string(/myEl), '�', 'x')
- translate(string(/myEl), '�', 'x')
I've also tried <xsl:strip-space> at the root, but no effect.
I'm translating null to 'x' for now so I know that I'm capturing the nulls correctly, but never get a match; my output always has <myEl> with nulls embedded in it. The output xml is otherwise well-formed. Anyone know what I'm doing wrong?
The elements look like this:
<myEl>���</myEl>
My XSL rules look like this:
<xsl:if test="string-length(/myEl) > 0">
<outEl><xsl:value-of select="/myEl"/></outEl>
</xsl:if>
For the 'select=' attribute, I've tried:
- translate(/myEl, �, 'x')
- translate(/myEl, '�', 'x')
- translate(/myEl, '�', 'x')
- translate(/myEl, '�', 'x')
- translate(/myEl, '�', 'x')
- translate(string(/myEl), '�', 'x')
- translate(string(/myEl), '�', 'x')
I've also tried <xsl:strip-space> at the root, but no effect.
I'm translating null to 'x' for now so I know that I'm capturing the nulls correctly, but never get a match; my output always has <myEl> with nulls embedded in it. The output xml is otherwise well-formed. Anyone know what I'm doing wrong?