Tuesday, February 22, 2011

Why are there three global elements in the schema?

Q: Why are there three global elements in the schema?

A:
The root for ALL messages should be MESSAGE. 

The model has a concept called REFERENCE.  There are two places where reference is used to point to an external resource.  

If we are attempting to send a large amount of DEAL or DOCUMENT information in one message these can be located outside the XML document.  

The idea is that you would use the information in the REFERENCE to find the location of the DEAL or DOCUMENT and in bring its content.  We want to be able to validate these external "files".  Therefore, DEAL and DOCUMENT are global elements in the schema.

Q:Would the external files would always have a root of DEAL or DOCUMENT?
A:
In REFERENCE it is possible to have an XPath.  In that case you could "find" the DEAL or DOCUMENT inside another MESSAGE.

However, one would generally expect the external XML to have either a DOCUMENT or DEAL root.

If the receiver of the MESSAGE validates the reference file then a DOCUMENT or DEAL root would be required. This is the recommended option.

If the receiver of the MESSAGE validates after extracting the content of the reference then DEAL or DOCUMENT could be embedded in any arbitrary XML.  As long as the sent message has the XPath to pick out the MISMO pieces from the arbitrary container.  I see no compelling reason to take this option.



No comments:

Post a Comment