--- id: php-xml-parsers title: "PHP XML Parsers" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["tree-based vs event-based parsers", "PHP XML νŒŒμ„œ κ°œμš”"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["php", "programming", "w3schools", "xml", "parsers"] raw_sources: ["https://www.w3schools.com/php/php_xml_parsers.asp"] applied_in: [] github_commit: "" --- # [[PHP XML Parsers]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Tree-based parsers (SimpleXML, DOM) load the ENTIRE document into memory as a navigable tree β€” great for small files but a "major performance issue" for large ones β€” while event-based parsers (XMLReader, Expat) process one node at a time and discard it before moving on, making the choice between the two families purely about document size, not feature preference. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **XML** β€” a universal data-exchange format, syntactically similar to HTML but with user-defined tags. [S1] - **Tree-based parser** β€” loads the whole document into memory as a tree; ideal for SMALL documents; examples: SimpleXML, DOM. [S1] - **Event-based parser** β€” reads one node at a time, discarding prior nodes; faster and lower-memory for LARGE documents; examples: XMLReader, XML Expat Parser. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) 이 μ±•ν„°λŠ” 두 νŒŒμ„œ 계열(트리 기반 vs 이벀트 기반)의 κ°œλ…μ  λΉ„κ΅λ§Œ μ œκ³΅ν•˜λ©°, μ„ΈλΆ€ κ΅¬ν˜„μ€ 이후 챕터(SimpleXML/Expat/DOM)μ—μ„œ 닀룬닀. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” λ¬Έμ„œ 크기에 따라 νŒŒμ„œ μ’…λ₯˜λ₯Ό μ„ νƒν•˜λŠ” 기쀀이 이후 λͺ¨λ“  XML μ±•ν„°μ˜ μ „μ œκ°€ λœλ‹€. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) ν•΄λ‹Ή μ±•ν„°λŠ” κ°œλ… μ†Œκ°œ μ€‘μ‹¬μœΌλ‘œ 별도 μ½”λ“œ μ˜ˆμ œκ°€ μ—†μŒ β€” λ‹€μŒ 챕터([[PHP XML SimpleXML Read]])μ—μ„œ μ‹€μ œ νŒŒμ‹± μ½”λ“œκ°€ μ‹œμž‘λœλ‹€. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[PHP Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[PHP XML SimpleXML Read]], [[PHP XML Parser Expat]], [[PHP XML DOM]] - **μ°Έμ‘° λ§₯락:** XML νŒŒμ„œ λΆ„λ₯˜μ˜ λ„μž…λΆ€ β€” SimpleXML μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” PHP XML Parsers β€” https://www.w3schools.com/php/php_xml_parsers.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "PHP XML Parsers" page (Astra wiki-curation, P-Reinforce v3.1 format).