0

I have tried to look at previous answers, but it is not clear to me. I would like to use the replace function to replace various characters that are causing me issues during saxon tranformation. My code fragment is:

rdfs:comment "<xsl:value-of select="replace(DDTEXT, '[&quot;]|[&apos;]|[\\]|[\/]|[&lt;]|[&gt;]', '')"/>" ;

Saxon gives me the error: XPST0003: XPath syntax error at char 23 on line 66 in {replace(DDTEXT, '["]|[']|}:expected ")", found "]"

I have spent several hours on this already... Any help appreciated. I am using xslt2, and have tried my regex using rubular, but I guess that did not help.

4

1 回答 1

0

试试这个:

<xsl:value-of select="replace(., '[&amp;quot;]|[&amp;apos;]|[\\]|[/]|[&amp;lt;]|[&amp;gt;]', '')"/>
于 2013-04-25T04:36:44.293 回答