473,729 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JAXB Parsing problem

Hi I am new to JAXB.

I am trying to unmarshal a XST. I have looked into many examples and
they provide to unmarshal if we have a XST with Tags withing Tags.
However I have an XST where I have a element with many attributes.

Here I am attaching my XML and XST.

Please provide me how I should unmarshal and use this XST.

Thanks,

XML :

<websitedetails >
<event eventid="1" channelid="6645 4" channelrunid="1 "
channeltype="pu blication" familyid="66104 " status="2"
websitename="rc .com" />
<event eventid="2" channelid="6645 4" channelrunid="2 "
channeltype="pu blication" familyid="66147 " status="1"
websitename="rc .com"/>
<event eventid="3" channelid="2222 2" channelrunid="1 "
channeltype="pu blication" familyid="66104 " status="1"
websitename="rc .com"/>
<event eventid="4" channelid="2222 2" channelrunid="1 "
channeltype="pu blication" familyid="66147 " status="1"
websitename="rc .com"/>
</websitedetails>

XST

<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSPY v5 rel. 2 U
(http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" >
<xs:complexTy pe name="eventType ">
<xs:attribute name="eventid" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:NMTOKE N">
<xs:enumerati on value="1"/>
<xs:enumerati on value="2"/>
<xs:enumerati on value="3"/>
<xs:enumerati on value="4"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="channelid " use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:NMTOKE N">
<xs:enumerati on value="22222"/>
<xs:enumerati on value="66454"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="channelru nid" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:NMTOKE N">
<xs:enumerati on value="1"/>
<xs:enumerati on value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="channelty pe" type="xs:string " use="required"/>
<xs:attribute name="familyid" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:NMTOKE N">
<xs:enumerati on value="66104"/>
<xs:enumerati on value="66147"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="status" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:NMTOKE N">
<xs:enumerati on value="1"/>
<xs:enumerati on value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="websitena me" type="xs:string " use="required"/>
</xs:complexType>
<xs:element name="websitede tails">
<xs:complexType >
<xs:sequence>
<xs:element name="event" type="eventType " maxOccurs="unbo unded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Jul 17 '05 #1
0 1651

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

Similar topics

0
3787
by: S Mulgund | last post by:
I have some legacy data that I want to convert to XML. I've designed a schema to represent the data in XML form, and I'm trying to figure out how best to perform the raw->XML conversion. The Java web services tutorial shows how to use Transformers and SAXSource objects to perform the conversion in a memory-efficient way, but it requires that I take responsibility for adherence to the schema myself in how I generate the XML output. So I...
4
5392
by: jesper | last post by:
Hi I am currently following the tutorial from IBM (http://www-106.ibm.com/developerworks/xml/edu/x-dw-xjaxb-i.html) I have three problems at the moment. 1. It says else where that when the source code files are generated using the XJC, it is possible to compile the generated source code using javac generated\*.java generated\impl\*.java , but this only gives me 97 errors.?
0
2343
by: Mark | last post by:
I'm betting it me. Here is the simple schema I'm using: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:version="1.0"> <xs:annotation> <xs:appinfo>
13
5659
by: Christoph Brunner | last post by:
Hi, on the sun homepage i had submit to the bugparade a request for feature enhancement for the JAXB API. After a period of time sun called me to post my request to a newsgroup an get comments from other java developers. So please comment my following request for feature enhancement: If i unmarshall an invalid xml document i got a javax.xml.bind.UnmarshalException: Unexpected end of element
0
1544
by: Mark | last post by:
I'm betting it me. Here is the simple schema I'm using: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:version="1.0"> <xs:annotation> <xs:appinfo>
0
1533
by: ciaran.mchale | last post by:
I used Google to find information about JAXB 2.0 and I ended up downloading a document called "The Java Architecture for XML Binding (JAXB) 2.0: Proposed Final Draft September 30, 2005". Section D.2 (pages 331 to 334) gives an unambiguous explanation of the mapping from an XML name into a Java identifier *if* the underscoreHandling is "asWordSeparator" (which is the default). In particular, Table D-1 uses regular expressions to clearly...
0
1754
by: dt | last post by:
I downloaded Microsoft Office 2003 Reference Schemas from: http://www.microsoft.com/downloads/details.aspx?familyid=fe118952-354... Then I tried to use JAXB on them, specifically excel.xsd and excelss.xsd. The first one passes OK, but doesn't contain Worksheet element, which is the root element for Excel 2003 documents saved as XML. The other schema, excelss.xsd, contains the definition of this element, but doesn't pass through JAXB....
0
2628
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of the particle of the base this xsd file is valid as per w3c standard i am also providing error in detail and geometry.xsd file geometry.xsd <?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="http://www.opengis.net/gml"...
1
2487
by: =?Utf-8?B?VGVjaGVlaw==?= | last post by:
I am using JAXB for parsing the XML file. When any validation error occurs like a particular tag value in the XML file is not in sync with what is defined in the schema, the JAXB is not displaying the tag name in the exception message. It just displays the message like – “the value does not match the regular expression "{2,2}". Is there anyway in retrieving the tag name when a validation error occurs in JAXB?
0
8917
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
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
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
9142
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
8148
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
6722
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
6022
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();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
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

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.