Extensible Markup Language (.xml)
W3C 표준Extensible Markup Language (XML) is a versatile markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
XML 온라인 압축
브라우저 내 100% 안전한 압축 — 파일이 기기 외부로 전송되지 않습니다
검사 및 메타데이터
운영 체제와 파일 분석기는 파일 선두의 바이너리 바이트 시퀀스를 검사하여 XML 파일을 식별합니다:
바이트 단위 헤더 시그니처 (매직 바이트)
운영 체제와 파일 분석기는 파일 선두의 바이너리 바이트 시퀀스를 검사하여 XML 파일을 식별합니다:
16진수 시그니처 (오프셋 0):
3C 3F 78 6DASCII 표현: <?xm
표준화: W3C Recommendation (XML 1.0 Fifth Edition)
기술 사양
| 컨테이너 아키텍처 | Hierarchical text markup language with custom semantic tags and attributes |
| 압축 | Gzip / Deflate achieves 85%-92% compression on verbose closing tags |
| 바이트 엔디안 | UTF-8 / UTF-16 character stream determined by XML declaration encoding attribute |
| 색 공간 | Not applicable |
| 채널 및 구조 | Elements (<tag>), attributes (attr="val"), CDATA blocks, processing instructions |
| 최대 크기 | Unbounded hierarchical tree structure |
| 투명도 | Not applicable |
| 스트리밍 및 프로그레시브 | SAX (Simple API for XML) and StAX parsers enable memory-efficient stream reading |
기술 비교 매트릭스: XML 대 경쟁사
| 기술적 속성 | XML (현재) | JSON | YAML | Protocol Buffers |
|---|---|---|---|---|
| Verbosity | High (closing tags and attribute syntax) | Low (compact key-value format) | Low (indentation-based) | Ultra-low (binary serialization) |
| Schema Validation | Mature XSD & DTD standards with compiler enforcement | JSON Schema (optional) | JSON Schema / Yaml schemas | Strict .proto schema definitions |
| Namespaces | Native XML namespaces (xmlns) support | No native namespace mechanism | No native namespace mechanism | Package declarations |
| Transformations | XSLT declarative transformation pipelines | Custom code / jq scripts | Custom code | Custom code |
일반적인 손상 모드 및 헥스 복구 가이드
⚠️ XML Parsing Error: mismatched tag or entity not defined.
근본 원인: Unescaped reserved characters (like '&', '<', or '>') or case mismatch between opening and closing tags.
복구: Replace '&' with '&', '<' with '<', '>' with '>', or wrap arbitrary text inside '<![CDATA[ ... ]]>'' blocks.
보안 분석 및 파서 공격 벡터
XML parsers have historically been one of the most attacked components in enterprise computing due to powerful DTD and entity expansion capabilities.
알려진 공격 벡터
- XML External Entity (XXE): Malicious DOCTYPE referencing local server files ('file:///etc/passwd') or internal network endpoints.
- Billion Laughs Attack (XML Bomb): Nested entity declarations expanding exponentially in memory to cause denial of service.
- XPath Injection: Unsanitized user inputs allowing unauthorized querying of XML databases.
방어적 모범 사례: Always disable external DTD resolution and external entity processing (setFeature 'disallow-doctype-decl' to true) in XML parsers.
역사적 배경 및 주요 이력
주요 장점
- Rigorous schema validation using XSD (XML Schema Definition) or DTD ensures strict data integrity.
- Namespaces (xmlns) prevent element name collisions in complex multi-source documents.
- Powerful querying and transformation toolchains (XPath, XSLT, XQuery).
기술적 제한 사항 및 단점
- Extremely verbose: closing tags repeat element names, creating large file sizes and high bandwidth consumption.
- DOM parsing builds large memory-intensive object trees.
- Prone to XML External Entity (XXE) and entity expansion security vulnerabilities.
흥미로운 기술적 상식
- XML is a simplified subset of SGML (Standard Generalized Markup Language), designed to work seamlessly over the World Wide Web.
- Modern office documents (.docx, .xlsx), vector images (.svg), and RSS feeds are all specialized XML dialects.
자주 묻는 기술 질문
What is the difference between well-formed and valid XML?
'Well-formed' XML follows the basic syntax rules (matching tags, quotes around attributes, single root element). 'Valid' XML is well-formed AND adheres strictly to an external schema definition (XSD or DTD).
Why did JSON replace XML for most web APIs?
JSON maps directly to native JavaScript and programming language data structures (hash maps and arrays) with much less boilerplate, faster parsing, and smaller network payloads.