DateSDT parsing issue (3069)

Hi,

I am writing to you about a problem we encountered in working with MSO Word documents (docx format) using the Aspose Words v23.6 library for Java.

Specifically, in the document, DateSDTs with the content “September 2018” are used in two places (one at the top of the first page, and the other in its footer).

When using the API to access them and read their content, it has the form “September YYYY”. So instead of the year written in numbers - 2018, it returns the format used for the year displayed with four digits - YYYY.

I am enclosing the source document,a screenshot where you can see the right form, as well as the code for proving mentioned issue.

Best regards!

Nenad

report.zip (683.8 KB)

@zpredojevic
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25629

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

You can use StructuredDocumentTag.getFullDate() to get date value of the SDT:

Document document = new Document("C:\\Temp\\in.docx");
Iterable<StructuredDocumentTag> childSdtNodes = document.getChildNodes(NodeType.STRUCTURED_DOCUMENT_TAG, true);
for (StructuredDocumentTag sdt : childSdtNodes)
{
    if (sdt.getSdtType() == SdtType.DATE)
    {
        System.out.println(sdt.getFullDate());
    }
}

The issues you have found earlier (filed as WORDSNET-25629) have been fixed in this Aspose.Words for Java 23.8 update.