MCPcopy Index your code
hub / github.com/simstudioai/sim / parseXml

Function parseXml

apps/sim/lib/pptx-renderer/parser/xml-parser.ts:93–105  ·  view source on GitHub ↗
(xmlString: string)

Source from the content-addressed store, hash-verified

91 * Uses the browser's built-in DOMParser.
92 */
93export function parseXml(xmlString: string): SafeXmlNode {
94 const parser = new DOMParser()
95 const doc = parser.parseFromString(xmlString, 'application/xml')
96
97 // Check for parser errors — DOMParser returns a parsererror document on failure
98 const errorNode = doc.querySelector('parsererror')
99 if (errorNode) {
100 logger.warn('XML parse error', { error: errorNode.textContent ?? '' })
101 return new SafeXmlNode(null)
102 }
103
104 return new SafeXmlNode(doc.documentElement)
105}

Callers 6

getPredefinedTableStyleFunction · 0.90
createContextFunction · 0.90
parseRelsFunction · 0.90
buildDiagramGroupFunction · 0.90
buildPresentationFunction · 0.90

Calls 1

warnMethod · 0.65

Tested by 1

createContextFunction · 0.72