Re: [PATCH 0/4] APN type and plan extensions for automatic provisioning

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">

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">

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">

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:

Maybe this way it is possible with DTD:

<apn value="foo">

4. How about using attributes this way?

<apn value="foobar" internet="yes" prepaid="yes" postpaid="yes">

Not so bad if they are optional.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]