Invalid Xml on CustomDocumentProperty with starting digit

Hi Support.

I have a problem with the Java library “aspose-word”, which can be reproduced with the latest version 24.4.

To reproduce the error, you have to create a Word document with a “CustomDocumentProperty” (see also the attached sample code) whose name begins with a digit (e.g.: “123”).

final Document wordDoc = new Document();
final CustomDocumentProperties customProps = wordDoc.getCustomDocumentProperties();

customProps.add("123", "name with starting digit generates invalid xml");

If you save the created document in WordML format, the result is an invalid Xml.

final SaveOptions format = SaveOptions.createSaveOptions(SaveFormat.WORD_ML);
format.setPrettyFormat(true);
wordDoc.save(outstream, format);

The xml then contains the following fragment:

  <o:CustomDocumentProperties>
        <o:123 dt:dt="string">name with starting digit generates invalid xml</o:123>
  </o:CustomDocumentProperties>

According to the xml specification, the LocalPart of a QualifiedName (here: “123”) must not start with a digit. (“0-9” is not contained in NameStartChar).

https://www.w3.org/TR/2009/REC-xml-names-20091208/#ns-qualnames
https://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-NCName
https://www.w3.org/TR/REC-xml/#NT-NameStartChar

Attachment:
SampleClass.zip (1,0 KB)

Thank you in advance.

@Jarron50
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-26913

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.

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