5 // Ben Maurer (bmaurer@users.sourceforge.net)
6 // Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
9 // (C) 2003 Atsushi Enomoto
13 using System.Collections;
15 using System.Xml.XPath;
18 namespace Mono.Xml.Xsl.Operations {
19 public class XslText : XslCompiledElement {
20 bool disableOutputEscaping = false;
24 public XslText (Compiler c, bool isWhitespace) : base (c)
26 this.isWhitespace = isWhitespace;
29 protected override void Compile (Compiler c)
31 this.text = c.Input.Value;
33 if (c.Input.NodeType == XPathNodeType.Element)
34 this.disableOutputEscaping = c.ParseYesNoAttribute ("disable-output-escaping", false);
38 public override void Evaluate (XslTransformProcessor p)
40 if (isWhitespace && !p.PreserveWhitespace ())
41 return; // write nothing
42 if (!disableOutputEscaping) {
44 p.Out.WriteWhitespace (text);
46 p.Out.WriteString (text);
49 p.Out.WriteRaw (text);