Author: atsushi
Date: 2005-03-08 01:11:19 -0500 (Tue, 08 Mar 2005)
New Revision: 41548
Modified:
trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs
Log:
2005-03-08 Atsushi Enomoto <[EMAIL PROTECTED]>
* GenericOutputter.cs : Prefix "xml" is only allowed to the fixed XML
namespace. Rewrite prefix only when there is non-empty namespace.
Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog 2005-03-08 06:08:59 UTC
(rev 41547)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog 2005-03-08 06:11:19 UTC
(rev 41548)
@@ -1,3 +1,8 @@
+2005-03-08 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * GenericOutputter.cs : Prefix "xml" is only allowed to the fixed XML
+ namespace. Rewrite prefix only when there is non-empty namespace.
+
2005-03-07 Atsushi Enomoto <[EMAIL PROTECTED]>
* XslStylesheet.cs : Now namespace aliases are collected in prior to
Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs 2005-03-08
06:08:59 UTC (rev 41547)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs 2005-03-08
06:11:19 UTC (rev 41548)
@@ -189,18 +189,24 @@
{
Attribute attr = pendingAttributes [i];
string prefix = attr.Prefix;
+ if (prefix ==
XmlNamespaceManager.PrefixXml &&
+ attr.Namespace !=
XmlNamespaceManager.XmlnsXml)
+ // don't allow mapping from
"xml" to other namespaces.
+ prefix = String.Empty;
string existing =
_nsManager.LookupPrefix (attr.Namespace, false);
if (prefix.Length == 0 &&
attr.Namespace.Length > 0)
prefix = existing;
- if (prefix == null) {
- prefix = "xp_" + _xpCount++;
+ if (attr.Namespace.Length > 0) {
+ if (prefix == null || prefix ==
String.Empty)
+ // empty prefix is not
allowed
+ // for non-local
attributes.
+ prefix = "xp_" +
_xpCount++;
+ if (existing != prefix) {
+ newNamespaces.Add
(prefix);
+ _currentNamespaceDecls
[prefix] = attr.Namespace;
+ _nsManager.AddNamespace
(prefix, attr.Namespace);
+ }
}
- if (existing != prefix &&
attr.Namespace.Length > 0) {
- newNamespaces.Add (prefix);
- _currentNamespaceDecls [prefix]
= attr.Namespace;
- _nsManager.AddNamespace
(prefix, attr.Namespace);
- }
-
Emitter.WriteAttributeString (prefix,
attr.LocalName, attr.Namespace, attr.Value);
}
for (int i = 0; i < newNamespaces.Count; i++)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches