diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-02-08 00:50:29 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-02-08 00:50:29 +0300 |
commit | 42c307da9fe9ed083dca163877968a6f39f6102d (patch) | |
tree | 9594cfcd1e036cd3a2013e0fc5f397f827ebf4e5 /mcs/class/System.XML/Mono.Xml.Xsl.Operations | |
parent | 14ceb8b400a2c80b249a6490b5fafc1e89e18abd (diff) |
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.
svn path=/trunk/mcs/; revision=40271
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.Xsl.Operations')
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs | 29 |
2 files changed, 16 insertions, 18 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog index c377c4bae47..8dce886f279 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog +++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog @@ -1,3 +1,8 @@ +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. + 2004-01-17 Atsushi Enomoto <atsushi@ximian.com> * XslVariable.cs : use DTMXPathDocumentWriter2. diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs index 6adfd14d11d..0a98c63674f 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs +++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs @@ -48,17 +48,6 @@ namespace Mono.Xml.Xsl.Operations { { } - private void ThrowIfNotElement (Compiler c) - { - switch (ParentType) { - case XPathNodeType.All: - case XPathNodeType.Element: - break; - default: - throw new XsltCompileException ("Cannot contain attribute from this parent node " + ParentType, null, c.Input); - } - } - protected override void Compile (Compiler c) { hasStack = (c.CurrentVariableScope == null); @@ -79,8 +68,9 @@ namespace Mono.Xml.Xsl.Operations { content.Add (new XslApplyTemplates (c)); break; case "attribute": - ThrowIfNotElement (c); - content.Add (new XslAttribute (c)); + if (ParentType == XPathNodeType.All + || ParentType == XPathNodeType.Element) + content.Add (new XslAttribute (c)); break; case "call-template": content.Add (new XslCallTemplate (c)); @@ -89,7 +79,8 @@ namespace Mono.Xml.Xsl.Operations { content.Add (new XslChoose (c)); break; case "comment": - ThrowIfNotElement (c); + if (ParentType == XPathNodeType.All + || ParentType == XPathNodeType.Element) content.Add (new XslComment (c)); break; case "copy": @@ -99,8 +90,9 @@ namespace Mono.Xml.Xsl.Operations { content.Add (new XslCopyOf (c)); break; case "element": - ThrowIfNotElement (c); - content.Add (new XslElement (c)); + if (ParentType == XPathNodeType.All + || ParentType == XPathNodeType.Element) + content.Add (new XslElement (c)); break; case "fallback": content.Add (new XslFallback (c)); @@ -118,8 +110,9 @@ namespace Mono.Xml.Xsl.Operations { content.Add (new XslNumber(c)); break; case "processing-instruction": - ThrowIfNotElement (c); - content.Add (new XslProcessingInstruction(c)); + if (ParentType == XPathNodeType.All + || ParentType == XPathNodeType.Element) + content.Add (new XslProcessingInstruction(c)); break; case "text": content.Add (new XslText(c, false)); |