Forums: Define.xml
As an XML and XML-Schema specialist I can say immediately that this means that the file does not correctly validate against the XML-Schema.
I checked your snippet using a Schema-validator and your construct is perfectly OK.
Also, I could not reproduce your error with P21 3.0.2 Validator. There, using your snippet, I got another error "Missing XML declaration" which is nonsense, as there is no requirement of the XML standard to have an XML-declaration at the beginning of the file (this makes me so sad ...).
The only reason that you get this error that I can imagine is that somehow the validator selects a wrong XML-Schema file (it should validate agains "define2-0-0.xsd"). If it could not find the schema file another error would appear.
It is NEVER necessary to remove unused namespace declarations (such as here the one for "arm"). Leaving them although not used is perfectly valid in XML.
You can of course always contact me by e-mail for further details. I am easy to find ...
Jozef Aerts
I understand that message "Confirm that 'ODM' is allowed in the Define.xml Standard and has the correct namespace(s)." is automatically generated, but this is actually a funny joke.
I think I faced something similar some time ago and fixed it, but do not remember what was the reason. As Jozef wrote, you can try to validate your file against Define-Xml schema and see if it provides additional details.
If you share a minimum example (just with 1 dummy variable and 1 dataset) with this issue, it will be easier to understand what is causing it.
I did receive a the same message while validating define.xml using P21 V3.0. This issue did not occur in previous versions.
The reason it seems, is the file encoding format is "UTF-8 with BOM".
Because of BOM, your file may contain extra byte sequences at the start of the file. The encoding may /may not be visible in Notepad depending on which version of Windows you use and 32/64 bit system. If your notepad does no have "UTF-8 with BOM" encoding(check save as option), then use Notepad++. Menu bar will show what encoding it is using. Change it to UTF-8 and save.
Rerun the validator and check if it recurs. Worked for me.
Thanks,
Saravanan
This is interesting ...
So it finds extra (hidden) characters before the real first XML, which then indeed means that it is not conformant with the XML-Schema.
How was this define.xml created? I ask as I have only seen this behaviour when XML files were created starting from Microsoft Office files (which I consider bad practice anyway).
Using NotePad++ is always a good idea when there are minor or undeclarable issues with XML files. You may also want to use a real XML editor. There are many of them on the market, starting from $100, which is probably about the cost of 1 man-hour in your company, but may save you many hours ...
In some cases, if you understand Define-XML (and if you don't, you should take a course from CDISC), you can quickly repair small issues in the define.xml using NotePad++, instead of over-and-over re-running your software, desperately hoping the issue can be resolved like that.
Also, if the XML header (we call that an "XML processing instruction") states "UTF-8", it does not mean automatically that the characters are really UTF-8 ("Unicode") encoded. Your software really needs to encode the characters as UFT-8. Another reason not to start from MS Office files, although these are nowadays usually UTF-8 encoded, but with many exceptions ...
Jozef Aerts
CDISC Define-XML development team
and CDISC Define-XML trainer
Hi,
I've used P21 (3.0.2) to generate a Define.xml based on our specs and immediately after generating it I try to validate it using P21.
Everything goes well except for this error we have "Cannot find the declaration of element 'ODM' using the namespace(s) found on the element. Confirm that 'ODM' is allowed in the Define.xml Standard and has the correct namespace(s)."
Currently the Define.xml ODM tag has the following declaration:
<ODM xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.cdisc.org/ns/odm/v1.3"
xmlns:def="http://www.cdisc.org/ns/def/v2.0"
xmlns:arm="http://www.cdisc.org/ns/arm/v1.0"
ODMVersion="1.3.2"
FileType="Snapshot"
FileOID="<internal study code>"
CreationDateTime="2019-10-28T11:25:43Z"
SourceSystem="Pinnacle 21 Community"
SourceSystemVersion="3.0.2">
This is automatically generated by P21, we didn't do any updates. We tried to remove some of the namespaces referred (e.g.: arm) but without success.
Thank you in advance for any insight you may give me about this.
Kind regards,
Jorge