Generally, I recommend some_tag.
The reason for this is that it's the only construct that actually
generalises across languages and formats. Programming languages, for
example, rarely permit some-tag as a variable name because as far as
they're concerned it's two variables and a subtract operation.
Keeping everything consistent allows the programmer to utilise the
same nomenclature in their software as it is presented in the
dataset, and avoids confusion.
CamelCase, or someTag in this instance, is fairly popular but the
cross-pollination of concepts between HTML and XML means that many XML
developers fail to realise that it is in fact case sensitive. Use of
multi-case can sometimes lead to a real debugging headache for those
users.
If I were doing the design, I suspect my output would be something
like:
<prices version="1" all_stock="1" dated="2009-01-01T00:00:00">
<claims>
<claim stock="OCR.75.29JAN" last="0.2198" bid="0.2110"
ask="0.2198" />
<claim stock="OCR.75.29FEB" last="0.2198" bid="0.2110"
ask="0.2198" />
<claim stock="OCR.75.29MAR" last="0.2198" bid="0.2110"
ask="0.2198" />
...
</claims>
</prices>
This kind of simple, attribute-based design simplifies xpath
constructs and xsl transformations, keeps naming dead simple and
obvious, avoids issues like whether "true" == 1 == "True" == "yes" ==
whatever, uses standard XML datetime formatting, and keeps the entire
result-set self contained so that it can be saved as XML and, without
context, handed to XSLT for transformation into something useful.
For example, the xpath to retrieve the bid price for all claims iff
the version of the result is 1 is:
/prices[@version="1"]//claim/@bid
This is both robust - it won't trigger on any random claim element,
only on one that is a proper subset of prices, version 1 - and simple,
a short, single, easy to read line.
For the existing layout, the following would be roughly equivalent
(it's been a while so don't hate me if I get it wrong)
/Prices[apiVersion/text() = "1"]//claim/bid/text()
This is neither as intuitive, nor is it common usage - tutorials etc
do not always cover this kind of use, and thus you find developers
reparsing the whole tree rather than xpathing intelligently because
they don't know how to predicate correctly.
As I indicated before, I am unconcerned really, what you've proposed
now is sufficiently parsable for my purposes, but it seemed worthwhile
to explain my reasoning for how I'd do it.
On Dec 23, 11:23 am, Simon <
sighman.le...@gmail.com> wrote:
> thanks for this feedback ... great to get your input on this (I'm
> working with Keaton - but not directly working on this public API
> project)
>
> I know what you mean about the case.
>
> I have seen and even occasionaly used some-tag, someTag, or SomeTag
> but have also seen some_tag or even sometag (neither of which I like
> much)
>
> I guess my favourite is some-tag, maybe someTag would come second (I
> do use it) but perhaps that might have more meaning to developers ....
>
> 2008/12/23 Richard Clark <
richard.cl...@gmail.com>: