MEP | 3 |
---|---|
Title | Document type XML cleanup |
Status | Accepted |
Created | 2014-11-14 |
Author | Harm Aarts |
Document type XML cleanup
Abstract
This MEP contains a series of enhancements to the XML generated from the many document types.
Most changes are cosmetic in nature, some are semantic improvements and a single one is aimed at facilitating generation of valid XML.
These enhancements all have the goal of making the consumption, by human and machines alike, easier.
Current status
Open-Transactions currently serializes documents to XML prior to transport and/or storage. This XML (should) constitute a Ricardian contract.
Drawbacks
The current generated XML lacks consistency:
- In element and attribute naming, upper and lower case are not consistently applied.
- Some concepts bear different names.
- Others have superfluous prefixes.
- Yet others have cryptic or unnecessarily vague names.
- The generated XML has, sometimes, multiple XML declarations.
Enhancement
The enhancements are all small:
- In general, XML elements and attributes use
camelCase
. - All the
OT
prefixes are to be removed: they add no additional information to the whole. - XML declarations are written only once at the top. This means that embedded XML has to avoid writing it.
- The current practice of prefixing the
@
symbol when serializing a response has to be changed to suffixingResponse
. - Several names are changed:
server
becomesnotary
(as do all derivatives likeserverID
)user
becomesnym
assetType
andassetTypeID
becomesassetID
getRequest
becomesgetRequestNumber
getTransactionNum
becomesgetTransactionNumbers
createUserAccount
becomesregisterNym
message
becomesnotaryMessage
Impact
The impact of renaming attributes and elements is minimal: this is hardly more difficult than a search and replace operation. We can rely on the current test suite for relevant regressions.
Care should be taken communicating these changes to the community, as some concepts previously known under different names now have a uniform name.
The departure of the @
prefixes should also be explained. The @
prefixes
are a construct from Truledger and understandably made
it into OT. However, moving forward, this is now changed in favour of valid
XML.