473,416 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

For XML Schema gurus - populate 2 combo boxes from schema data

The XML Schema design problem to solve is as follows:

We have 2 combo boxes to populate from schema data, let's say:

1. States
2. Cities (and this one gets populated depending on the choice of the
state)

The event management is no problem, the question is, how do we build
our XML Schema (that's going to contain the data for both states and
cities, as we use it to validate the XML that we generate based on the
forms from it, so both have a double purpose), so that we can link
states and cities?
We're using XML Beans as our object model for the schema, and our
application is built in Swing.
We have some other combo boxes based in enumerations, those are OK,
but in this case we have to make a link so that we cannot have one
single huge cities enumeration (and to make sure we don't get funny
state-city matches).

So far we have seen that this might be a possible solution, but as XML
Beans refer to objects by name, we need some sort of link between
state codes and state names...

(there might be typos here...)

<complexType name="STATE1">
<sequence>
<element name="STATENAME" fixed="here_goes_state_name"/>
<element name="CITIES">
<simpleType>
<restriction base="string">
<enumeration value="here_go_city_names"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>

Then we would have the list of state codes, something like this:

<simpleType name="STATE_ENUM">
<restriction base="int">
<enumeration value="1"/>
<!-- more codes here -->
</restriction>
</simpleType>

We would put all the states (1..n) in some sort of parent collection
so that we would get them in order, as the codes in the STATES_ENUM.
The XML Beans don't have any generic method to get all the children
for a given element, you have to refer them by class name (that's
quite a problem in this case).

We would probably have a separate list for state names, just to
populate the state combo (labels as names, codes as digits that would
go in the generated XML created from the user's choices).

It'd all be a lot easier if we had simple XML files, not schemas, but
it seems there can be no mixture of both (besides, the XML beans do
not allow to generate an object model from an XML file, and we need
the validation for the state and city data in the schema)

does this seem correct? if not, any suggestions?

thanks in advance

Joyce
Jul 20 '05 #1
0 1651

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
4
by: godber | last post by:
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be...
7
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data...
29
by: gedwards | last post by:
First off, I am a complete newbie to Access. I've used it maybe a half dozen times, all my database knowledge is with Oracle. I'm building a database/form in Access 2003. I'm trying to get it so...
5
FOE2272
by: FOE2272 | last post by:
I have tried every option that I can think of and most of them on this forum. The closest that I got was to bring up the field but it changed the other records based on what was chosen in one...
4
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. ...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
2
by: Ronald | last post by:
I hope somebody can help. I can't get into the specifics of my project, but I'll try to create a simple example: tblVehicle * VIN (text box) * Make (text box) * Model (text box) frmRepair
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.