JSON
[특징]
- UTF-8만을 이용가능
- 주석 불가능
- null을 안쓰는게 좋다
[한계]
- 텍스트 기반이기 때문에 데이터를 표현하는데 큰 손실이 든다
- 메시지 호환성 유지가 힘들다 → json파일이 바뀌면 서버랑 클라랑 동기화가 잘안된다
XML
[대표적으로 쓰이는 곳]
- AWS → Restful API의 응답형식
- MS 워드, 엑셀 → XML압축한 파일
[특징]
- 문자인코딩을 정할수 있지만 UTF8만 쓰는걸 추천한다
[읽는 법]
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>Two of our famous Belgian Waffles with plenty of real maple syrup</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>Light Belgian waffles covered with strawberries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price>
<description>Light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description>Thick slices made from our homemade sourdough bread</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>Two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
<calories>950</calories>
</food>
</breakfast_menu>