Closed flyingpang closed 2 months ago
@flyingpang docx.oxml.ns.nsmap
is a dict
. So just add the values you need before you call the parser or xpath.
Like:
from docx.oxml.ns import nsmap
nsmap["wpg"] = "http://schemas...."
If there are specific ones you find yourself needing let us know and we can add them.
When I used package to parse textbox in docx file, I found a namespace problem, so I had to redefine all elements that used xpath function (because xpath function couldn't support the incoming nsmap parameter). Could you support more key values for nsmaps or support xpath nsmap parameters.