04-11-2013 03:22 PM
Will v1.5 include the Schema Instance namespace in define.xml? I keep getting this error in OpenCDISC validator.
I'm also wondering if there is somewhere, besides editing my define.xml, to provide the namespace information for v1.4. I don't know java and it looks like that is what is writing the xml.
I have one other question. For the SASFormatName attribute on codelists, values like $LBTESTCD are showing up as errors in the validator. Is that really the case? Was that a valid format name in v5 (assuming its some sort of transport file limitation that is the basis for the rule)? I worked on v5.18 on a VAX when I first started using SAS and I can't remember for sure.
04-12-2013 03:57 PM
The XML schema for the define.xml does not allow the SASFormatName attribute to be longer than 8. You could use "$LBTESTC" as alternative.
As far as the Schema instance namespace:
CST v1.5 does not create the Schema Instance namespace in define.xml.
The SAS Clinical Standards Toolkit follows the recommendation from the XML Schema Validation for define.xml White Paper (http://www.cdisc.org/define-xml).
This paper states:
Many tools enable you to link the schema to the define.xml file at validation time, and this method is generally considered to be a robust option for referencing the schema. This approach is often preferred because the consuming application is typically better suited to establishing the location of your local schema repository.
Another approach is to set the value of the xsi:schemaLocation attribute within the define.xml file itself. This attribute value allows you to tie the define.xml document to the define-1-0-0.xsd schema. This link is not mandatory, but with many validators it does help the tool to locate the schema. The W3C Schema Recommendation considers the xsi:schemaLocation value as a hint to the validating software on where to find the schema.
In general, validation tools will use a handful of possible strategies to identify and locate the define.xml schema for validation purposes:
- Use the xsi:schemaLocation attribute value to find the schema. Not all tools will make use of this hint.
- Enable the user to set the location of the schema within the validating software at the time of validation processing.
- The validating software may dereference the namespace to retrieve the schema.
- Use logic built-in to the application to determine the location of the define schema.
Not all XML parsers employ these strategies in the same way. For example Xerxces, a broadly used XML parser maintained by the Apache Software Foundation uses the information in xsi:schemaLocation to locate the define.xml schema. On the other hand, the MSXML 4.0 parser does not.
Since CST does not use the xsi:schemaLocation, it does not define the xsi namespace, since this namespace is not being used in the define.xml as created by CST.
We consider the OpenCDISC rule DD0002 (DD0002 Missing or invalid namespace reference) too restrictive, since the schema namespace reference only has to be there in case it is used.
In the Define-XML version 2 this rule is more clearly defined. There it is clearly stated that the schema location is optional, and that the schema instance namespace is only required when the schema location is provided.
I hope this helps.
Software Developer @ SAS
04-12-2013 04:05 PM
Thanks Lex! Now I just have to convince others that will run the validator on my define that DD0002 is too restrictive. Looking forward to your PharmaSUG talk even though we only back-handedly use ODM through define. Definitely am using the information from last year's talk. Looking forward to v1.5 and then to define 2.0 support.