Page 1 of 1

XML Doc Validation Errors

Posted: Tue Jan 05, 2010 6:44 pm
by Jamil
I have an XML document that I edit in Oxygen used by ant. This is a valid XML document, but oXygen shows the following error in the editor and to the right in red for the following attribute:

<javac memoryInitialSize="256M" />

E [Xerces] Attribute "memoryInitialSize" must be declared for element type "javac".

I can avoid seeing this error by turning off the option Editor, Document Checking, Validate as you type. I would rather not turn this off though. Is there a way I can add this attribute to oXygen so that it is not flagged as an error?

Thanks.

Re: XML Doc Validation Errors

Posted: Wed Jan 06, 2010 11:49 am
by Radu
Dear Jamil,

To validate ANT project files Oxygen uses a DTD grammar created by the ANT process. The DTD is located in OXYGEN_INSTALL_DIR\frameworks\ant\ant.dtd.

In that grammar the attribute is defined as memoryinitialsize (notice the all-lowercase). As XML is case sensitive that is why the validation complains.
From what it seems ANT itself does not care if the attribute is specified with lower-upper casing or lower casing.

So you have two options:
1) Modify the attribute name to memoryinitialsize in the project XML file.
2) Open the ant.dtd file from the path specified above, search for all memoryinitialsize occurrences and replace with memoryInitialSize

My recommendation is option number 1.

Regards,
Radu