xml
Installation
SKILL.md
Namespaces
- XPath
/root/childfails if document has default namespace—use//*[local-name()='child']or register prefix - Default namespace (
xmlns="...") applies to elements, not attributes—attributes need explicit prefix - Namespace prefix is arbitrary—
<foo:element>and<bar:element>are identical if both prefixes map to same URI - Child elements don't inherit parent's prefixed namespace—each must declare or use prefix explicitly
Encoding
<?xml version="1.0" encoding="UTF-8"?>must match actual file encoding—mismatch corrupts non-ASCII- Encoding declaration must be first thing in file—no whitespace or BOM before it (except UTF-8 BOM allowed)
- Default encoding is UTF-8 if declaration omitted—but explicit is safer across parsers
Escaping & CDATA
- Five entities always escape in text:
&<>"' - CDATA sections
<![CDATA[...]]>for blocks with many special chars—but]]>inside CDATA breaks it - Attribute values: use
"if delimited by", or'if delimited by' - Numeric entities
<and<work everywhere—useful for edge cases