473,657 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to reorder xml with xsd given in java without JAXB

1 New Member
XSD file:
<xsd:schema xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
targetNamespace ="urn:books"
xmlns:bks="urn: books">

<xsd:element name="books" type="bks:Books Form"/>

<xsd:complexTyp e name="BooksForm ">
<xsd:sequence >
<xsd:element name="book"
type="bks:BookF orm"
minOccurs="0"
maxOccurs="unbo unded"/>
</xsd:sequence>
</xsd:complexType >

<xsd:complexTyp e name="BookForm" >
<xsd:sequence >
<xsd:element name="author" type="xsd:strin g"/>
<xsd:element name="title" type="xsd:strin g"/>
<xsd:element name="genre" type="xsd:strin g"/>
<xsd:element name="price" type="xsd:float " />
<xsd:element name="pub_date" type="xsd:date" />
<xsd:element name="review" type="xsd:strin g"/>
</xsd:sequence>
<xsd:attribut e name="id" type="xsd:strin g"/>
</xsd:complexType >
</xsd:schema>

XML file:

<?xml version="1.0"?>
<books>
<book>
<id>bk001</id>
<genre>Fictio n</genre>
<author>Write r</author>
<title>The First Book</title>
<price>44.95</price>
<pub_date>200 0-10-01</pub_date>
<review>An amazing story of nothing.</review>
</book>
<book>
<id>bk002</id>
<genre>Poem</genre>
<author>Poet</author>
<title>The Poet's First Poem</title>
<price>24.95</price>
<review>Least poetic poems.</review>
</book>
<x>urn:books</x>
</books>

I want to make the xml in a proper order as given in xsd without JAXB. Can anybody help me in this.
Feb 8 '14 #1
0 1085

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5242
by: al butler | last post by:
I'm looking at the software languages and need an api to monitor a port (example:80) AND intercept eveything with the ability to stop whatever application is trying to send or recieve data on it. i would like to stay away from Windows DLL hell and of course wold like something for multiple operating systems. I don't want to throw all my work in to a Windows
5
3675
by: Maurice Ling | last post by:
Hi, I have read that this had been asked before but there's no satisfactory replies then. I have a module (pA) written in python, which originally is called by another python module (pB), and passes a python object (pO) to pB. Now I require pA to be called in a java class (jC) and pass pO into jC. As pA uses non-python modules, I am not able to use Jython on this.
133
8530
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
4
1825
by: Rhino | last post by:
I've been playing with Java UDFs for the last couple of days and I've got some questions about scratchpads. I'm running DB2 LUW V8 (FP8) on WinXP. Somewhere in the manuals, I found some remarks that said I could either manage my scratchpad with the getScratchpad() and setScratchpad() methods *OR* set up my own class variables to keep the state between invocations of the UDF. (I can't find those remarks again right now but I know I saw...
458
21132
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers simply aren't smart enough to understand C++? This is not merely a whimsical hypothesis. Given my experience with Java programmers --- the code they write and the conversations they have --- Occam's Razor points to this explanation. For example,...
2
2820
by: ramasubramanian.rahul | last post by:
hi i am trying to call some java APIs from c . i use the standatd JNI calls to load the JVM from a c program and call all java functions by using a pointer to the jvm which was returned by the JNI call the source code is given below and also the errors .. Plz help in resolving these. This is a code being (slightly modified ) which was downloaded from SUN website :
4
4796
by: bawa | last post by:
pls give an idea about how to write string search and replace program in java without using any built in functions.. pls help me out
1
1384
by: simbaa | last post by:
How can i create a tree structure in java without using XML and applets?
63
4951
by: s0suk3 | last post by:
I've been programming Python for a couple of years now. Now I'm looking to move on to either C++ or Java, but I'm not sure which. Which one do you think will be a better transition for a Python programmer? Which one will educate me the best?
8
2710
intruderX
by: intruderX | last post by:
When programing robots with java, how they program hardware with java? Can java do the port programming? Or it is done in some other way? for an example... 1). A basic O/S is running to work with hardware. 2). JVM runs on that O/S. 3). A Java program is running on the JVM, and it(JAVA) is used for the programming, as it become more user friendly to the programmers. I need to know whether we can program hardware with just JAVA, without...
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8821
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8502
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7316
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.