CamelCase names for XML elements vs. property names for Java bean s

Ray Waldin rwaldin at pacbell.net
Tue Jan 18 23:58:47 GMT 2000


"Tolkin, Steve" wrote:
> In the BizTalk Framework Document Design Guide
> (http://www.BizTalk.org/Resources/frame081.asp).
>     Names and Cases: Names should use the style called
> "CamelCase." If an element reflects a thing (an object, a class or a
> table name), use UpperCamelCase; if it is a property, a reference,
> etc., use lowerCamelCase.
>     Expressing Data: All simple data (trees, columns, rows, objects,
> properties, etc.) should be expressed as elements and subelements, not
> attributes.

Microsoft has recently changed their examples to use lowerCamelCase attributes
instead of elements for "properties".  Here's the example from the Document
Design Guide you quoted above:

> <PurchaseOrder xmlns=
>   "urn:schemas-biztalk.org:your-namespace/purchaseorder.xml">
> <POHeader> 
> <PONumber>12345</PONumber>
> <PaymentType>INVOICE</PaymentType> 
> <POShipTo>
> <street1>Your Street 1</street1>
> <street2>Your Street 2</street2> 
> <city>Your City</city>
> </POShipTo >
> ...
> </PurchaseOrder>

And here's a similar example from a more recently published BizTalk Framework
Document Specification 1.0 
(http://206.132.62.135/Biztalk%20Framework%20Document%20Specification%201.0.doc): 

> <PO xmlns="x-schema:http://schemas.biztalk.org/BizTalk/cfwau8qx.xml">
>   <POHeader
>     refPromise="0"
>     fromCust="111111111"
>     poNumber="PO# 12345"
>     description=""
>     paymentType="INVOICE"
>     shipType="AIR1D" />
>   <Contact
>     contactName=""
>     contactPhone=""
>     contactEmail="" />
>   <POShipTo
>     street1="200 Smith Rd"
>     street2=""
>     street3=""
>     street4=""
>     attn="Bob Smith"
>     city="Anytown"
>     stateProvince=""
>     postalCode="54321"
>     country="USA" /> 
> ...
> </PO>

Personally, I prefer UpperCamelCase for both element and attribute names.

-Ray

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions now closed in preparation for transfer to OASIS.





More information about the Xml-dev mailing list