Encoding XML element name beginning with a number?

后端 未结 5 1062
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 17:11

I\'m looking at the output of a tool, dumping a database table to XML. One of the columns is named 64kbit , the tool encodes that as such, and I need to rep

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 17:42

    IIRC (I was there, but it was a long time ago) the thinking was that it would be very common to map XML element & attributes to programming-language constructs, which are represented by variables, and very few (any?) programming languages allow variable names that begin with numbers. So, the idea is that XML element/attribute names should fit nicely into most languages’ variable-naming rules. Do I still believe this? If we were doing XML again, would I be OK with this? Dunno; it’d be an interesting discussion though.

提交回复
热议问题