whitespace - XSLT transformation adding unwanted Linefeed -


Using VS 2010, I am editing an XML file that will be used to replace an XML file . I'm trying to output a carat return () and only this one. I do not want to show the linefeed character (x0A).

No matter what type of stunt I am in XSL, the output file always adds an LF to my CR (CRF) and I do not want that the reason is that only CR I want it to be parsed by a secondary system which sends an SMS message, for which only LF is required.

I'm thinking that the problem is XSL or the conversion process.

Style sheet:

  & lt; Xsl: stylesheet xmlns: l = "http://schemas.something.no/2008/" version = '1.0' & gt; & Lt; Xsl: import href = 'LidAditFanks.XSL' / & gt; & Lt; Xsl: template match = '/' & gt; & Lt; XSL: implemented-import / & gt; & Lt; / XSL: Templates & gt; & Lt; Xsl: output method = "xml" encoding = "UTF-8" indent = "no" /> & Lt; Xsl: Template Match = "l: Work Order Occurrence Bee" & gt; & Lt; Message & gt; & Lt; Body & gt; Adding Crack & lt; Xsl: text & gt; & Amp; #xD; & Lt; / Xsl: text & gt; & Lt; Xsl: text & gt; & Amp; #xD; & Lt; / Xsl: text & gt; No dice & lt; / Body & gt; & Lt; / Messages & gt; & Lt; / XSL: Templates & gt;   

Code for change:

  public static XmlDocument TransformObject (string xslFilepath, object serob) {XmlDocument result = zero; Xlstransf.load (xsl file peth, new xslt settings {enabled script = true}, newxUL urresource ()); Results = TransformAbject (xsltransf, serob); } Public Stable XmlDocument TransformObject (XslCompiledTransform xslTransform, object change object) {XmlDocument result = Zero; If (xsl transform! = Null) {Data Contrast Serializer Serializer = New Data Contrast Serializer (Transform Object. GateType ()); String serializedObjValue = null; (Using memorystream stream = new memorystream ()) {serializer.WriteObject (stream, transform object); SerializedObjValue = (New UTF 8 Encoding) GetString (stream.Tuare ()); } If (serializedObjValue! = Null) {XmlDocument xmldoc = New XmlDocument (); Xmldoc.LoadXml (serializedObjValue); XmlDeclaration xmldec = xmldoc.CreateXmlDeclaration ("1.0", "UTF-8", blank); Xmldoc.InsertBefore (xmldec, xmldoc.DocumentElement); (Stream stream = new memorystream ()) using {xslTransform.Transform (xmldoc, null, stream); section. Composition = 0; (StreamReader sr = new streamrider (stream, encoding.unocode)) using {string xmlRes = sr.ReadToEnd (); Results = New XmlDocument (); Result.LoadXml (xmlRes); }}}} Return result; }   

Is anyone experiencing such a problem?

The only way to resolve this problem is by a surcharge of XmlTextWriter In the XslCompiledTransform.Transform ()

is the instnce of XmlTextWriter its settings property set to XmlWriterSettings should be with the example for which you XmlWriterSettings.NewLineChars property.

See:

and



Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

memcached - Django cache performance -