Author: jackson
Date: 2008-01-30 15:01:57 -0500 (Wed, 30 Jan 2008)
New Revision: 94412
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/xaml.cpp
Log:
* xaml.cpp: Handle more names for the default namespace.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2008-01-30 19:43:45 UTC (rev 94411)
+++ trunk/moon/src/ChangeLog 2008-01-30 20:01:57 UTC (rev 94412)
@@ -1,5 +1,9 @@
2008-01-30 Jackson Harper <[EMAIL PROTECTED]>
+ * xaml.cpp: Handle more names for the default namespace.
+
+2008-01-30 Jackson Harper <[EMAIL PROTECTED]>
+
* xaml.cpp: Add support for ucs4.
2008-01-29 Jackson Harper <[EMAIL PROTECTED]>
Modified: trunk/moon/src/xaml.cpp
===================================================================
--- trunk/moon/src/xaml.cpp 2008-01-30 19:43:45 UTC (rev 94411)
+++ trunk/moon/src/xaml.cpp 2008-01-30 20:01:57 UTC (rev 94412)
@@ -57,6 +57,14 @@
static DefaultNamespace *default_namespace = NULL;
static XNamespace *x_namespace = NULL;
+
+const char* default_namespace_names [] = {
+ "http://schemas.microsoft.com/winfx/2006/xaml/presentation",
+ "http://schemas.microsoft.com/client/2007",
+ "http://schemas.microsoft.com/xps/2005/06",
+};
+
+
typedef DependencyObject *(*create_item_func) (void);
typedef XamlElementInstance *(*create_element_instance_func) (XamlParserInfo
*p, XamlElementInfo *i);
typedef void (*add_child_func) (XamlParserInfo *p, XamlElementInstance
*parent, XamlElementInstance *child);
@@ -1078,15 +1086,19 @@
if (p->error_args)
return;
- if (!strcmp
("http://schemas.microsoft.com/winfx/2006/xaml/presentation", uri) ||
- !strcmp ("http://schemas.microsoft.com/client/2007",
uri)) {
+ for (int i = 0; default_namespace_names [i]; i++) {
- if (prefix)
- return parser_error (p, (p->current_element ?
p->current_element->element_name : NULL), prefix, -1,
- g_strdup_printf ("It is illegal to add
a prefix (xmlns:%s) to the default namespace.\n", prefix));
+ if (!strcmp (default_namespace_names [i], uri)) {
+ if (prefix)
+ return parser_error (p, (p->current_element ?
p->current_element->element_name : NULL), prefix, -1,
+ g_strdup_printf ("It is
illegal to add a prefix (xmlns:%s) to the default namespace.\n", prefix));
- g_hash_table_insert (p->namespace_map, g_strdup (uri),
default_namespace);
- } else if (!strcmp ("http://schemas.microsoft.com/winfx/2006/xaml",
uri)) {
+ g_hash_table_insert (p->namespace_map, g_strdup (uri),
default_namespace);
+ return;
+ }
+ }
+
+ if (!strcmp ("http://schemas.microsoft.com/winfx/2006/xaml", uri)) {
g_hash_table_insert (p->namespace_map, g_strdup (uri),
x_namespace);
} else {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches