Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2005-02-08 01:29:20 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-02-08 01:29:20 +0300
commit0fea9dfa7c3fbc4207f9ea6c5e8fccd1d74f7952 (patch)
treedea37f4c5d4426ae49bbc9def056dc8aedaa8261 /mcs/class/System.XML/Mono.Xml.Xsl.Operations
parent4f2874912c211d3f8d49b2041f53b77df18bf7df (diff)
2005-02-08 Atsushi Enomoto <atsushi@ximian.com>
* XslProcessingInstruction.cs : MS.NET recovers from invalid PI name (it must be both NCName and PITarget, or must be ignored). Patch by Andrew Skiba. svn path=/trunk/mcs/; revision=40274
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.Xsl.Operations')
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog6
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs13
2 files changed, 15 insertions, 4 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
index 8dce886f279..61d30c63506 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
@@ -1,5 +1,11 @@
2005-02-08 Atsushi Enomoto <atsushi@ximian.com>
+ * XslProcessingInstruction.cs : MS.NET recovers from invalid PI name
+ (it must be both NCName and PITarget, or must be ignored). Patch by
+ Andrew Skiba.
+
+2005-02-08 Atsushi Enomoto <atsushi@ximian.com>
+
* XslTemplateContent.cs : MS.NET recovers from incorrect non-text
children in attribute, PI and comments. Patch by Andrew Skiba.
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs
index e2f5f12a787..adafcfd30ce 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs
@@ -66,14 +66,19 @@ namespace Mono.Xml.Xsl.Operations {
public override void Evaluate (XslTransformProcessor p)
{
StringWriter s = new StringWriter ();
- Outputter outputter = new TextOutputter(s, true);
- p.PushOutput (outputter);
- value.Evaluate (p);
- p.PopOutput ();
+ if (value != null) {
+ Outputter outputter = new TextOutputter(s, true);
+ p.PushOutput (outputter);
+ value.Evaluate (p);
+ p.PopOutput ();
+ }
string actualName = name.Evaluate (p);
if (String.Compare (actualName, "xml", true, CultureInfo.InvariantCulture) == 0)
throw new XsltException ("Processing instruction name was evaluated to \"xml\"", null, p.CurrentNode);
+ if (actualName.IndexOf (':') >= 0)
+ return; //MS.NET ignores such processing instructions
+
p.Out.WriteProcessingInstruction (actualName, s.ToString ());
}
}