Re: [PATCH 0/4] APN type and plan extensions for automatic provisioning
- From: Marius Kotsbak <marius kotsbak gmail com>
- To: networkmanager-list gnome org
- Subject: Re: [PATCH 0/4] APN type and plan extensions for automatic provisioning
- Date: Fri, 29 Jul 2011 14:39:15 +0200
Den 29. juli 2011 13:35, skrev Oleg Zhurakivskyy:
Hello everyone,
On 07/28/2011 06:51 PM, Dan Williams wrote:
On Thu, 2011-07-28 at 10:59 -0400, Eric Shienbrood wrote:
I think the only way to allow multiple tokens in an attribute is by
declaring the type to be NMTOKENS. But if you do that, then it can't
be an enumeration, so you lose the validation that that provides. If
you want to use an enumeration, then you'll have to allow for multiple
'plan' or 'type' elements.
Hmm, oh well... maybe we need to do that then. I think having multiple
plan and type tokens is the best way to do this ATM so maybe we do have
to put these into the body of the APN.
So, there are multiple choices:
1. Multiple values for the "type" and "plan" attributes:
<apn value="foobar" type="internet wap" plan="prepaid postpaid">
...
</apn>
Easy to read and edit.
This isn't possible to validate since XML doesn't allow multiple
tokens for the attribute.
2. Multiple attributes with the same name:
<apn value="foobar" type="internet" type="wap" plan="prepaid"
plan="postpaid">
...
</apn>
Ugly to read and write.
XML doesn't allow this either?
3. To put the "type" and "plan" into the body and use them as
elements, i.e:
<apn value="foo">
<type>internet</type>
<type>wap</type>
<plan>prepaid</plan>
<plan>postpaid</plan>
...
</apn>
Easy to read and write.
But, here the same problem again, i.e. the content of the element
can't be restricted with the enumeration, right?
But does not validate fully. It is possible using XML schema instead of
DTD: http://en.wikipedia.org/wiki/XML_Schema_(W3C)#Example
Maybe this way it is possible with DTD:
<apn value="foo">
<type>
<internet/>
<wap/>
</type>
<plan>
<prepaid/>
<postpaid/>
</plan>
</apn>
4. How about using attributes this way?
<apn value="foobar" internet="yes" prepaid="yes" postpaid="yes">
...
</apn>
Not so bad if they are optional.
--
Marius
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]