[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML as an interface

  • From: Danny Ayers <danny@p...>
  • To: xml-dev@l...
  • Date: Wed, 14 Feb 2001 20:55:38 +0600

severn trent systems
Am I right in thinking you have Java at each end of the interface? (the
mention of a client JVM suggest this) If so then your problem shouldn't be
too difficult to solve.

Many app servers already have facilities for streaming out XML, e.g. as a
TextMessage - if there's nothing immediately available for WebLogic then
it's not too tricky to build what you need. Two main alternatives spring to
mind for creating the XML to pump out - either do it serially or as a DOM
document. If you are dealing with very large documents (i.e. ones that take
data from a lot of records) then the serial approach is probably best as you
don't need a big in-memory model. Obviously it will depend on the data you
wish to transfer, but this can be done using anything from fairly
hard-coding "<field attribute="+value+">stuff</field", up to creating the
text much more dynamically. With DOM it's pretty straightforward, you create
a document and create elements as child nodes in that, and then serialize
the whole thing out.
I think another approach would be to use XSLT, but as you have Java in place
it's probably more straightforward to use that directly.

On the receiving end, then you can either reconstruct the DOM tree or
extract the data using a SAX parser. This is very straightforward in Java.
To get this into the C++ you'll probably be looking at JNI.

If you can't use Java at the client end, or if it seems better not to, then
you'll need to look at a C++ parser - if you've got Windows clients then
there's MSXML (see http://msdn.microsoft.com/xml/general/xmlparser.asp) This
has support for SAX and DOM.

Creating the objects in C++ could be tricky - again this will depend a lot
on the data, the more you know in advance about the fields of the objects
the easier this will be. Brendan Macmillan has done a lot of work on
bridging between XML and Java objects (see
http://sourceforge.net/projects/jsx/), perhaps you could talk him into
porting it to C++ - though don't tell him I said that!

There's plenty of material on the Java aspects of this type of thing at

Good luck and good afternoon!


PS. I see you work for Severn Trent - any sandbags left?

<- -----Original Message-----
<- From: stephen_lake@s... [mailto:stephen_lake@s...]
<- Sent: 13 February 2001 16:41
<- To: xml-dev@l...
<- Subject: XML as an interface
<-      Good Morning,
<-      I have a problem!
<-      I am working on a (legacy) product that needs to have an XML
<-      interface. Let me give some background.
<-      The product is written in C++, and sits on a client machine. The
<-      product launches a JVM. There is an application server (WebLogics),
<-      and the data access is using EJB's. We are communicating
<- between the
<-      server and the JVM using JMS. The messaging system will be carrying
<-      the data as XML.
<-      My problem is the conversions:
<-      1, The (java) server needs to be able to create the XML
<- from the data.
<-      2, The (C++)  client needs to be able to create objects
<- from the XML.
<-      Could someone point me in the correct direction for these two
<-      processes.
<-      Regards
<-      Stephen  J Lake
<- ***********************************************************************
<- This message has been sent via the Internet. Internet communications
<- are not secure against interception or modification. Severn Trent
<- Systems therefore can not guarantee that this message has not been
<- modified in transit, and this message should not be viewed as
<- contractually binding.
<- This message and any files transmitted with it are confidential and
<- intended solely for the use of the addressee. If you have received
<- this message in error please notify the sender and destroy your
<- copies of the message and any attached files.
<- ***********************************************************************
<- Severn Trent Systems Ltd : a part of Severn Trent plc.
<- Registered in England and Wales Registration No. 2394552


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.