[{"data":1,"prerenderedAt":1734},["ShallowReactive",2],{"navigation_docs_en":3,"-en-xml-query-utilities":335,"-en-xml-query-utilities-surround":1729},[4,31,61,91,175,256],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":30},"Getting Started","i-lucide-rocket","\u002Fen\u002Fgetting-started","en\u002F01.getting-started",[10,14,18,22,26],{"title":11,"path":12,"stem":13},"Introduction","\u002Fen\u002Fgetting-started\u002Fintroduction","en\u002F01.getting-started\u002F01.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fen\u002Fgetting-started\u002Finstallation","en\u002F01.getting-started\u002F02.installation",{"title":19,"path":20,"stem":21},"Command Line Interface (CLI)","\u002Fen\u002Fgetting-started\u002Fcommand-line-interface","en\u002F01.getting-started\u002F03.command-line-interface",{"title":23,"path":24,"stem":25},"AI Tools","\u002Fen\u002Fgetting-started\u002Fai-tools","en\u002F01.getting-started\u002F04.ai-tools",{"title":27,"path":28,"stem":29},"AI Integration","\u002Fen\u002Fgetting-started\u002Fai-integration","en\u002F01.getting-started\u002F05.ai-integration",false,{"title":32,"icon":33,"path":34,"stem":35,"children":36,"page":30},"CORE","i-lucide-box","\u002Fen\u002Fcore","en\u002F02.core",[37,41,45,49,53,57],{"title":38,"path":39,"stem":40},"@office-open\u002Fcore","\u002Fen\u002Fcore\u002Foverview","en\u002F02.core\u002F01.overview",{"title":42,"path":43,"stem":44},"Descriptor System","\u002Fen\u002Fcore\u002Fdescriptors","en\u002F02.core\u002F02.descriptors",{"title":46,"path":47,"stem":48},"Values and Validation","\u002Fen\u002Fcore\u002Fvalues","en\u002F02.core\u002F03.values",{"title":50,"path":51,"stem":52},"Unit Converters","\u002Fen\u002Fcore\u002Fconverters","en\u002F02.core\u002F04.converters",{"title":54,"path":55,"stem":56},"Charts","\u002Fen\u002Fcore\u002Fcharts","en\u002F02.core\u002F05.charts",{"title":58,"path":59,"stem":60},"Parser","\u002Fen\u002Fcore\u002Fparser","en\u002F02.core\u002F06.parser",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":30},"XML","i-lucide-code-xml","\u002Fen\u002Fxml","en\u002F03.xml",[67,71,75,79,83,87],{"title":68,"path":69,"stem":70},"@office-open\u002Fxml","\u002Fen\u002Fxml\u002Foverview","en\u002F03.xml\u002F01.overview",{"title":72,"path":73,"stem":74},"Parsing","\u002Fen\u002Fxml\u002Fparsing","en\u002F03.xml\u002F02.parsing",{"title":76,"path":77,"stem":78},"Serialization","\u002Fen\u002Fxml\u002Fserialization","en\u002F03.xml\u002F03.serialization",{"title":80,"path":81,"stem":82},"Query Utilities","\u002Fen\u002Fxml\u002Fquery-utilities","en\u002F03.xml\u002F04.query-utilities",{"title":84,"path":85,"stem":86},"XML Escape","\u002Fen\u002Fxml\u002Fescape","en\u002F03.xml\u002F05.escape",{"title":88,"path":89,"stem":90},"Type Reference","\u002Fen\u002Fxml\u002Ftypes","en\u002F03.xml\u002F06.types",{"title":92,"icon":93,"path":94,"stem":95,"children":96,"page":30},"DOCX","i-lucide-file-text","\u002Fen\u002Fdocx","en\u002F04.docx",[97,101,105,109,113,117,121,124,128,132,136,140,144,148,152,156,160,164,168,171],{"title":98,"path":99,"stem":100},"@office-open\u002Fdocx","\u002Fen\u002Fdocx\u002Foverview","en\u002F04.docx\u002F01.overview",{"title":102,"path":103,"stem":104},"Quick Start","\u002Fen\u002Fdocx\u002Fquickstart","en\u002F04.docx\u002F02.quickstart",{"title":106,"path":107,"stem":108},"Text and Paragraphs","\u002Fen\u002Fdocx\u002Ftext-and-paragraphs","en\u002F04.docx\u002F03.text-and-paragraphs",{"title":110,"path":111,"stem":112},"Tables","\u002Fen\u002Fdocx\u002Ftables","en\u002F04.docx\u002F04.tables",{"title":114,"path":115,"stem":116},"Images","\u002Fen\u002Fdocx\u002Fimages","en\u002F04.docx\u002F05.images",{"title":118,"path":119,"stem":120},"Text Boxes","\u002Fen\u002Fdocx\u002Ftextbox","en\u002F04.docx\u002F06.textbox",{"title":54,"path":122,"stem":123},"\u002Fen\u002Fdocx\u002Fcharts","en\u002F04.docx\u002F07.charts",{"title":125,"path":126,"stem":127},"SmartArt","\u002Fen\u002Fdocx\u002Fsmartart","en\u002F04.docx\u002F08.smartart",{"title":129,"path":130,"stem":131},"Media","\u002Fen\u002Fdocx\u002Fmedia","en\u002F04.docx\u002F09.media",{"title":133,"path":134,"stem":135},"Links","\u002Fen\u002Fdocx\u002Flinks","en\u002F04.docx\u002F10.links",{"title":137,"path":138,"stem":139},"Headers and Footers","\u002Fen\u002Fdocx\u002Fheaders-and-footers","en\u002F04.docx\u002F11.headers-and-footers",{"title":141,"path":142,"stem":143},"Equations and Symbols","\u002Fen\u002Fdocx\u002Fequations-and-symbols","en\u002F04.docx\u002F12.equations-and-symbols",{"title":145,"path":146,"stem":147},"Styles and Themes","\u002Fen\u002Fdocx\u002Fstyles-and-themes","en\u002F04.docx\u002F13.styles-and-themes",{"title":149,"path":150,"stem":151},"Page Layout","\u002Fen\u002Fdocx\u002Fpage-layout","en\u002F04.docx\u002F14.page-layout",{"title":153,"path":154,"stem":155},"References","\u002Fen\u002Fdocx\u002Freferences","en\u002F04.docx\u002F15.references",{"title":157,"path":158,"stem":159},"Comments and Revisions","\u002Fen\u002Fdocx\u002Fcomments-and-revisions","en\u002F04.docx\u002F16.comments-and-revisions",{"title":161,"path":162,"stem":163},"Document Properties","\u002Fen\u002Fdocx\u002Fproperties","en\u002F04.docx\u002F17.properties",{"title":165,"path":166,"stem":167},"Export","\u002Fen\u002Fdocx\u002Fexport","en\u002F04.docx\u002F18.export",{"title":72,"path":169,"stem":170},"\u002Fen\u002Fdocx\u002Fparsing","en\u002F04.docx\u002F19.parsing",{"title":172,"path":173,"stem":174},"Patching","\u002Fen\u002Fdocx\u002Fpatch","en\u002F04.docx\u002F20.patch",{"title":176,"icon":177,"path":178,"stem":179,"children":180,"page":30},"PPTX","i-lucide-presentation","\u002Fen\u002Fpptx","en\u002F05.pptx",[181,185,188,192,195,198,201,204,207,210,214,217,220,224,227,231,235,239,243,247,250,253],{"title":182,"path":183,"stem":184},"@office-open\u002Fpptx","\u002Fen\u002Fpptx\u002Foverview","en\u002F05.pptx\u002F01.overview",{"title":102,"path":186,"stem":187},"\u002Fen\u002Fpptx\u002Fquickstart","en\u002F05.pptx\u002F02.quickstart",{"title":189,"path":190,"stem":191},"Shapes and Text","\u002Fen\u002Fpptx\u002Fshapes-and-text","en\u002F05.pptx\u002F03.shapes-and-text",{"title":110,"path":193,"stem":194},"\u002Fen\u002Fpptx\u002Ftables","en\u002F05.pptx\u002F04.tables",{"title":114,"path":196,"stem":197},"\u002Fen\u002Fpptx\u002Fimages","en\u002F05.pptx\u002F05.images",{"title":54,"path":199,"stem":200},"\u002Fen\u002Fpptx\u002Fcharts","en\u002F05.pptx\u002F06.charts",{"title":125,"path":202,"stem":203},"\u002Fen\u002Fpptx\u002Fsmartart","en\u002F05.pptx\u002F07.smartart",{"title":129,"path":205,"stem":206},"\u002Fen\u002Fpptx\u002Fmedia","en\u002F05.pptx\u002F08.media",{"title":133,"path":208,"stem":209},"\u002Fen\u002Fpptx\u002Flinks","en\u002F05.pptx\u002F09.links",{"title":211,"path":212,"stem":213},"Lines and Connectors","\u002Fen\u002Fpptx\u002Flines-and-connectors","en\u002F05.pptx\u002F10.lines-and-connectors",{"title":137,"path":215,"stem":216},"\u002Fen\u002Fpptx\u002Fheaders-and-footers","en\u002F05.pptx\u002F11.headers-and-footers",{"title":141,"path":218,"stem":219},"\u002Fen\u002Fpptx\u002Fequations-and-symbols","en\u002F05.pptx\u002F12.equations-and-symbols",{"title":221,"path":222,"stem":223},"Slide Layout","\u002Fen\u002Fpptx\u002Fslide-layout","en\u002F05.pptx\u002F13.slide-layout",{"title":145,"path":225,"stem":226},"\u002Fen\u002Fpptx\u002Fstyles-and-themes","en\u002F05.pptx\u002F14.styles-and-themes",{"title":228,"path":229,"stem":230},"Effects and Fills","\u002Fen\u002Fpptx\u002Feffects-and-fills","en\u002F05.pptx\u002F15.effects-and-fills",{"title":232,"path":233,"stem":234},"Transitions","\u002Fen\u002Fpptx\u002Ftransitions","en\u002F05.pptx\u002F16.transitions",{"title":236,"path":237,"stem":238},"Animations","\u002Fen\u002Fpptx\u002Fanimations","en\u002F05.pptx\u002F17.animations",{"title":240,"path":241,"stem":242},"Comments","\u002Fen\u002Fpptx\u002Fcomments","en\u002F05.pptx\u002F18.comments",{"title":244,"path":245,"stem":246},"Presentation Properties","\u002Fen\u002Fpptx\u002Fproperties","en\u002F05.pptx\u002F19.properties",{"title":165,"path":248,"stem":249},"\u002Fen\u002Fpptx\u002Fexport","en\u002F05.pptx\u002F20.export",{"title":72,"path":251,"stem":252},"\u002Fen\u002Fpptx\u002Fparsing","en\u002F05.pptx\u002F21.parsing",{"title":172,"path":254,"stem":255},"\u002Fen\u002Fpptx\u002Fpatch","en\u002F05.pptx\u002F22.patch",{"title":257,"icon":258,"path":259,"stem":260,"children":261,"page":30},"XLSX","i-lucide-table-2","\u002Fen\u002Fxlsx","en\u002F06.xlsx",[262,266,269,273,277,281,285,289,292,295,299,303,307,311,314,318,322,326,329,332],{"title":263,"path":264,"stem":265},"@office-open\u002Fxlsx","\u002Fen\u002Fxlsx\u002Foverview","en\u002F06.xlsx\u002F01.overview",{"title":102,"path":267,"stem":268},"\u002Fen\u002Fxlsx\u002Fquickstart","en\u002F06.xlsx\u002F02.quickstart",{"title":270,"path":271,"stem":272},"Cells & Data","\u002Fen\u002Fxlsx\u002Fcells","en\u002F06.xlsx\u002F03.cells",{"title":274,"path":275,"stem":276},"Styles","\u002Fen\u002Fxlsx\u002Fstyles","en\u002F06.xlsx\u002F04.styles",{"title":278,"path":279,"stem":280},"Merge, Columns & Rows","\u002Fen\u002Fxlsx\u002Fmerge-col-row","en\u002F06.xlsx\u002F05.merge-col-row",{"title":282,"path":283,"stem":284},"Hyperlinks","\u002Fen\u002Fxlsx\u002Flinks","en\u002F06.xlsx\u002F06.links",{"title":286,"path":287,"stem":288},"Pivot Tables","\u002Fen\u002Fxlsx\u002Fpivot-tables","en\u002F06.xlsx\u002F07.pivot-tables",{"title":114,"path":290,"stem":291},"\u002Fen\u002Fxlsx\u002Fimages","en\u002F06.xlsx\u002F08.images",{"title":54,"path":293,"stem":294},"\u002Fen\u002Fxlsx\u002Fcharts","en\u002F06.xlsx\u002F09.charts",{"title":296,"path":297,"stem":298},"Page Setup & Headers\u002FFooters","\u002Fen\u002Fxlsx\u002Fpage-setup","en\u002F06.xlsx\u002F10.page-setup",{"title":300,"path":301,"stem":302},"Formulas","\u002Fen\u002Fxlsx\u002Fformulas","en\u002F06.xlsx\u002F11.formulas",{"title":304,"path":305,"stem":306},"Freeze Panes & Auto Filter","\u002Fen\u002Fxlsx\u002Ffreeze-filter","en\u002F06.xlsx\u002F12.freeze-filter",{"title":308,"path":309,"stem":310},"Data Validation","\u002Fen\u002Fxlsx\u002Fvalidation","en\u002F06.xlsx\u002F13.validation",{"title":240,"path":312,"stem":313},"\u002Fen\u002Fxlsx\u002Fcomments","en\u002F06.xlsx\u002F14.comments",{"title":315,"path":316,"stem":317},"Protection","\u002Fen\u002Fxlsx\u002Fprotection","en\u002F06.xlsx\u002F15.protection",{"title":319,"path":320,"stem":321},"Shared Workbook Revisions","\u002Fen\u002Fxlsx\u002Frevisions","en\u002F06.xlsx\u002F16.revisions",{"title":323,"path":324,"stem":325},"Workbook Properties","\u002Fen\u002Fxlsx\u002Fproperties","en\u002F06.xlsx\u002F17.properties",{"title":165,"path":327,"stem":328},"\u002Fen\u002Fxlsx\u002Fexport","en\u002F06.xlsx\u002F18.export",{"title":72,"path":330,"stem":331},"\u002Fen\u002Fxlsx\u002Fparsing","en\u002F06.xlsx\u002F19.parsing",{"title":172,"path":333,"stem":334},"\u002Fen\u002Fxlsx\u002Fpatch","en\u002F06.xlsx\u002F20.patch",{"id":336,"title":80,"body":337,"description":1723,"extension":1724,"links":1725,"meta":1726,"navigation":421,"path":81,"seo":1727,"stem":82,"__hash__":1728},"docs_en\u002Fen\u002F03.xml\u002F04.query-utilities.md",{"type":338,"value":339,"toc":1697},"minimark",[340,353,358,363,366,482,485,488,575,579,582,628,632,636,639,728,732,735,808,812,815,864,868,871,874,983,987,990,1016,1020,1023,1050,1054,1072,1147,1151,1154,1206,1210,1214,1217,1270,1274,1277,1333,1337,1344,1399,1403,1406,1447,1451,1693],[341,342,343,344,348,349,352],"p",{},"After parsing XML with ",[345,346,347],"code",{},"parse()",", use these utilities to traverse and extract data from the ",[345,350,351],{},"Element"," tree.",[354,355,357],"h2",{"id":356},"finding-children","Finding Children",[359,360,362],"h3",{"id":361},"findchild","findChild",[341,364,365],{},"Find the first direct child by tag name:",[367,368,373],"pre",{"className":369,"code":370,"language":371,"meta":372,"style":372},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { parse, findChild } from \"@office-open\u002Fxml\";\n\nconst root = parse(\"\u003Cw:p>\u003Cw:r>\u003Cw:t>Hello\u003C\u002Fw:t>\u003C\u002Fw:r>\u003C\u002Fw:p>\");\nconst run = findChild(root, \"w:r\");\n","ts","",[345,374,375,416,423,454],{"__ignoreMap":372},[376,377,380,384,388,392,395,398,401,404,407,410,413],"span",{"class":378,"line":379},"line",1,[376,381,383],{"class":382},"s7zQu","import",[376,385,387],{"class":386},"sMK4o"," {",[376,389,391],{"class":390},"sTEyZ"," parse",[376,393,394],{"class":386},",",[376,396,397],{"class":390}," findChild",[376,399,400],{"class":386}," }",[376,402,403],{"class":382}," from",[376,405,406],{"class":386}," \"",[376,408,68],{"class":409},"sfazB",[376,411,412],{"class":386},"\"",[376,414,415],{"class":386},";\n",[376,417,419],{"class":378,"line":418},2,[376,420,422],{"emptyLinePlaceholder":421},true,"\n",[376,424,426,430,433,436,439,442,444,447,449,452],{"class":378,"line":425},3,[376,427,429],{"class":428},"spNyl","const",[376,431,432],{"class":390}," root ",[376,434,435],{"class":386},"=",[376,437,391],{"class":438},"s2Zo4",[376,440,441],{"class":390},"(",[376,443,412],{"class":386},[376,445,446],{"class":409},"\u003Cw:p>\u003Cw:r>\u003Cw:t>Hello\u003C\u002Fw:t>\u003C\u002Fw:r>\u003C\u002Fw:p>",[376,448,412],{"class":386},[376,450,451],{"class":390},")",[376,453,415],{"class":386},[376,455,457,459,462,464,466,469,471,473,476,478,480],{"class":378,"line":456},4,[376,458,429],{"class":428},[376,460,461],{"class":390}," run ",[376,463,435],{"class":386},[376,465,397],{"class":438},[376,467,468],{"class":390},"(root",[376,470,394],{"class":386},[376,472,406],{"class":386},[376,474,475],{"class":409},"w:r",[376,477,412],{"class":386},[376,479,451],{"class":390},[376,481,415],{"class":386},[359,483,484],{"id":484},"children",[341,486,487],{},"Get all direct children matching a tag name:",[367,489,491],{"className":369,"code":490,"language":371,"meta":372,"style":372},"import { parse, children } from \"@office-open\u002Fxml\";\n\nconst root = parse(\"\u003Cw:p>\u003Cw:r\u002F>\u003Cw:r\u002F>\u003Cw:r\u002F>\u003C\u002Fw:p>\");\nconst runs = children(root, \"w:r\"); \u002F\u002F 3 elements\n",[345,492,493,518,522,545],{"__ignoreMap":372},[376,494,495,497,499,501,503,506,508,510,512,514,516],{"class":378,"line":379},[376,496,383],{"class":382},[376,498,387],{"class":386},[376,500,391],{"class":390},[376,502,394],{"class":386},[376,504,505],{"class":390}," children",[376,507,400],{"class":386},[376,509,403],{"class":382},[376,511,406],{"class":386},[376,513,68],{"class":409},[376,515,412],{"class":386},[376,517,415],{"class":386},[376,519,520],{"class":378,"line":418},[376,521,422],{"emptyLinePlaceholder":421},[376,523,524,526,528,530,532,534,536,539,541,543],{"class":378,"line":425},[376,525,429],{"class":428},[376,527,432],{"class":390},[376,529,435],{"class":386},[376,531,391],{"class":438},[376,533,441],{"class":390},[376,535,412],{"class":386},[376,537,538],{"class":409},"\u003Cw:p>\u003Cw:r\u002F>\u003Cw:r\u002F>\u003Cw:r\u002F>\u003C\u002Fw:p>",[376,540,412],{"class":386},[376,542,451],{"class":390},[376,544,415],{"class":386},[376,546,547,549,552,554,556,558,560,562,564,566,568,571],{"class":378,"line":456},[376,548,429],{"class":428},[376,550,551],{"class":390}," runs ",[376,553,435],{"class":386},[376,555,505],{"class":438},[376,557,468],{"class":390},[376,559,394],{"class":386},[376,561,406],{"class":386},[376,563,475],{"class":409},[376,565,412],{"class":386},[376,567,451],{"class":390},[376,569,570],{"class":386},";",[376,572,574],{"class":573},"sHwdD"," \u002F\u002F 3 elements\n",[359,576,578],{"id":577},"allchildren","allChildren",[341,580,581],{},"Get all direct children regardless of tag name:",[367,583,585],{"className":369,"code":584,"language":371,"meta":372,"style":372},"import { allChildren } from \"@office-open\u002Fxml\";\n\nconst all = allChildren(root);\n",[345,586,587,608,612],{"__ignoreMap":372},[376,588,589,591,593,596,598,600,602,604,606],{"class":378,"line":379},[376,590,383],{"class":382},[376,592,387],{"class":386},[376,594,595],{"class":390}," allChildren",[376,597,400],{"class":386},[376,599,403],{"class":382},[376,601,406],{"class":386},[376,603,68],{"class":409},[376,605,412],{"class":386},[376,607,415],{"class":386},[376,609,610],{"class":378,"line":418},[376,611,422],{"emptyLinePlaceholder":421},[376,613,614,616,619,621,623,626],{"class":378,"line":425},[376,615,429],{"class":428},[376,617,618],{"class":390}," all ",[376,620,435],{"class":386},[376,622,595],{"class":438},[376,624,625],{"class":390},"(root)",[376,627,415],{"class":386},[354,629,631],{"id":630},"reading-text","Reading Text",[359,633,635],{"id":634},"childtext","childText",[341,637,638],{},"Get text content of the first matching child:",[367,640,642],{"className":369,"code":641,"language":371,"meta":372,"style":372},"import { parse, findChild, childText } from \"@office-open\u002Fxml\";\n\nconst root = parse(\"\u003Cw:p>\u003Cw:r>\u003Cw:t>Hello\u003C\u002Fw:t>\u003C\u002Fw:r>\u003C\u002Fw:p>\");\nconst text = childText(root, \"w:t\"); \u002F\u002F \"Hello\"\n",[345,643,644,673,677,699],{"__ignoreMap":372},[376,645,646,648,650,652,654,656,658,661,663,665,667,669,671],{"class":378,"line":379},[376,647,383],{"class":382},[376,649,387],{"class":386},[376,651,391],{"class":390},[376,653,394],{"class":386},[376,655,397],{"class":390},[376,657,394],{"class":386},[376,659,660],{"class":390}," childText",[376,662,400],{"class":386},[376,664,403],{"class":382},[376,666,406],{"class":386},[376,668,68],{"class":409},[376,670,412],{"class":386},[376,672,415],{"class":386},[376,674,675],{"class":378,"line":418},[376,676,422],{"emptyLinePlaceholder":421},[376,678,679,681,683,685,687,689,691,693,695,697],{"class":378,"line":425},[376,680,429],{"class":428},[376,682,432],{"class":390},[376,684,435],{"class":386},[376,686,391],{"class":438},[376,688,441],{"class":390},[376,690,412],{"class":386},[376,692,446],{"class":409},[376,694,412],{"class":386},[376,696,451],{"class":390},[376,698,415],{"class":386},[376,700,701,703,706,708,710,712,714,716,719,721,723,725],{"class":378,"line":456},[376,702,429],{"class":428},[376,704,705],{"class":390}," text ",[376,707,435],{"class":386},[376,709,660],{"class":438},[376,711,468],{"class":390},[376,713,394],{"class":386},[376,715,406],{"class":386},[376,717,718],{"class":409},"w:t",[376,720,412],{"class":386},[376,722,451],{"class":390},[376,724,570],{"class":386},[376,726,727],{"class":573}," \u002F\u002F \"Hello\"\n",[359,729,731],{"id":730},"textof","textOf",[341,733,734],{},"Get text content of an element itself:",[367,736,738],{"className":369,"code":737,"language":371,"meta":372,"style":372},"import { textOf } from \"@office-open\u002Fxml\";\n\nconst textEl = findChild(run, \"w:t\");\nconst text = textOf(textEl); \u002F\u002F \"Hello\"\n",[345,739,740,761,765,791],{"__ignoreMap":372},[376,741,742,744,746,749,751,753,755,757,759],{"class":378,"line":379},[376,743,383],{"class":382},[376,745,387],{"class":386},[376,747,748],{"class":390}," textOf",[376,750,400],{"class":386},[376,752,403],{"class":382},[376,754,406],{"class":386},[376,756,68],{"class":409},[376,758,412],{"class":386},[376,760,415],{"class":386},[376,762,763],{"class":378,"line":418},[376,764,422],{"emptyLinePlaceholder":421},[376,766,767,769,772,774,776,779,781,783,785,787,789],{"class":378,"line":425},[376,768,429],{"class":428},[376,770,771],{"class":390}," textEl ",[376,773,435],{"class":386},[376,775,397],{"class":438},[376,777,778],{"class":390},"(run",[376,780,394],{"class":386},[376,782,406],{"class":386},[376,784,718],{"class":409},[376,786,412],{"class":386},[376,788,451],{"class":390},[376,790,415],{"class":386},[376,792,793,795,797,799,801,804,806],{"class":378,"line":456},[376,794,429],{"class":428},[376,796,705],{"class":390},[376,798,435],{"class":386},[376,800,748],{"class":438},[376,802,803],{"class":390},"(textEl)",[376,805,570],{"class":386},[376,807,727],{"class":573},[359,809,811],{"id":810},"collecttext","collectText",[341,813,814],{},"Collect text from all text nodes in an element and its descendants:",[367,816,818],{"className":369,"code":817,"language":371,"meta":372,"style":372},"import { collectText } from \"@office-open\u002Fxml\";\n\nconst allText = collectText(paragraph); \u002F\u002F Concatenated text content\n",[345,819,820,841,845],{"__ignoreMap":372},[376,821,822,824,826,829,831,833,835,837,839],{"class":378,"line":379},[376,823,383],{"class":382},[376,825,387],{"class":386},[376,827,828],{"class":390}," collectText",[376,830,400],{"class":386},[376,832,403],{"class":382},[376,834,406],{"class":386},[376,836,68],{"class":409},[376,838,412],{"class":386},[376,840,415],{"class":386},[376,842,843],{"class":378,"line":418},[376,844,422],{"emptyLinePlaceholder":421},[376,846,847,849,852,854,856,859,861],{"class":378,"line":425},[376,848,429],{"class":428},[376,850,851],{"class":390}," allText ",[376,853,435],{"class":386},[376,855,828],{"class":438},[376,857,858],{"class":390},"(paragraph)",[376,860,570],{"class":386},[376,862,863],{"class":573}," \u002F\u002F Concatenated text content\n",[354,865,867],{"id":866},"reading-attributes","Reading Attributes",[359,869,870],{"id":870},"attr",[341,872,873],{},"Get attribute value as string:",[367,875,877],{"className":369,"code":876,"language":371,"meta":372,"style":372},"import { parse, findChild, attr } from \"@office-open\u002Fxml\";\n\nconst element = parse('\u003Cw:spacing w:before=\"240\" w:after=\"120\"\u002F>');\nattr(element, \"w:before\"); \u002F\u002F \"240\"\nattr(element, \"w:after\"); \u002F\u002F \"120\"\n",[345,878,879,908,912,937,960],{"__ignoreMap":372},[376,880,881,883,885,887,889,891,893,896,898,900,902,904,906],{"class":378,"line":379},[376,882,383],{"class":382},[376,884,387],{"class":386},[376,886,391],{"class":390},[376,888,394],{"class":386},[376,890,397],{"class":390},[376,892,394],{"class":386},[376,894,895],{"class":390}," attr",[376,897,400],{"class":386},[376,899,403],{"class":382},[376,901,406],{"class":386},[376,903,68],{"class":409},[376,905,412],{"class":386},[376,907,415],{"class":386},[376,909,910],{"class":378,"line":418},[376,911,422],{"emptyLinePlaceholder":421},[376,913,914,916,919,921,923,925,928,931,933,935],{"class":378,"line":425},[376,915,429],{"class":428},[376,917,918],{"class":390}," element ",[376,920,435],{"class":386},[376,922,391],{"class":438},[376,924,441],{"class":390},[376,926,927],{"class":386},"'",[376,929,930],{"class":409},"\u003Cw:spacing w:before=\"240\" w:after=\"120\"\u002F>",[376,932,927],{"class":386},[376,934,451],{"class":390},[376,936,415],{"class":386},[376,938,939,941,944,946,948,951,953,955,957],{"class":378,"line":456},[376,940,870],{"class":438},[376,942,943],{"class":390},"(element",[376,945,394],{"class":386},[376,947,406],{"class":386},[376,949,950],{"class":409},"w:before",[376,952,412],{"class":386},[376,954,451],{"class":390},[376,956,570],{"class":386},[376,958,959],{"class":573}," \u002F\u002F \"240\"\n",[376,961,963,965,967,969,971,974,976,978,980],{"class":378,"line":962},5,[376,964,870],{"class":438},[376,966,943],{"class":390},[376,968,394],{"class":386},[376,970,406],{"class":386},[376,972,973],{"class":409},"w:after",[376,975,412],{"class":386},[376,977,451],{"class":390},[376,979,570],{"class":386},[376,981,982],{"class":573}," \u002F\u002F \"120\"\n",[359,984,986],{"id":985},"attrnum","attrNum",[341,988,989],{},"Get attribute value as number:",[367,991,993],{"className":369,"code":992,"language":371,"meta":372,"style":372},"attrNum(element, \"w:before\"); \u002F\u002F 240\n",[345,994,995],{"__ignoreMap":372},[376,996,997,999,1001,1003,1005,1007,1009,1011,1013],{"class":378,"line":379},[376,998,986],{"class":438},[376,1000,943],{"class":390},[376,1002,394],{"class":386},[376,1004,406],{"class":386},[376,1006,950],{"class":409},[376,1008,412],{"class":386},[376,1010,451],{"class":390},[376,1012,570],{"class":386},[376,1014,1015],{"class":573}," \u002F\u002F 240\n",[359,1017,1019],{"id":1018},"attrbool","attrBool",[341,1021,1022],{},"Get attribute value as boolean:",[367,1024,1026],{"className":369,"code":1025,"language":371,"meta":372,"style":372},"attrBool(element, \"w:val\"); \u002F\u002F true or false based on \"true\"\u002F\"1\"\u002F\"false\"\u002F\"0\"\n",[345,1027,1028],{"__ignoreMap":372},[376,1029,1030,1032,1034,1036,1038,1041,1043,1045,1047],{"class":378,"line":379},[376,1031,1019],{"class":438},[376,1033,943],{"class":390},[376,1035,394],{"class":386},[376,1037,406],{"class":386},[376,1039,1040],{"class":409},"w:val",[376,1042,412],{"class":386},[376,1044,451],{"class":390},[376,1046,570],{"class":386},[376,1048,1049],{"class":573}," \u002F\u002F true or false based on \"true\"\u002F\"1\"\u002F\"false\"\u002F\"0\"\n",[359,1051,1053],{"id":1052},"attrmeasure","attrMeasure",[341,1055,1056,1057,1060,1061,1060,1064,1067,1068,1071],{},"Get a measure attribute as a number (plain numeric token) or keep the UniversalMeasure\u002Fpercentage string verbatim (",[345,1058,1059],{},"ST_TwipsMeasure",", ",[345,1062,1063],{},"ST_MeasurementOrPercent",[345,1065,1066],{},"CT_TblWidth\u002F@w","). Table-width percentage fiftieths (5000 = 100%) are converted to a user-facing percentage in the docx layer (",[345,1069,1070],{},"widthFiftiethsToPct","), not here:",[367,1073,1075],{"className":369,"code":1074,"language":371,"meta":372,"style":372},"import { attrMeasure } from \"@office-open\u002Fxml\";\n\nattrMeasure(spacing, \"w:before\"); \u002F\u002F 240 (number) for a plain token\nattrMeasure(width, \"w:w\"); \u002F\u002F 5000 (number) — docx converts fiftieths to 100%\n",[345,1076,1077,1098,1102,1124],{"__ignoreMap":372},[376,1078,1079,1081,1083,1086,1088,1090,1092,1094,1096],{"class":378,"line":379},[376,1080,383],{"class":382},[376,1082,387],{"class":386},[376,1084,1085],{"class":390}," attrMeasure",[376,1087,400],{"class":386},[376,1089,403],{"class":382},[376,1091,406],{"class":386},[376,1093,68],{"class":409},[376,1095,412],{"class":386},[376,1097,415],{"class":386},[376,1099,1100],{"class":378,"line":418},[376,1101,422],{"emptyLinePlaceholder":421},[376,1103,1104,1106,1109,1111,1113,1115,1117,1119,1121],{"class":378,"line":425},[376,1105,1053],{"class":438},[376,1107,1108],{"class":390},"(spacing",[376,1110,394],{"class":386},[376,1112,406],{"class":386},[376,1114,950],{"class":409},[376,1116,412],{"class":386},[376,1118,451],{"class":390},[376,1120,570],{"class":386},[376,1122,1123],{"class":573}," \u002F\u002F 240 (number) for a plain token\n",[376,1125,1126,1128,1131,1133,1135,1138,1140,1142,1144],{"class":378,"line":456},[376,1127,1053],{"class":438},[376,1129,1130],{"class":390},"(width",[376,1132,394],{"class":386},[376,1134,406],{"class":386},[376,1136,1137],{"class":409},"w:w",[376,1139,412],{"class":386},[376,1141,451],{"class":390},[376,1143,570],{"class":386},[376,1145,1146],{"class":573}," \u002F\u002F 5000 (number) — docx converts fiftieths to 100%\n",[359,1148,1150],{"id":1149},"colorattr","colorAttr",[341,1152,1153],{},"Get hex color attribute with normalization:",[367,1155,1157],{"className":369,"code":1156,"language":371,"meta":372,"style":372},"import { colorAttr } from \"@office-open\u002Fxml\";\n\ncolorAttr(element, \"w:color\"); \u002F\u002F \"FF0000\"\n",[345,1158,1159,1180,1184],{"__ignoreMap":372},[376,1160,1161,1163,1165,1168,1170,1172,1174,1176,1178],{"class":378,"line":379},[376,1162,383],{"class":382},[376,1164,387],{"class":386},[376,1166,1167],{"class":390}," colorAttr",[376,1169,400],{"class":386},[376,1171,403],{"class":382},[376,1173,406],{"class":386},[376,1175,68],{"class":409},[376,1177,412],{"class":386},[376,1179,415],{"class":386},[376,1181,1182],{"class":378,"line":418},[376,1183,422],{"emptyLinePlaceholder":421},[376,1185,1186,1188,1190,1192,1194,1197,1199,1201,1203],{"class":378,"line":425},[376,1187,1150],{"class":438},[376,1189,943],{"class":390},[376,1191,394],{"class":386},[376,1193,406],{"class":386},[376,1195,1196],{"class":409},"w:color",[376,1198,412],{"class":386},[376,1200,451],{"class":390},[376,1202,570],{"class":386},[376,1204,1205],{"class":573}," \u002F\u002F \"FF0000\"\n",[354,1207,1209],{"id":1208},"checking-structure","Checking Structure",[359,1211,1213],{"id":1212},"haschild","hasChild",[341,1215,1216],{},"Check if an element has a specific child:",[367,1218,1220],{"className":369,"code":1219,"language":371,"meta":372,"style":372},"import { hasChild } from \"@office-open\u002Fxml\";\n\nhasChild(paragraph, \"w:pPr\"); \u002F\u002F true or false\n",[345,1221,1222,1243,1247],{"__ignoreMap":372},[376,1223,1224,1226,1228,1231,1233,1235,1237,1239,1241],{"class":378,"line":379},[376,1225,383],{"class":382},[376,1227,387],{"class":386},[376,1229,1230],{"class":390}," hasChild",[376,1232,400],{"class":386},[376,1234,403],{"class":382},[376,1236,406],{"class":386},[376,1238,68],{"class":409},[376,1240,412],{"class":386},[376,1242,415],{"class":386},[376,1244,1245],{"class":378,"line":418},[376,1246,422],{"emptyLinePlaceholder":421},[376,1248,1249,1251,1254,1256,1258,1261,1263,1265,1267],{"class":378,"line":425},[376,1250,1213],{"class":438},[376,1252,1253],{"class":390},"(paragraph",[376,1255,394],{"class":386},[376,1257,406],{"class":386},[376,1259,1260],{"class":409},"w:pPr",[376,1262,412],{"class":386},[376,1264,451],{"class":390},[376,1266,570],{"class":386},[376,1268,1269],{"class":573}," \u002F\u002F true or false\n",[359,1271,1273],{"id":1272},"finddeep","findDeep",[341,1275,1276],{},"Find all descendant elements matching a tag name:",[367,1278,1280],{"className":369,"code":1279,"language":371,"meta":372,"style":372},"import { findDeep } from \"@office-open\u002Fxml\";\n\nconst allTextNodes = findDeep(document, \"w:t\");\n",[345,1281,1282,1303,1307],{"__ignoreMap":372},[376,1283,1284,1286,1288,1291,1293,1295,1297,1299,1301],{"class":378,"line":379},[376,1285,383],{"class":382},[376,1287,387],{"class":386},[376,1289,1290],{"class":390}," findDeep",[376,1292,400],{"class":386},[376,1294,403],{"class":382},[376,1296,406],{"class":386},[376,1298,68],{"class":409},[376,1300,412],{"class":386},[376,1302,415],{"class":386},[376,1304,1305],{"class":378,"line":418},[376,1306,422],{"emptyLinePlaceholder":421},[376,1308,1309,1311,1314,1316,1318,1321,1323,1325,1327,1329,1331],{"class":378,"line":425},[376,1310,429],{"class":428},[376,1312,1313],{"class":390}," allTextNodes ",[376,1315,435],{"class":386},[376,1317,1290],{"class":438},[376,1319,1320],{"class":390},"(document",[376,1322,394],{"class":386},[376,1324,406],{"class":386},[376,1326,718],{"class":409},[376,1328,412],{"class":386},[376,1330,451],{"class":390},[376,1332,415],{"class":386},[359,1334,1336],{"id":1335},"findfirst","findFirst",[341,1338,1339,1340,1343],{},"Find the first descendant matching a tag name, short-circuiting at the first match (depth-first pre-order). Prefer this over ",[345,1341,1342],{},"findDeep(parent, name)[0]"," to avoid traversing the whole subtree and allocating the full results array:",[367,1345,1347],{"className":369,"code":1346,"language":371,"meta":372,"style":372},"import { findFirst } from \"@office-open\u002Fxml\";\n\nconst firstT = findFirst(document, \"w:t\");\n",[345,1348,1349,1370,1374],{"__ignoreMap":372},[376,1350,1351,1353,1355,1358,1360,1362,1364,1366,1368],{"class":378,"line":379},[376,1352,383],{"class":382},[376,1354,387],{"class":386},[376,1356,1357],{"class":390}," findFirst",[376,1359,400],{"class":386},[376,1361,403],{"class":382},[376,1363,406],{"class":386},[376,1365,68],{"class":409},[376,1367,412],{"class":386},[376,1369,415],{"class":386},[376,1371,1372],{"class":378,"line":418},[376,1373,422],{"emptyLinePlaceholder":421},[376,1375,1376,1378,1381,1383,1385,1387,1389,1391,1393,1395,1397],{"class":378,"line":425},[376,1377,429],{"class":428},[376,1379,1380],{"class":390}," firstT ",[376,1382,435],{"class":386},[376,1384,1357],{"class":438},[376,1386,1320],{"class":390},[376,1388,394],{"class":386},[376,1390,406],{"class":386},[376,1392,718],{"class":409},[376,1394,412],{"class":386},[376,1396,451],{"class":390},[376,1398,415],{"class":386},[359,1400,1402],{"id":1401},"childcount","childCount",[341,1404,1405],{},"Get the number of direct child elements:",[367,1407,1409],{"className":369,"code":1408,"language":371,"meta":372,"style":372},"import { childCount } from \"@office-open\u002Fxml\";\n\nchildCount(paragraph); \u002F\u002F 3\n",[345,1410,1411,1432,1436],{"__ignoreMap":372},[376,1412,1413,1415,1417,1420,1422,1424,1426,1428,1430],{"class":378,"line":379},[376,1414,383],{"class":382},[376,1416,387],{"class":386},[376,1418,1419],{"class":390}," childCount",[376,1421,400],{"class":386},[376,1423,403],{"class":382},[376,1425,406],{"class":386},[376,1427,68],{"class":409},[376,1429,412],{"class":386},[376,1431,415],{"class":386},[376,1433,1434],{"class":378,"line":418},[376,1435,422],{"emptyLinePlaceholder":421},[376,1437,1438,1440,1442,1444],{"class":378,"line":425},[376,1439,1402],{"class":438},[376,1441,858],{"class":390},[376,1443,570],{"class":386},[376,1445,1446],{"class":573}," \u002F\u002F 3\n",[354,1448,1450],{"id":1449},"complete-reference","Complete Reference",[1452,1453,1454,1470],"table",{},[1455,1456,1457],"thead",{},[1458,1459,1460,1464,1467],"tr",{},[1461,1462,1463],"th",{},"Function",[1461,1465,1466],{},"Returns",[1461,1468,1469],{},"Description",[1471,1472,1473,1489,1504,1518,1533,1547,1561,1576,1591,1606,1621,1635,1650,1664,1678],"tbody",{},[1458,1474,1475,1481,1486],{},[1476,1477,1478],"td",{},[345,1479,1480],{},"findChild(parent, name)",[1476,1482,1483],{},[345,1484,1485],{},"Element | undefined",[1476,1487,1488],{},"First direct child by name",[1458,1490,1491,1496,1501],{},[1476,1492,1493],{},[345,1494,1495],{},"children(parent, name)",[1476,1497,1498],{},[345,1499,1500],{},"Element[]",[1476,1502,1503],{},"All direct children by name",[1458,1505,1506,1511,1515],{},[1476,1507,1508],{},[345,1509,1510],{},"allChildren(parent)",[1476,1512,1513],{},[345,1514,1500],{},[1476,1516,1517],{},"All direct children",[1458,1519,1520,1525,1530],{},[1476,1521,1522],{},[345,1523,1524],{},"childText(parent, name)",[1476,1526,1527],{},[345,1528,1529],{},"string",[1476,1531,1532],{},"Text of first matching child",[1458,1534,1535,1540,1544],{},[1476,1536,1537],{},[345,1538,1539],{},"textOf(element)",[1476,1541,1542],{},[345,1543,1529],{},[1476,1545,1546],{},"Text content of element",[1458,1548,1549,1554,1558],{},[1476,1550,1551],{},[345,1552,1553],{},"collectText(element)",[1476,1555,1556],{},[345,1557,1529],{},[1476,1559,1560],{},"All text from descendants",[1458,1562,1563,1568,1573],{},[1476,1564,1565],{},[345,1566,1567],{},"attr(element, name)",[1476,1569,1570],{},[345,1571,1572],{},"string | undefined",[1476,1574,1575],{},"Attribute as string",[1458,1577,1578,1583,1588],{},[1476,1579,1580],{},[345,1581,1582],{},"attrNum(element, name)",[1476,1584,1585],{},[345,1586,1587],{},"number | undefined",[1476,1589,1590],{},"Attribute as number",[1458,1592,1593,1598,1603],{},[1476,1594,1595],{},[345,1596,1597],{},"attrMeasure(element, name)",[1476,1599,1600],{},[345,1601,1602],{},"number | string | undefined",[1476,1604,1605],{},"Measure attribute (keeps units)",[1458,1607,1608,1613,1618],{},[1476,1609,1610],{},[345,1611,1612],{},"attrBool(element, name)",[1476,1614,1615],{},[345,1616,1617],{},"boolean | undefined",[1476,1619,1620],{},"Attribute as boolean",[1458,1622,1623,1628,1632],{},[1476,1624,1625],{},[345,1626,1627],{},"colorAttr(element, name)",[1476,1629,1630],{},[345,1631,1572],{},[1476,1633,1634],{},"Hex color attribute",[1458,1636,1637,1642,1647],{},[1476,1638,1639],{},[345,1640,1641],{},"hasChild(parent, name)",[1476,1643,1644],{},[345,1645,1646],{},"boolean",[1476,1648,1649],{},"Child exists check",[1458,1651,1652,1657,1661],{},[1476,1653,1654],{},[345,1655,1656],{},"findDeep(parent, name)",[1476,1658,1659],{},[345,1660,1500],{},[1476,1662,1663],{},"All descendants by name",[1458,1665,1666,1671,1675],{},[1476,1667,1668],{},[345,1669,1670],{},"findFirst(parent, name)",[1476,1672,1673],{},[345,1674,1485],{},[1476,1676,1677],{},"First descendant (short-circuit)",[1458,1679,1680,1685,1690],{},[1476,1681,1682],{},[345,1683,1684],{},"childCount(parent)",[1476,1686,1687],{},[345,1688,1689],{},"number",[1476,1691,1692],{},"Direct child count",[1694,1695,1696],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":372,"searchDepth":418,"depth":418,"links":1698},[1699,1704,1709,1716,1722],{"id":356,"depth":418,"text":357,"children":1700},[1701,1702,1703],{"id":361,"depth":425,"text":362},{"id":484,"depth":425,"text":484},{"id":577,"depth":425,"text":578},{"id":630,"depth":418,"text":631,"children":1705},[1706,1707,1708],{"id":634,"depth":425,"text":635},{"id":730,"depth":425,"text":731},{"id":810,"depth":425,"text":811},{"id":866,"depth":418,"text":867,"children":1710},[1711,1712,1713,1714,1715],{"id":870,"depth":425,"text":870},{"id":985,"depth":425,"text":986},{"id":1018,"depth":425,"text":1019},{"id":1052,"depth":425,"text":1053},{"id":1149,"depth":425,"text":1150},{"id":1208,"depth":418,"text":1209,"children":1717},[1718,1719,1720,1721],{"id":1212,"depth":425,"text":1213},{"id":1272,"depth":425,"text":1273},{"id":1335,"depth":425,"text":1336},{"id":1401,"depth":425,"text":1402},{"id":1449,"depth":418,"text":1450},"Traverse and inspect parsed XML Element trees with helper functions","md",null,{},{"title":80,"description":1723},"ub96Jc3wlFcad9iaR78IH95PRaHB_dw4_wkcBWgftUc",[1730,1732],{"title":76,"path":77,"stem":78,"description":1731,"children":-1},"Convert Element trees back to XML strings with formatting options",{"title":84,"path":85,"stem":86,"description":1733,"children":-1},"Escape and build XML attribute strings safely",1787527404150]