diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-02-17 04:46:34 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-02-17 04:46:34 +0300 |
commit | 613e9f23435ec3408a219b8d9b95c21362563983 (patch) | |
tree | 5669163dd713af7c96a0cfa8856b148b4cbd0c58 /mcs/class/System.XML/Mono.Xml.Xsl.Operations | |
parent | 88f9fd10fe9c99d37057d75c2b724d8b110d9f23 (diff) |
2005-02-17 Atsushi Enomoto <atsushi@ximian.com>
* Compiler.cs : reverted previous fix, since it should be done
in XslTransformProcessor with root stylesheet.
* XslTransformProcessor.cs : In TryElementNamespacesOutput(),
don't output alias namespaces. And now consider null exclusions.
* XslLiteralElement.cs,
XslCopy.cs : Now that exclude-element-prefixes and extension-
element-prefixes are handled in GetNamespacesToCopy(), we could
just remove those collector routine. Also, literal elements were
still trying to output namespaces outside TryElementNamespacesOutput.
svn path=/trunk/mcs/; revision=40782
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.Xsl.Operations')
3 files changed, 12 insertions, 25 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog index 8af0ed50ca0..304b67dd644 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog +++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog @@ -1,3 +1,11 @@ +2005-02-17 Atsushi Enomoto <atsushi@ximian.com> + + * XslLiteralElement.cs, + XslCopy.cs : Now that exclude-element-prefixes and extension- + element-prefixes are handled in GetNamespacesToCopy(), we could + just remove those collector routine. Also, literal elements were + still trying to output namespaces outside TryElementNamespacesOutput. + 2005-02-16 Atsushi Enomoto <atsushi@ximian.com> * XslCopy.cs : According to the spec 7.5, namespace nodes should be diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopy.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopy.cs index 849f913b5bf..84632d71a80 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopy.cs +++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopy.cs @@ -41,20 +41,14 @@ namespace Mono.Xml.Xsl.Operations { XslOperation children; XmlQualifiedName [] useAttributeSets; Hashtable nsDecls; - ArrayList excludedPrefixes; public XslCopy (Compiler c) : base (c) {} protected override void Compile (Compiler c) { this.nsDecls = c.GetNamespacesToCopy (); - if (nsDecls.Count == 0) nsDecls = null; - string excludeResultPrefixes; - string extensionElementPrefixes; - excludeResultPrefixes = c.Input.GetAttribute ("exclude-result-prefixes", XsltNamespace); - extensionElementPrefixes = c.Input.GetAttribute ("extension-element-prefixes", XsltNamespace); - excludedPrefixes = new ArrayList (excludeResultPrefixes.Split (XmlChar.WhitespaceChars)); - excludedPrefixes.AddRange (extensionElementPrefixes.Split (XmlChar.WhitespaceChars)); + if (nsDecls.Count == 0) + nsDecls = null; if (c.Input.MoveToFirstAttribute ()) { @@ -92,7 +86,7 @@ namespace Mono.Xml.Xsl.Operations { p.PushElementState (p.CurrentNode.LocalName, p.CurrentNode.NamespaceURI, true); p.Out.WriteStartElement (p.CurrentNode.Prefix, p.CurrentNode.LocalName, p.CurrentNode.NamespaceURI); - p.TryElementNamespacesOutput (nsDecls, excludedPrefixes); + p.TryElementNamespacesOutput (nsDecls, null); if (useAttributeSets != null) foreach (XmlQualifiedName s in useAttributeSets) p.ResolveAttributeSet (s).Evaluate (p); diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs index 9c67afa2672..0d9952b16fc 100644 --- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs +++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs @@ -44,9 +44,6 @@ namespace Mono.Xml.Xsl.Operations { ArrayList attrs; XmlQualifiedName [] useAttributeSets; Hashtable nsDecls; - string excludeResultPrefixes; - string extensionElementPrefixes; - ArrayList excludedPrefixes; bool requireNameFix; XPathNavigator stylesheetNode; XslStylesheet stylesheet; @@ -83,10 +80,6 @@ namespace Mono.Xml.Xsl.Operations { this.nsDecls = c.GetNamespacesToCopy (); if (nsDecls.Count == 0) nsDecls = null; this.isEmptyElement = c.Input.IsEmptyElement; - this.excludeResultPrefixes = c.Input.GetAttribute ("exclude-result-prefixes", XsltNamespace); - this.extensionElementPrefixes = c.Input.GetAttribute ("extension-element-prefixes", XsltNamespace); - excludedPrefixes = new ArrayList (excludeResultPrefixes.Split (XmlChar.WhitespaceChars)); - excludedPrefixes.AddRange (extensionElementPrefixes.Split (XmlChar.WhitespaceChars)); if (c.Input.MoveToFirstAttribute ()) { @@ -140,16 +133,8 @@ namespace Mono.Xml.Xsl.Operations { ((XslLiteralAttribute)attrs [i]).Evaluate (p); } - p.TryElementNamespacesOutput (nsDecls, excludedPrefixes); + p.TryElementNamespacesOutput (nsDecls, null); - if (nsDecls != null) { - foreach (DictionaryEntry de in nsDecls) { - string actualPrefix = p.CompiledStyle.Style.PrefixInEffect (de.Key as String, excludedPrefixes); - if (actualPrefix != null) - p.Out.WriteNamespaceDecl (actualPrefix, (string)de.Value); - } - } - if (children != null) children.Evaluate (p); if (isEmptyElement) |