[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XML and Objects
First, as Tim Bray suggests, the DOM goes a long way to represent objects in XML. We can add to this by 1) a DTD for a Simple Object Definition Language (SODL) this DTD is included in a post to follow. 2) Use of both Base64 and multipart/related techniques. The advantage of SODL is that the object's data is represented in XML itself. This works for most objects except those whose state is comprised of large amounts of binary data. For moderate amounts of binary data base64 encoding is fine and certainly works. For large amounts e.g. video clips and pictures, multipart/related MIME messages with Content-ID tagged binary parts is more efficient. When representing an object by a multipart/related compound document, the first part is an XML metadata header which contains internal "cid:xxx" links. We are using these techniques in production for our XML/internet based telemedicine system. I have developed a DOM for MIME which we use for this. I would be happy to share more of these details if there is interest. Now to your specific question, if objects are represented in this fashion, you can access members through interfaces (i.e. Java/C++) through get/set pairs. A language XML interface layer is needed. This layer is identical to COM's dispatch layer which allows COM objects to be used from within Javascript and VBScript. COM uses a binary typelibrary as input. Our technique takes the SODL document and a) generates a typelibrary from it b) employs a custom interface which is driven by the SODL document The advantage of (a) is that it is compatible with existing software however the software is limited to Windows. XML-DEV would be an excellent place to develop an independent (b) layer specification. This spec would certainly need to interface with DOM. Jonathan Borden JABR Technology jborden@m... > > > > I have 2 questions/problems: > > 1) A DTD describes a document which contains content specified by a URL, a > local file name, or inline. Documents created using this DTD are assembled > and transported across a network. How do you include the content? The 2 > ways we have discussed are: > > * Inline using Base64 encoding in a CDATA section > * Wrap the document in a multipart/related MIME message > and include the content as attachments > > I am leaning towards multipart/related, but would like to know of others > experience in this area. > > > 2) We desire to provide an API on the client side which exposes a simple > mechanism for creating and modifying objects. These objects are serialized > using XML and then transported to a server for further processing. The > server then responds with another XML document that we then de-serialize > into an object and present it to the API user. Here are some basic > requirements: > > * Support for both Java and C++ > * API must be similar for both Java and C++ > * Object members are accessed via get/set methods > * Adhere to JavaBean method naming patterns > > We are thinking of developing an application which takes a DTD and then > generates Java and/or C++ code for each object. We would use a XML helper > file to give more control over the generation process. Are we out in left > field here? What are some of the other ways to do this? What are you > experiences doing something like this? > > > Gregory M. Messner > gmessner@v... > Jonathan Borden JABR Technology Corporation 617-557-5151 (fax) 617-557-5160 mailto:jborden@m... xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|