1
is a Numeric type, while "1"
is
String type. This is common in programming languages, but not as common in markup
languages. In XML, without a schema, the token 1
is xs:anyType and it's
up the application to infer a type (possibly using a schema, or up to application
logic).1
to a
numeric type because it looks like one, and another translates "one" to a string
this could break the application."value" : 1
vs. <value>1</value>
)xs:type | XML | JSON |
---|---|---|
xs:integer | 1 | 1 |
xs:boolean | true | true |
xs:string | John Doe | "John Doe" |
empty | <empty/> | null |
xs:type | XML | JSON |
---|---|---|
xs:NMTOKENS | Hi There | [ "Hi","There"] |
xs:IDREFS | id1 id2 id3 | [ "id2" , "id2" , "id3"] |
<xs:list itemType="xs:integer"/> | 1 2 3 4 | [ 1 , 2 , 3 , 4] |
Name rule | Clark Name | JSON Name |
---|---|---|
<json_name search="\{([^}]*)\}?(.+)$" replace="$2"/> | {http://www.myorg.org}name | name |
<json_name name="Json Name"/> | {http://www.myorg.org}name | Json Name |
<json_name search="\{([^}]*)\}?(.+)$" replace="1_$2"/> | {http://www.myorg.org}name | 1_name |