PageSourceSearch

https://outerbase.com/_next/static/chunks/pages/glossary/xml-7b6e0e9c6d59c120.js

js outerbase.com collected 2026-10-02 02:53:16 UTC 3,615 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5754],{5513:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/glossary/xml",function(){return t(4368)}])},4368:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>i});var n=t(5105),r=t(1064),s=t(3907);let o={term:"XML",definition:"XML (eXtensible Markup Language) is used to structure data with tags. It’s human-readable and machine-readable, making it common in older systems, web services, and document formats.",category:"Intermediate",howItWorks:"XML documents nest elements (tags) to represent hierarchical structures. Attributes store extra information. XML parsers validate the syntax, and schemas (DTD or XSD) set rules for elements and data types.",technicalDetails:"XML can be more verbose than JSON, but it allows custom tag names and advanced validation. XSLT can transform XML into various formats. Many older APIs still rely on XML, though JSON has become more popular.",syntax:"-- Example: Working with XML in SQL\n-- 1. Create table with an XML column\nCREATE TABLE product_catalog (\n  id SERIAL PRIMARY KEY,\n  metadata XML\n);\n\n-- 2. Insert XML data\nINSERT INTO product_catalog (metadata) VALUES (\n  '<product>\n    <name>Laptop</name>\n    <specs>\n      <cpu>Intel i7</cpu>\n      <ram>16GB</ram>\n      <storage>512GB SSD</storage>\n    </specs>\n    <price currency=\"USD\">999.99</price>\n  </product>'\n);\n\n-- 3. Query XML data (SQL Server syntax as an example)\nSELECT \n  id,\n  metadata.value('(/product/name)[1]', 'VARCHAR(100)') AS product_name,\n  metadata.value('(/product/specs/cpu)[1]', 'VARCHAR(50)') AS cpu,\n  metadata.value('(/product/price/@currency)[1]', 'VARCHAR(3)') AS currency,\n  metadata.value('(/product/price)[1]', 'DECIMAL(10,2)') AS price\nFROM product_catalog;\n\n-- 4. Update XML\nUPDATE product_catalog\nSET metadata.modify('\n  replace value of (/product/price/text())[1]\n  with \"1099.99\"\n')\nWHERE id = 1;\n\n-- 5. Search in XML\nSELECT id\nFROM product_catalog\nWHERE metadata.exist('/product/specs/ram[text()=\"16GB\"]') = 1;\n\n-- 6. Generate XML from relational data\nSELECT \n  product_id,\n  name,\n  category,\n  price\nFROM products\nFOR XML PATH('product'), ROOT('catalog');",supportedPlatforms:[{name:"MySQL",supported:!0,notes:"Basic XML functions like ExtractValue() and UpdateXML(), though limited compared to other engines."},{name:"PostgreSQL",supported:!0,notes:"Robust XML functions and operators for advanced queries and transformations."},{name:"SQL Server",supported:!0,notes:"Native XML data type, indexing, and strong XQuery support."}],bestPractices:["Use clear, consistent tag names and attributes","Validate XML against a schema (XSD or DTD) when possible","Keep nesting logical and avoid unnecessary complexity"],commonPitfalls:["Tangled hierarchies that make parsing difficult","Mixing data structure with presentation in the same XML","Ignoring special characters or entity references"],advancedTips:["Use XPath or XQuery for more powerful searching","Leverage XSLT to transform XML into other formats (e.g., HTML)","Use streaming parsers (SAX) for very large XML files to save memory"],relatedTerms:[{term:"JSON",href:"/glossary/json",definition:"A lightweight, human-readable data format often used instead of XML in modern systems."},{term:"CRUD",href:"/glossary/crud",definition:"Basic operations for persistent storage, frequently used in XML-based web services."}]},i=()=>(0,n.jsx)(r.A,{term:o.term,definition:o.definition,children:(0,n.jsx)(s.A,{...o})})}},e=>{var a=a=>e(e.s=a);e.O(0,[5598,3870,6752,6112,4582,636,6593,8792],()=>a(5513)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.