Revision [59]
This is an old revision of XDMSerializeUseCase3 made by DavidLee on 2009-09-18 08:50:10.XDM Serialization Use Case 3
Exchange of XDM data between XDM Tools from the same vendor in the same environment
In some cases, even when using the same vendor's API's exchange of XDM data in the vendor's native API is not practical. For example, in a complex program there may be fixed interfaces for exchanging data between modules such as Streams or Byte Arrays. Thus cooperating modules in the same environment may not be able to exchange data even if they both produce and consume the same native data types.
An example.
An XDM Producer (for example XPath 2.0) outputs XDM data that it would like to exchange with an XDM Consumer (for example XQuery) which is running in the same environment and implemented by the same vendor using the same native XDM data types. However the interfaces between these modules restrict the data types to byte arrays which prevents XDM data from being interchanged.
If all XDM Tool modules can agree on a standard text serialization format then data may still be interchanged.
Actors
XDM Producer: An implementation of an XPath 2.0 processorExample, an xpath that returns a sequence of nodes
/foo/bar
XDM Consumer: An implementation of an XQuery processor which expects a sequence of nodes as an external variable from in the same data type as the XDM Producer.
Example
declare variable $list as element(bar)* external ;
Interface
A internal interface to these modules that only allows byte arrays as inputs and outputs.
Expected Use
To pass the results from the XDM Producer to the XDM Consumer across the interface which only allows text (byte arrays) serialization is produced by the XDM Producer and the resulting byte stream is reconstituted and passed to the XDM Consumer.Simplified example of a Java API passing results through serialization using a hypethetical implementations of XPath and XQuery.
// XPath byte[] executeXPath() { XdmValue value = Xpath.execute("/foo/bar"); byte[] serialized = result.serialize(); return serialized ; } // XQuery void executeXQuery( byte[] parameter ) { XdmValue value = XdmValue.deserialize( serialized ); XQuery xquery = new XQuery( "declare variable $list as element(bar)* external ; ... ") ; xquery.setParameter( "list" , value ); xquery.execute(); } // Coordinator byte[] value = executeXPath(); executeXQuery( value );
XDMSerialize
There are no comments on this page. [Add comment]