wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Non-Deterministic XML Explanation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Non-Deterministic XML Explanation" Watch "Non-Deterministic XML Explanation" New topic
Author

Non-Deterministic XML Explanation

Claudinei Junior
Greenhorn

Joined: Feb 19, 2011
Posts: 14

Hello mates,

I'm not sure whether this sort of question is allowed here - if it is not, apologies and please close this topic down.

I'm studying for the OCJWS and I've stumbled into this paragraph whilst reading the excellent Service Design Pattern book:

Another problem with Extension Points pertains to the problem of nondeterminism. This occurs when an XML processor (i.e., client, service, or validating XML parser) can’t figure out when a document or document fragment terminates. A complex type may, for example, define a sequence of elements that contains an optional telephone number element followed by an Extension Point. If the client sends the telephone number, the processor can’t know if that should be the last element or if the wildcard content in the extension might follow.


I'm having a bad time to understand the statements above. May you please help me through?

If I have a XML with the following structure:



The XSD could say: "xs:complex type contact details has a sequece of xs:string element called telephone followed by xs:any" (I'm not going to dare to scribble a XSD from the top of my head - for the sake of the example, I think the plan English description will do)

I honestly cannot see why the XML processor won't be able to identify when the contactDetails is over. The telephone element is followed by a contactDetails closing tag.

Can someone please help me to understand that problem?

If someone is interested in the text, the full paragraph says:

Another problem with Extension Points pertains to the problem of nondeterminism. This occurs when an XML processor (i.e., client, service, or validating XML parser) can’t figure out when a document or document fragment terminates. A complex type may, for example, define a sequence of elements that contains an optional telephone number element followed by an Extension Point. If the client sends the telephone number, the processor can’t know if that should be the last element or if the wildcard content in the extension might follow. One solution is to make everything that precedes the extension a required element, but this fundamentally alters the rules for how data is exchanged. The parties could instead identify the extension as being a required element and mark it off with Sentry Elements [Obasanjo] that surround the extension and act as delimiters.
This means that the sender must always provide an extension, but the contents of it may be left blank. While this solves the problem of nondeterminism, the party receiving this structure still has no way to predict what it might find


Cheers.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Non-Deterministic XML Explanation
 
Similar Threads
XML Notes - IV
Is DII the best way to go?
How rpc literal non standard types are mapped in JAVAt?
Creating Jibx Bindings for Ambiguous XML
XML One liners for the exam....