Let's consider three variables: a, b and c:
a. Name is qualified in XML Schema: yes/no
b. Name is prefixed in XML document: yes/no (default namespace is also considered as a prefix, the empty string prefix, for this discussion’s sake)
c. Prefix for name is defined in XML document: yes/no
If we consider all possible values for a, b and c we end up with 8 possibilities:
a | b | c |
0 | 0 | 0 |
0 | 0 | 1 |
0 | 1 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 0 | 1 |
1 | 1 | 0 |
1 | 1 | 1 |
I don't expect to get any namespace related error
if a==b==c==0
or
if a==c==1 and b is either 1 or 0
(0 stands for no and 1 for yes...)
If I'm right than testing for namespace can be done with two comparisons
In case we don't have an XML Schema, the table has only two columns (no column for qualification):
So we get
b | c |
0 | 0 |
0 | 1 |
1 | 0 |
1 | 1 |
we get that the only error is if we use a prefix that is not declared.
No comments:
Post a Comment