Closed
Bug 292634
Opened 20 years ago
Closed 20 years ago
We don't handle ref="ns:type" in schema code.
Categories
(Core Graveyard :: Web Services, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: doronr, Assigned: doronr)
Details
Attachments
(1 file)
|
5.32 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
mkaply
:
approval1.8b2+
|
Details | Diff | Splinter Review |
nsSchemaElementRef::Resolve simply calls mSchema->GetElementByName(mRef, getter_AddRefs(mElement));, and doesn't take ns:type as a ref value into consideration.
| Assignee | ||
Comment 1•20 years ago
|
||
Attachment #182406 -
Flags: superreview?(peterv)
| Assignee | ||
Comment 2•20 years ago
|
||
Found this working on complex type validation. It would throw an exception when trying to call nsISchemaParticle->GetName() for example.
Comment 3•20 years ago
|
||
Comment on attachment 182406 [details] [diff] [review] patch - store the namespace in nsSchemaElementRef >Index: extensions/webservices/schema/src/nsSchemaLoader.cpp >=================================================================== >@@ -992,8 +993,36 @@ > aElement->GetAttribute(NS_LITERAL_STRING("ref"), ref); > if (!ref.IsEmpty()) { > nsSchemaElementRef* elementRef; >- >- elementRef = new nsSchemaElementRef(aSchema, ref); >+ nsAutoString refNS; >+ >+ if (ref.FindChar(':') != kNotFound) { I didn't really find in the spec if there's a default namespace (for unprefixed ref attribute values), do you know? I think we should always call CheckQName and only look up the namespace URI if colon is non-null, what do you think?
Attachment #182406 -
Flags: superreview?(peterv) → superreview+
| Assignee | ||
Comment 4•20 years ago
|
||
(In reply to comment #3) > (From update of attachment 182406 [details] [diff] [review] [edit]) > >Index: extensions/webservices/schema/src/nsSchemaLoader.cpp > >=================================================================== > > >@@ -992,8 +993,36 @@ > > aElement->GetAttribute(NS_LITERAL_STRING("ref"), ref); > > if (!ref.IsEmpty()) { > > nsSchemaElementRef* elementRef; > >- > >- elementRef = new nsSchemaElementRef(aSchema, ref); > >+ nsAutoString refNS; > >+ > >+ if (ref.FindChar(':') != kNotFound) { > > I didn't really find in the spec if there's a default namespace (for unprefixed > ref attribute values), do you know? From what I can tell, it seems to imply that no ns: means current schema document. The samples and schema files I have seen seem to impyl this as well. > I think we should always call CheckQName and only look up the namespace URI if > colon is non-null, what do you think? > You are probably right, FindChar in the case of no ns: means it has to walk the whole string. And if ns: exists, we go through some part of the string and then through it again in CheckQName() probably. Do I need a r= for this as well?
Status: NEW → ASSIGNED
Comment 5•20 years ago
|
||
Comment on attachment 182406 [details] [diff] [review] patch - store the namespace in nsSchemaElementRef r/sr=peterv with change to always call CheckQName.
Attachment #182406 -
Flags: review+
Comment 6•20 years ago
|
||
Comment on attachment 182406 [details] [diff] [review] patch - store the namespace in nsSchemaElementRef a=mkaply
Attachment #182406 -
Flags: approval1.8b2+
| Assignee | ||
Comment 7•20 years ago
|
||
checked in!
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•