XML 요소냐, 속성이냐?

| 1 Comment | No TrackBacks

Principles of XML design: When to use elements versus attributes @ developerWorks


XML 문서의 형식이나 구조를 결정 해야 할때 한 가지 의문이 들곤 합니다. 정보를 요소로 뺄지, 속성으로 넣을지 결정하는 규칙 같은 게 있지 않을까 같은 고민을 하게 됩니다. 마침 IBM developerWorks에 가봤더니 좋은 글이 있었습니다.

요소 대 속성, 어떤 것을 써야 할 지에 대한 지침입니다. 두루뭉술 짐작만 하던 방법에 이름을 붙여 법칙이라 부르니 뭔가 있어 보입니다.

핵심 콘텐츠의 원칙(Principle of core content)

핵심 콘텐츠는 요소에, 보조 내용은 속성에 쓴다.

구조적 정보의 원칙(Principle of structured information)

묶여 다니는 정보는 요소로, 독립 정보는 속성에 쓴다.

가독성의 원칙(Principle of readability)

사람이 읽을  정보에는 요소를, 컴퓨터가 사용할 정보에는 속성을 쓴다.

요소 속성 결합 원칙(Principle of element/attribute binding)

다른 속성에 의해 꾸며져야 하면, 요소를 쓴다.

No TrackBacks

TrackBack URL: http://www.praptor.com/mt/mt-tb.cgi/51

1 Comment

또죽었네?

Leave a comment

About this Entry

This page contains a single entry by praptor published on March 19, 2009 11:34 PM.

언론사 잡지를 구독하자 was the previous entry in this blog.

레이아웃 정리 중입니다. is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.23-en