I am using xslt to read an xml file and then display it in Microsoft Word. I want to implement checkboxes in my XSLT-files, but it doesn’t work.
Currently it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xslt:stylesheet version="1.0"
xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="w14">
<xslt:output method="xml" encoding="UTF-8" indent="yes"/>
<xslt:template name="Checkbox">
<w:sdt>
<w:sdtPr>
<w14:checkbox>
<w14:checked w14:val="0"/>
<w14:checkedState w14:val="2612" w14:font="MS Gothic"/>
<w14:uncheckedState w14:val="2610" w14:font="MS Gothic"/>
</w14:checkbox>
</w:sdtPr>
</w:sdt>
<w:sdtEndPr/>
<w:sdtContent>
<w:r>
<w:rPr>
<w:rFonts w:ascii="MS Gothic" w:eastAsia="MS Gothic" w:hAnsi="MS Gothic" w:hint="eastAsia"/>
</w:rPr>
<w:t>☐</w:t>
</w:r>
</w:sdtContent>
</xslt:template>
…Because this is pretty much what I got when I exported the docx-file to xml.
However when I try to use this, I get an error ‘6102’, which states (roughly translated):
“Elements and attributes are not allowed in restricted namespaces.”
I don’t know what to do…
Thanks!
1