Closed Bug 285207 Opened 20 years ago Closed 20 years ago

Need to handle inline schema

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: doronr)

Details

Attachments

(2 files, 1 obsolete file)

As noted in http://www.w3.org/TR/xforms/index-all.html#concepts-model, we need
to be able to handle inline schema.
Assignee: aaronr → doronr
Attached file testcase
this testcase shows the bug.  Works using Novell's plugin.
Attached patch le patch (obsolete) — Splinter Review
this patch fixes several issues:
  - mSchemas needs to be QI'ed to nsISchemaCollection, not nsISchema
  - handle schemas without a target namespace (affects schema-validation and
xforms)
  - load inline schemas
Attachment #177396 - Flags: review?(aaronr)
Comment on attachment 177396 [details] [diff] [review]
le patch

@@ -805,11 +808,13 @@
     aType.Assign(NS_LITERAL_STRING("string"));
     rv = NS_OK;
   } else {
-    // get the namespace url from the prefix
-    nsCOMPtr<nsIDOM3Node> domNode3 = do_QueryInterface(mElement, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-  
-    rv = domNode3->LookupNamespaceURI(schemaTypePrefix, aNSUri);
+    if (!schemaTypePrefix.IsEmpty()) {
+      // get the namespace url from the prefix
+      nsCOMPtr<nsIDOM3Node> domNode3 = do_QueryInterface(mElement, &rv);
+      NS_ENSURE_SUCCESS(rv, rv);
+
+      rv = domNode3->LookupNamespaceURI(schemaTypePrefix, aNSUri);
+    }
   }
   return rv;
 }

Only change that I'd make would be to make sure that aNSUri has a value (even
if it is empty) when nsXFormsModelElement::GetTypeAndNSFromNode returns.  Right
now if there is no prefix, then aNSUri won't get assigned a value.

Also, can't you move all of the schema processing from HandleEvent to
FinishConstruction(), too?  Might as well put it all in one place.
Attachment #177396 - Flags: review?(aaronr) → review-
Attached patch 2.0Splinter Review
Moving the code may break things and isn't in the scope of this bug :)
Attachment #177396 - Attachment is obsolete: true
Attachment #177526 - Flags: review?(aaronr)
Comment on attachment 177526 [details] [diff] [review]
2.0

I guess that we'll suffer with schema in two seperate places for now.  *sigh*.
Attachment #177526 - Flags: review?(aaronr) → review+
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: