Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 40164 invoked by uid 500); 21 Feb 2002 21:12:01 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 40155 invoked from network); 21 Feb 2002 21:12:00 -0000 Subject: complexType extending a simpleType To: axis-dev@xml.apache.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: "R J Scheuerle Jr" Date: Thu, 21 Feb 2002 15:12:03 -0600 X-MIMETrack: Serialize by Router on D04NM202/04/M/IBM(Release 5.0.9 |November 16, 2001) at 02/21/2002 04:12:03 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N According to XML Schema Primer 0 Chapter 2.5.1, a complexType can be derived from a simple type to add attribute information. Lets say you had the following schema: The above could be sent over the wire as: Widget 1.00 And the above would be modeled as a java bean named PurchaseItem with two String properties. Now let's say you extend this for an international market, thus the price needs to know the currency. Since it is closely tied to the price, you want to represent currency as an attribute on price. Here's how to represent this in xml schema. So this means that price is an element whose value is a string and has a currency attribute. Here is an example over the wire: Widget 1.00 We don't support extension of simpleTypes yet. When we do, we need to generate a PurchaseItem bean (as before) and a InternationalPrice bean. However, note that the InternationalPrice has a "raw" value that is serialized directly...not within an element and not as an attribute value. The serializer and deserializer need to know about this raw value, and the bean requires a special property name to get to the raw value. (I propose getValue and setValue accessors, which match what we do with enumeration classes...our other kind of simpleType). So both emitters, bean serializer, and bean deserializer will need to have extra code to support this feature. (Note that this is an optional JAX-RPC feature). Comments? Rich Scheuerle XML & Web Services Development 512-838-5115 (IBM TL 678-5115)