[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

JAVA-XML

Posted on 2006-05-12
4
Medium Priority
?
214 Views
Last Modified: 2013-11-19
Hi All,

I posted this in XML forum, but didn't got any reply.. but since it is related to Java also, so posting it here as well...

Please help!!!

I am very new to XML.. never done it, so kindly be patient..

I want to build a xml

where I have order
 in order there can be many allocations
 in allocation there can be many execution

also, order has price, quantity, clientId etc fields
allocation has price, quantity, account etc fields
exeuctions has price quantity, id etc fields

I want to do it the right way --- to build schema or dtd first and based on that create a xml

objective is that finally we will use this dtd/schema to automatically create XML using java ...

and then somehow based on XML-- build automatically the java objects  ---  like Order Object ..  Allocation Object etc..

I have all these objects in java already but rest of the stuff needs to be done..

Please help me create this...

again, sorry, I am very new to XML -- don't know much about basics of it.. so kindly be patient answering my basic questions...

thanks
0
Comment
Question by:shivani
2 Comments
 
LVL 14

Accepted Solution

by:
hoomanv earned 300 total points
ID: 16671345
I also dont know much about xml. :-)
here is a good place to start learning java's APIs for xml
http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/

Processing XML with Java: http://www.cafeconleche.org/books/xmljava/
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 300 total points
ID: 16674318
You should create the XSD first. Take a sample XML if you want. For your case, it might be like:

<Orders>
  <Order ID = "....">
    <ClientID>....</ClientID>
    <Price>....</Price>
    <Quantity>....</Quantity>
    <Allocations>
      <Allocation ID = "....">
        <Account>....</Account>
        .... // other fields
      </Allocation>
    </Allocation>
  </Order>
</Orders>

You will need to define an XSD containing data-types of all of these and constraints like how many times a node can occur, etc
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses
Course of the Month20 days, 6 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question