Author: atsushi
Date: 2005-03-04 11:00:33 -0500 (Fri, 04 Mar 2005)
New Revision: 41445
Modified:
trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNotSupportedOperation.cs
Log:
2005-03-04 Atsushi Enomoto <[EMAIL PROTECTED]>
* XslNotSupportedOperation.cs : Added xsl:fallback support.
Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
2005-03-04 15:29:21 UTC (rev 41444)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
2005-03-04 16:00:33 UTC (rev 41445)
@@ -1,5 +1,9 @@
2005-03-04 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * XslNotSupportedOperation.cs : Added xsl:fallback support.
+
+2005-03-04 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* XslNotSupportedOperation.cs : added not-supported template content
type. Such elements should be rejected only run-time (since there
could be future-version-only template content).
Modified:
trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNotSupportedOperation.cs
===================================================================
---
trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNotSupportedOperation.cs
2005-03-04 15:29:21 UTC (rev 41444)
+++
trunk/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNotSupportedOperation.cs
2005-03-04 16:00:33 UTC (rev 41445)
@@ -42,6 +42,7 @@
internal class XslNotSupportedOperation : XslCompiledElement
{
string name;
+ ArrayList fallbacks;
public XslNotSupportedOperation (Compiler c)
: base (c)
@@ -51,11 +52,28 @@
protected override void Compile (Compiler c)
{
name = c.Input.LocalName;
+ if (c.Input.MoveToFirstChild ()) {
+ do {
+ if (c.Input.NodeType !=
XPathNodeType.Element ||
+ c.Input.LocalName != "fallback"
||
+ c.Input.NamespaceURI !=
XslStylesheet.XsltNamespace)
+ continue;
+ if (fallbacks == null)
+ fallbacks = new ArrayList ();
+ fallbacks.Add (new XslFallback (c));
+ } while (c.Input.MoveToNext ());
+ c.Input.MoveToParent ();
+ }
}
public override void Evaluate (XslTransformProcessor p)
{
- throw new XsltException (String.Format ("'{0}' element
is not supported as a template content in XSLT 1.0.", name), null);
+ if (fallbacks != null) {
+ foreach (XslFallback f in fallbacks)
+ f.Evaluate (p);
+ }
+ else
+ throw new XsltException (String.Format ("'{0}'
element is not supported as a template content in XSLT 1.0.", name), null);
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches