I have following code:
XslCompiledTransform transform = new XslCompiledTransform();
XsltArgumentList arguments = new XsltArgumentList();
string txId = SPOZUS_T2S_COMMON.Spozus.GetUniqueInputId;
arguments.AddParam("Id", string.Empty, txId);
foreach (KeyValuePair<string, string> kvp in args)
{
arguments.AddParam(kvp.Key, string.Empty, kvp.Value);
}
using (StringReader sr = new StringReader(xslt))
{
using (XmlReader reader = XmlReader.Create(sr))
{
transform.Load(reader); // load transformation
}
}
XDocument inDoc = new XDocument(_ecpIn.Message); // input document
XDocument outDoc = new XDocument(); // output document
using (XmlReader reader = inDoc.CreateReader())
{
XmlWriter XWriter = outDoc.CreateWriter();
using (XmlWriter writer = XmlWriter.Create(XWriter, transform.OutputSettings))
{
transform.Transform(reader, arguments, writer); // do the transformation
}
}
I have the source document inDoc in utf-8 and I need to replace accentuated chars in the values of text value elements and get rid of those that does not match this pattern ([0-9a-zA-Z-\?:().,'+ ]([0-9a-zA-Z-\?:().,'+ ](/[0-9a-zA-Z-\?:().,'+ ])?)). Any idea?