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-03-02 20:13:55 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-03-02 20:13:55 +0300
commit3f8d9ff64d7f601d7b9875d58124be74cbc1b3a4 (patch)
treed041f3429e3984f587274ff0254dc6a8ca37eaee /mcs/class/System.XML/Mono.Xml.Xsl
parentd2c59f0cacf5b4fc920265b9fa2562e2655b9cd9 (diff)
2005-03-02 Atsushi Enomoto <atsushi@ximian.com>
* XslStylesheet.cs : included stylesheet could be literal result element as stylesheet (see the spec 2.6.1). svn path=/trunk/mcs/; revision=41369
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.Xsl')
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog5
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs16
2 files changed, 20 insertions, 1 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
index 65616a5f700..8eeceeaaacb 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
@@ -1,5 +1,10 @@
2005-03-02 Atsushi Enomoto <atsushi@ximian.com>
+ * XslStylesheet.cs : included stylesheet could be literal result
+ element as stylesheet (see the spec 2.6.1).
+
+2005-03-02 Atsushi Enomoto <atsushi@ximian.com>
+
* GenericOutputter.cs : On WriteStartElement(), prefix should be an
empty string when nsURI is empty.
* HtmlEmitter.cs : non-HTML elements in default namespace are treated
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs
index 73328ff57fb..468a6eaf008 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs
@@ -292,7 +292,21 @@ namespace Mono.Xml.Xsl {
private void HandleInclude (string href)
{
c.PushInputDocument (href);
- ProcessTopLevelElements ();
+
+ // move to root element
+ while (c.Input.NodeType != XPathNodeType.Element)
+ if (!c.Input.MoveToNext ())
+ throw new XsltCompileException ("Stylesheet root element must be either \"stylesheet\" or \"transform\" or any literal element.", null, c.Input);
+
+ if (c.Input.NamespaceURI != XsltNamespace) {
+ if (c.Input.GetAttribute ("version", XsltNamespace) == String.Empty)
+ throw new XsltCompileException ("Mandatory global attribute version is missing.", null, c.Input);
+ // then it is simplified stylesheet.
+ Templates.Add (new XslTemplate (c));
+ }
+ else
+ ProcessTopLevelElements ();
+
c.PopInputDocument ();
}