Skip to content

XML decode error on tbl w:w - ParseInt error #66

@orenben12

Description

@orenben12

Issue Description

Hi, we've been working with some documents generated out of gsuite. When we attempt to process the document, there is a ParseInt error against the number "8830.0". Looking at the document, I note that quite a few are not decimal or int definition.

Steps to Reproduce

  1. Get document - source likely GSuite
  2. Submit to godocx for godocx.OpenDocument
  3. Receive XML unmarshal error in document.go, function UnmarshalXML(decoder *xml.Decoder, start xml.Start), case "body" with "ParseInt": "8830.0" err

Snippet from the document.xml
<w:tblPr><w:tblStyle w:val="Table1"/><w:tblW w:w="8830.0" w:type="dxa"/><w:jc w:val="left"/><w:tblInd w:w="-578.0" w:type="dxa"/><w:tblBorders><w:top w:color="000000" w:space="0" w:sz="4" w:val="single"/><w:left w:color="000000" w:space="0" w:sz="4" w:val="single"/><w:bottom w:color="000000" w:space="0" w:sz="4" w:val="single"/><w:right w:color="000000" w:space="0" w:sz="4" w:val="single"/><w:insideH w:color="000000" w:space="0" w:sz="4" w:val="single"/><w:insideV w:color="000000" w:space="0" w:sz="4" w:val="single"/></w:tblBorders><w:tblLayout w:type="fixed"/><w:tblLook w:val="0000"/></w:tblPr>

Expected Behavior

Not to fire an exception

Actual Behavior

Decoding error: ParseInt 8830.0

Environment Details

  • GoDocx Library Version: latest
  • Go Version: 1.24.1
  • Operating System:
    • Windows
    • macOS
    • Linux
  • Word Processor Used:
    • Microsoft Word
    • LibreOffice
    • Google Docs
    • Other (please specify)
  • Word Processor Version:

Additional Information

According to: w:w spec, it should be a decimal, but isn't. Does it make sense to round it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions