Stripping null characters from XML elements
-
I'm transforming xml and want to strip out null characters in the elements. The elements look like this: ��� My XSL rules look like this: 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 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 with nulls embedded in it. The output xml is otherwise well-formed. Anyone know what I'm doing wrong?
-
I'm transforming xml and want to strip out null characters in the elements. The elements look like this: ��� My XSL rules look like this: 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 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 with nulls embedded in it. The output xml is otherwise well-formed. Anyone know what I'm doing wrong?
I solved the problem, which had nothing to do with the XPath queries. My XSL stylesheet is a Content file in a VS.NET project. I forgot that VS DOESN'T copy content files to the output folder. Thus, all of my stylesheet edits were never used! This is what I ultimately used to remove the nulls: translate(/myEl, '�', '') Does anyone know why VS doesn't copy content files to output folder?