Files
cms-website/docs/adr/ADR-005-WXR流式SAX解析.md
T
浅念 07483b5ae2 docs: ADR 001–015 落档 + README
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-20 20:56:26 +08:00

7 lines
563 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ADR-005:WXR 解析 = 流式 SAX 解析
- **状态**:已采纳(spec §3,阶段 0)
- **决策**:WXR 用流式 SAX 解析;禁止整文件正则解析;限制字节、节点、深度、字段长度和处理时间。
- **理由**:真实 WXR 可达数百 MB,整文件 DOM/正则会内存爆炸或静默错切(CDATA、实体、命名空间变体);流式 + 硬限制保证对畸形输入可预测地失败。
- **权衡**:实现比正则贵得多、状态机复杂;换取对任意大小/畸形文件的健壮性与确定性资源上界。