XML Doc Validation Errors

Questions about XML that are not covered by the other forums should go here.
Jamil
Posts: 85
Joined: Thu Oct 23, 2008 6:29 am

XML Doc Validation Errors

Post by Jamil » Tue Jan 05, 2010 6:44 pm

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.

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: XML Doc Validation Errors

Post by Radu » Wed Jan 06, 2010 11:49 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply