Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: when will empty tags pass schema validation?

From: "wolf_y" <brunson51@-----.--->
To: NULL
Date: 5/4/2006 10:27:00 AM

Thanks for answering, but maybe I should have led with my disclaimer:
I'm a newbie to XML, primarily program in SAS, and consulted online
documentation.

Some of my confusion stems from the way terms such as empty, missing,
null, and blank are used/handled in different languages.  I don't mind
reading docs, but I can't find an answer I understand at
http://www.w3.org/ or url links I've found.

I don't want to create an empty element, but need to know under what
circumstances an empty element will pass schema checks, so that the
backend processing in SAS can react correctly when it's time to load
the data.  There are 5 SAS programmers sharing responsibility for
writing the load routines and I was chosen to explain what to expect
after validation.  There might be circumstances where an empty element
is allowed and others where we want to reject the file, both based on
the same element, depending upon the XML file provider or segment.

There are 4 levels of schema involved.  Here's an example of an element
in the Level 3 schema:

<xs:element name="MOM">
		<xs:annotation>
			<xs:documentation>Mother</xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:minLength value="1"/>
				<xs:maxLength value="25"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>

 I understand that because of minLength this element must have at least
one character.  In a simple test, whitespace <MOM> </MOM> passes (is
this a blank in XML?) whereas <MOM></MOM> doesn't (null or empty?).  An
element defined with type=xs:integer fails in both circumstances.

Is there any type (or attribute?) where both <MOM></MOM>  and <MOM>
</MOM> passes validation?  Or must an element be explicitly defined as
permitting Empty(nil?) values?  Or must I test each unique element?

I hope this makes sense.



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent