我的xsl文件中有以下行:Xsl轉換在兩個<xsl:value-of select之間切換空間
network <xsl:value-of select="/config/areas/inside/network"/> <xsl:value-of select="/config/areas/inside/subnetmask"/>
我在C#中的轉換代碼:
XPathDocument xPathDoc = new XPathDocument(xmlPath);
//XslTransform xslTrans = new XslTransform(); -> Deprecated!
XslCompiledTransform xslTrans = new XslCompiledTransform();
XmlTextWriter writer = new XmlTextWriter("config.cfg", Encoding.UTF8);
xslTrans.Load(xslPath);
xslTrans.Transform(xPathDoc, null, writer);
writer.Close();
對於不推薦使用的版本,一切正常(在我爲空間放置ASCII代碼之後)在兩個元素之間),但XslCompiledTransform類中有一些其他的規範化算法,我不知道如何避免這種行爲。
有什麼建議嗎?
什麼是「一切正常」,什麼是「這種行爲」?請提供XSLT轉換的輸出並說明問題所在......以可理解的方式定義您的問題是第一個,也是非常明顯的建議。 –