XmlBeans vs JAXB vs Castor

Hi guys,
I just briefly read BEA's XMLBeans overview and it seems very similar (if not
identical) to Sun's JAXB specification. Are they one and the same?
Also, I am currently using the open source software from Castor (www.castor.org)
for xml-java & java-xml translations. It seems to be a lot simpler and flexible
than XMLBeans...
If anyone else has used bot Castor & XMLBeans(or JAXB), i would appreciate your
comments...
thanks,
sudu

Follow these 2 threads:
If the link is wraped to the next line, copy and paste in your browser.
1.
http://newsgroups.bea.com/cgi-bin/dnewsweb?utag=&group=weblogic.developer.in
terest.xmlbeans&xrelated=34&cmd_thread_next.x=44&cmd_thread_next.y=12
2.
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.develo
per.interest.xmlbeans&item=17&utag=
/k
"sudu" <[email protected]> wrote in message news:3e958c7d$[email protected]..
>
Hi guys,
I just briefly read BEA's XMLBeans overview and it seems very similar (ifnot
identical) to Sun's JAXB specification. Are they one and the same?
Also, I am currently using the open source software from Castor(www.castor.org)
for xml-java & java-xml translations. It seems to be a lot simpler andflexible
than XMLBeans...
If anyone else has used bot Castor & XMLBeans(or JAXB), i would appreciateyour
comments...
thanks,
sudu

Similar Messages

  • XmlBeans vs JAXB

    Dear friends,
    what is better? xmlbeans or JAXB ?
    I prefer JAXB because I have experience with that and also because it is a SUN specification ... but some friends here are talking about XmlBeans and I need arguments to preserve JAXB ..

    Follow these 2 threads:
    If the link is wraped to the next line, copy and paste in your browser.
    1.
    http://newsgroups.bea.com/cgi-bin/dnewsweb?utag=&group=weblogic.developer.in
    terest.xmlbeans&xrelated=34&cmd_thread_next.x=44&cmd_thread_next.y=12
    2.
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.develo
    per.interest.xmlbeans&item=17&utag=
    /k
    "sudu" <[email protected]> wrote in message news:3e958c7d$[email protected]..
    >
    Hi guys,
    I just briefly read BEA's XMLBeans overview and it seems very similar (ifnot
    identical) to Sun's JAXB specification. Are they one and the same?
    Also, I am currently using the open source software from Castor(www.castor.org)
    for xml-java & java-xml translations. It seems to be a lot simpler andflexible
    than XMLBeans...
    If anyone else has used bot Castor & XMLBeans(or JAXB), i would appreciateyour
    comments...
    thanks,
    sudu

  • JAXB vs Castor

    Hi ,
    can anyone please suggest which is better to use Castor or JAXB.

    I was using Castor, but as JAXB is a standard (and a number of groups are working on implmentations) I switched when JAXB became available.
    Castor is in fact faster and lighter (smaller classes) than Sun's JAXB implementation (you can also do a lot of other things with Castor), I might swap again when alternatives to Sun's JAXB become available.
    HH

  • XMLBeans and JAXB

    Can someone from BEA explain the relationship and/or differences between the proposed
    Java standard API for XML binding, JAXB, and XMLBeans? Obviously XMLBeans offers
    additional APIs, such as cursors and XQuery support (which is neat), but it seems
    to be non-standard and BEA-specific.
    In this context, are there any clear statements from BEA product marketing how
    the technology will be productized? Without that, it seems a bit dangerous to
    use...
    Thanks,
    PM

    XMLBeans and JAX-B are complementary technologies. JAX-B is a good technology
    for loading XML documents into Java objects – in constructing XMLBeans, we have
    attempted to be compatible with JAX-B naming conventions. However, JAX-B cannot
    necessarily preserve the full fidelity of XML documents, nor does it support 100%
    of schema. This is where XMLBeans is complementary - document preservation and
    support for extensibility are explicit goals of XMLBeans. Though JAX-B does not
    make this possible today, it is conceivable that XMLBeans will be an implementation
    of a future JAX-B spec as both technologies may converge together.
    Given the above statement, one may ask then why is that preserving full fidelity
    of the original XML document may be important? Consider the following advantages:
    (1) Sequencing and interleaving information is not lost in XMLBeans. There are
    schemas where you care whether <input> comes before <output> or <buy> comes before
    <sell> or the other way around. If you just give people a Java .getBuy() and
    a .getSell(), they've lost the ability to tell which came first. In XMLBeans,
    after the .get you always have the ability to grab an XML cursor on the <buy>
    and another one on the <sell> and ask which one came first.
    (2) Information that comes into wildcards are not lost in XMLBeans. Consider
    the regularly used <xsd:any> and <xsd:anyAttribute> features of schema that allow
    any data to appear in the document. With JAX-B, for example, the specification
    does not specify how an implementation handle content that it does not know how
    to map to a Java representation. But with XMLBeans, you can see where and how
    your document has been extended at the wildcards, and change or manipulate the
    wildcarded data. Furthermore, something cool is that if you have compiled schemas
    for the wildcarded data you can even coerce the wildcards to strongly-typed XMLBeans
    and keep on drilling in conveniently. A common use case for this is processing
    WSDLs: the w3c schema for WSDL uses wildcards for nearly every interesting piece
    of data in a WSDL.
    (3) Loading, modifying, and saving an XML document using XMLBeans, you won't lose
    all the "other stuff" that human beings don't want to lose on human-readable XML
    files, namely comments and all that extra pretty white space between things.
    (Unless you want to lose it; XMLBeans can be put in a mode where it is used to
    strip extra white space too.)
    (4) The architecture is set up so that 100% of schema types can correspond one-to-one
    with a Java type. This is perhaps a subtle benefit, but it is powerful because
    it means that there are "no regrets" and "no dead-ends" later. You never run
    into a schema type that can't be subclassed because of Java problems, or some
    extension that has some data that can't be accessed from Java.
    I hope this helps shed some light on the complementary relationship between XMLBeans
    and JAX-B.
    Regards,
    Samir
    "Peter Meyer" <[email protected]> wrote:
    >
    Can someone from BEA explain the relationship and/or differences between
    the proposed
    Java standard API for XML binding, JAXB, and XMLBeans? Obviously XMLBeans
    offers
    additional APIs, such as cursors and XQuery support (which is neat),
    but it seems
    to be non-standard and BEA-specific.
    In this context, are there any clear statements from BEA product marketing
    how
    the technology will be productized? Without that, it seems a bit dangerous
    to
    use...
    Thanks,
    PM

  • Converting XML to Excel.

    Hi Everybody,
    I have a requirement to have a prebuit XML templete in the database, when a person download it it will populate with some default values in a EXCEL file format.
    How can i acheive this.Please help.
    Thanks

    If I understand you correctly, you have data as XML document and you want to use that data to create a Excel spread sheet. If this is right. I would suggest use any XML binding technoloy such as XMLBeans or JAXB or Castor to parse that document into a Java object and then you can use Apache POI library to generate Excel document. I hope this would help.
    -- Deha Peker

  • Xmlbeans vs. digester

    For parsing moderately complex xml configuration files, would you recommend xmlbeans or digerster, or something else entirely?
    xmlbeans seems to be easier to use, but it feels a bit overkill.

    Follow these 2 threads:
    If the link is wraped to the next line, copy and paste in your browser.
    1.
    http://newsgroups.bea.com/cgi-bin/dnewsweb?utag=&group=weblogic.developer.in
    terest.xmlbeans&xrelated=34&cmd_thread_next.x=44&cmd_thread_next.y=12
    2.
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.develo
    per.interest.xmlbeans&item=17&utag=
    /k
    "sudu" <[email protected]> wrote in message news:3e958c7d$[email protected]..
    >
    Hi guys,
    I just briefly read BEA's XMLBeans overview and it seems very similar (ifnot
    identical) to Sun's JAXB specification. Are they one and the same?
    Also, I am currently using the open source software from Castor(www.castor.org)
    for xml-java & java-xml translations. It seems to be a lot simpler andflexible
    than XMLBeans...
    If anyone else has used bot Castor & XMLBeans(or JAXB), i would appreciateyour
    comments...
    thanks,
    sudu

  • Creating XML file from Java Bean

    Hi
    Are there any standard methods in Java 1.5 to create XML file from java bean,
    i can use JAXB or castor to do so,
    But i would like to know if there is any thing in java core classes,
    I have seen XMLEncoder, but this is not what i want.
    Any ideas
    Ashish

    Marshall JavaBean to an XML document with JAXB or XMLBeans.

  • Use of Codec class genereted by Autotyype for xml-jave binding?

    I have generated the java representation and codec classes using Autotype against xml schema. Just wondering can i use this codec class to do Java to xml binding like other tools (XMLBeans, JAXB and Castor) do. If answer is yes can you give me an example how can I use it.
    Thanks,
    Mujeeb

    manoj,
    Thanks for the help.
    Sample 4 tells me that there is no code generated that I can use to write out
    my non-built-in datatype to xml. For each of my non-built-in datatypes, I will
    have to hand write such code, or use a handler.
    John
    "manojc" <[email protected]> wrote:
    Here is an example of start form WSDL usecase:
    http://www.manojc.com/?sample11
    If you want to log the xml input/output to the web service
    you can use a handler. You need to edit the web-services.xml
    dd file to add handler.
    Here is a example of using handler. But this use source2wsdd
    instead of wsdl2service:
    http://www.manojc.com/?sample4
    Regards,
    -manoj
    "John Franey" <[email protected]> wrote in message
    news:3ef30db2$[email protected]..
    Hi,
    I created a wsdl and used the autotype and wsdl2service ant tasks togenerate
    java files.
    As part of my service, I want to log output in xml format of the datareceived.
    I can write my own serialization, or use the code that was generatedby
    autotype.
    I would rather not write my own. I want to use the code generated bywsdl2service.
    Trouble is I can not find a javadoc nor a sample code segment thatshows
    how!
    Call me dense, but I've spent several hours on BEA web pages lookingfor
    answers.
    This is what I found, but I could not get to work for various reasons:
    XML streaming: I have a codec (generated by autotype ant task), butit
    requires
    a SerializationContext. Where do I get a Serialization Context? I thinkserialize
    is a callout from WS and not for applicaiton code to call.
    javax.xml.rpc.encoding.Serializer: An object of this type is madeavailable by
    AbstractCodec (base class of generated code, but how is this classused?
    [Sorry if you've seen this posting a couple of days ago on interest.xml
    newsgroup.>>  I didn't intend to repost but due to lack of response there, I thought>this newsgroup>> was more appropriate and read more.
    Thanks,
    John

  • Create XML dynamically from schema and Java bean

    Hi,
    I'm looking for suggestions on the best approach to create an XML file programatically from a schema and Java bean.
    The schema used is not fixed and may vary with each request so a dynamic way to create the XML is required.
    Is there an API available that allows me to achieve this easily? Any help would be appreciated to point me in the right direction.
    Thanks.

    XMLBeans or JAXB should work for you.
    - Saish

  • Need help in displaying XML in JSP

    Hi there,
    i'm a newbi in XML and Java - I have the following prob, think for most of u nothing very difficult (or better thought so, I've posted this question in different forums here, but nobody answers :)
    I get an XML response from a search engine, now I want to display the search result in a jsp.
    The result is stored in the session [I hope I figured out correctly ;)]
    with the following command ->
    this.pageContext.getSession().setAttribute(SEARCHRESULT, dSearchResult);
    [its from the java class, which generates the result]
    Result example ->
    <?xml version="1.0" encoding="UTF-8"?>
    <FindSearchResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xml/SearchResult.xsd">
    <Result Hits="2" Name="OfficeLand_en_US">
    <Items>
    <Item Score="250">
    <Field FieldNo="0" Name="ProductID">KqvAqAB1Tq0AAADnFthtpZvC</Field>
    <Field FieldNo="1" Name="CatalogCategoryID">gh0KAAFvj3wAAADiW8SMtr6o</Field>
    </Item>
    <Item Score="250">
    <Field FieldNo="0" Name="ProductID">4rwKAAFvtNYAAADiwdCMtr6o</Field>
    <Field FieldNo="1" Name="CatalogCategoryID">gh0KAAFvj3wAAADiW8SMtr6o</Field>
    </Item>
    </Items>
    <HitDistribution>
    <Hit Hits="75" Score="0"/>
    <Hit Hits="2" Score="250"/>
    </HitDistribution>
    </Result>
    </FindSearchResult>
    How many 'Field' elements exist, depends on the query.
    The result example is a response, which is send to my JSP page. It is stored in an variable under the name SEARCHRESULT (it's the result of a query in a search engine).
    My JSP page is the page, which should display the searchresult.
    So i need to know, how to programm something in my JSP page to check the SEARCHRESULT to display not the whole xml file. I just want to display all Items (compare with result example) -> The name of each existing FieldNo, the Score and the HitDistribution.
    Please help me :)

    hi there,
    first create a xml schema for the xml you will be receiving.
    use jaxb or castor with the schema and create a class.
    in your jsp unmarshal the xml result you are getting with the class
    generated by either jaxb or castor. the class will have methods that return you the required elements.
    get to know xml schema better and just a pass thru of jaxb or castor will solve the problem.
    vedha_g

  • Automatic Generation of classes with required attribute names

    Hi ,
    I am new to XML technologies ...I am having a problem in deciding whether I
    should use JAXB or Castor for data binding.
    The problem is the attributes I am to use are named differently as that found in
    the DTD.I have creted my own classes using the required attribute names and the
    n mapped them using the Castor mapping with the attributes.
    I was wondering how should I achieve --"automatic generation of classes" with th
    e specified attribute names?
    I understand that JAXB can be used to automatically generate classes ,but this
    uses the same default names as that of the XML file ..is there a way of forcing
    JAXB to generate classes that use my name attributes rather than that of the XM
    L dtd
    If I use Castor ..is there a way to do the same.Generate Classes with the specif
    id attributes

    Hi ,
    I am new to XML technologies ...I am having a problem in deciding whether I
    should use JAXB or Castor for data binding.
    The problem is the attributes I am to use are named differently as that found in
    the DTD.I have creted my own classes using the required attribute names and the
    n mapped them using the Castor mapping with the attributes.
    I was wondering how should I achieve --"automatic generation of classes" with th
    e specified attribute names?
    I understand that JAXB can be used to automatically generate classes ,but this
    uses the same default names as that of the XML file ..is there a way of forcing
    JAXB to generate classes that use my name attributes rather than that of the XM
    L dtd
    If I use Castor ..is there a way to do the same.Generate Classes with the specif
    id attributes

  • Strange Error in Validating with JAXP1.2

    Hello,
    I have 3 big xsd files. The problem is that I cann't validate an xml sample using JAXP1.2. Also I tryed with JAXB and Castor but seems to be the same problem.
    I made an simple example in 3 files that generate the error:
    1.xsd - this is the main file
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="http://www.example.com/response" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fmcg="http://www.example.com/fmcg" xmlns:core="http://www.example.com/core" xmlns="http://www.example.com/response" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xsd:import namespace="http://www.example.com/fmcg" schemaLocation="2.xsd"/>
         <xsd:element name="response" type="ResponseType"/>
         <xsd:complexType name="ResponseType">
              <xsd:sequence>
                   <xsd:element name="senderName" type="xsd:string"/>
                   <xsd:element ref="fmcg:item" minOccurs="0" maxOccurs="unbounded"/>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>2.xsd
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="http://www.example.com/fmcg" xmlns:core="http://www.example.com/core" xmlns="http://www.example.com/fmcg" xmlns:fmcg="http://www.example.com/fmcg" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xsd:import namespace="http://www.example.com/core" schemaLocation="3.xsd"/>
         <xsd:element name="item" type="ItemType"/>
         <xsd:complexType name="ItemType">
              <xsd:complexContent>
                   <xsd:extension base="core:ItemType">
                        <xsd:sequence>
                             <xsd:element name="itemName" type="xsd:string"/>
                        </xsd:sequence>
                   </xsd:extension>
              </xsd:complexContent>
         </xsd:complexType>
    </xsd:schema>3.xsd
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="http://www.example.com/core" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.com/core" elementFormDefault="unqualified" attributeFormDefault="unqualified">
         <xsd:complexType name="ItemType" abstract="true">
              <xsd:sequence>
                   <xsd:element name="additionalItemName" type="xsd:string" minOccurs="0"/>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>And this is a sample xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="http://www.example.com/core" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.com/core" elementFormDefault="unqualified" attributeFormDefault="unqualified">
         <xsd:complexType name="ItemType" abstract="true">
              <xsd:sequence>
                   <xsd:element name="additionalItemName" type="xsd:string" minOccurs="0"/>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>This files was all validated by XML Spy 5.0.
    When I run this piece of code(an ordinary code for validating):
          File input = new File("test.xml"),schema = new File("1.xsd");
          DocumentBuilderFactory factory =
                DocumentBuilderFactory.newInstance();     
          factory.setNamespaceAware(true);
          factory.setValidating(true);     
          factory.setAttribute(SCHEMA_LANGUAGE,XML_SCHEMA);
          factory.setAttribute(SCHEMA_SOURCE,schema);
          DocumentBuilder parser = factory.newDocumentBuilder();
          parser.setErrorHandler(new ErrorPrinter() );     
          parser.parse(input);I got this ERROR:
    (file:test.xml: 7, 28): cvc-complex-type.2.4.a: Invalid content starting with element 'core:additionalItemName'. One of '{"":additionalItemName, "http://www.example.com/fmcg":itemName}' is expected.
    It seems that the parser expects 'additionalItemName' instead of 'core:additionalItemName'.
    Why ? I think the namespace is OK.
    (Also I tryed with Castor and JAXB and seems to have the same error).
    Regards,
    Catalin

    Jeni Tennison ( http://www.jenitennison.com/ ) solved my problem:
    The <additionalItemName> element is declared with a local declaration
    in 3.xsd. When you declare an element locally, the namespace for the
    element is either the target namespace for the schema or no namespace;
    it depends on the "form" for the element declaration. Since you have
    no form attribute on the <xs:element> element declaration, the "form"
    comes from the elementFormDefault attribute on the <xs:schema>
    element. In this case, it's 'unqualified', which means that the
    <additionalItemName> element is in no namespace.
    If you want the <additionalItemName> element to be in the core
    namespace (the target namespace for 3.xsd), then you should set the
    elementFormDefault attribute on the <xs:schema> element to
    'qualified' or add a 'form' attribute to the <xs:element> element with
    the value 'qualified'.
    Thank you Jeni.

  • How to generate an XML file following a XSD schema

    hi, i have a XML Schema (.xsd) and i have to generate automatically the structure of the XML according to the XSD Schema.I have been searching on the internet and found some solutions using XMLBeans and JAXB, but that`s not exactly what i am looking for. I use JDOM to parse XML and i'd wish to use only Jdom to generate XML if it's possible....Thank's

    Dear All,
    Indeed the post by RamJaddu did not answer the question. I am having the same issue: I have been provided an .xsd file which contains a data schema, and I have all of the necessary
    data in a .mdf file in order to create the required .xml file. Having queried SQL Server and received my data in "myDataSet" I can use C# to create the .xml ignoring the schema using
    string strSchemaFile = @"F:\Documents\UserCost\VictorianDataCollection\VCDCSchema_v2.xsd";
    string strXmlFile = "testXmlExport.xml";
    myDataSet.WriteXmlSchema(strSchemaFile);
    myDataSet.WriteXml(strXmlFile, XmlWriteMode.IgnoreSchema);
    but how do I export the .xml file so that is conforms with the .xsd format?
    If any of you have worked this out the answer would be most appreciated.
    All the best,
    Nick
    "Everything should be made as simple as possible, but not simpler" - Einstein

  • How to parse XML to Java object... please help really stuck

    Thank you for reading this email...
    If I have a **DTD** like:
    <!ELEMENT person (name, age)>
    <!ATTLIST person
         id ID #REQUIRED
    >
    <!ELEMENT name ((family, given) | (given, family))>
    <!ELEMENT age (#PCDATA)>
    <!ELEMENT family (#PCDATA)>
    <!ELEMENT given (#PCDATA)>
    the **XML** like:
    <person id="a1">
    <name>
         <family> Yoshi </family>
         <given> Samurai </given>
    </name>
    <age> 21 </age>
    </person>
    **** Could you help me to write a simple parser to parse my DTD and XML to Java object, and how can I use those objects... sorry if the problem is too basic, I am a beginner and very stuck... I am very confuse with SAXParserFactory, SAXParser, ParserAdapter and DOM has its own Factory and Parser, so confuse...
    Thank you for your help, Yo

    Hi, Yo,
    Thank you very much for your help. And I Wish you are there...I'm. And I plan to stay - It's sunny and warm here in Honolulu and the waves are up :)
    A bit more question for dear people:
    In the notes, it's mainly focus on JAXB,
    1. Is that mean JAXB is most popular parser for
    parsing XML into Java object? With me, definitely. There are essentially 3 technologies that allow you to parse XML documents:
    1) "Callbacks" (e.g. SAX in JAXP): You write a class that overrides 3 methods that will be called i) whenever the parser encounters a start tag, ii) an end tag, or iii) PCDATA. Drawback: You have to figure out where the heck in the document hierarchy you are when such a callback happens, because the same method is called on EACH start tag and similarly for the end tag and the PCDATA. You have to create the objects and put them into your own data structure - it's very tedious, but you have complete control. (Well, more or less.)
    2) "Tree" (e.g. DOM in JAXP, or it's better cousin JDOM): You call a parser that in one swoop creates an entire hierarchy that corresponds to the XML document. You don't get called on each tag as with SAX, you just get the root of the resulting tree. Drawback: All the nodes in the tree have the same type! You probably want to know which tags are in the document, don't you? Well, you'll have to traverse the tree and ask each node: What tag do you represent? And what are your attributes? (You get only strings in response even though your attributes often represent numbers.) Unless you want to display the tree - that's a nice application, you can do it as a tree model for JTree -, or otherwise don't care about the individual tags, DOM is not of much help, because you have to keep track where in the tree you are while you traverse it.
    3) Enter JAXB (or Castor, or ...): You give it a grammar of the XML documents you want to parse, or "unmarshall" as the fashion dictates to call it. (Actually the name isn't that bad, because "parsing" focuses on the input text while "unmarshalling" focuses on the objects you get, even though I'd reason that it should be marshalling that converts into objects and unmarshalling that converts objects to something else, and not vice versa but that's just my opinion.) The JAXB compiler creates a bunch of source files each with one (or now more) class(es) (and now interfaces) that correspond to the elements/tags of your grammar. (Now "compiler" is a true jevel of a misnomer, try to explain to students that after they run the "compiler", they still need to compile the sources the "compiler" generated with the real Java compiler!). Ok, you've got these sources compiled. Now you call one single method, unmarshall() and as a result you get the root node of the hierarchy that corresponds to the XML document. Sounds like DOM, but it's much better - the objects in the resulting tree don't have all the same type, but their type depends on the tag they represent. E.g if there is the tag <ball-game> then there will be an object of type myPackage.BallGame in your data structure. It gets better, if there is <score> inside <ball-game> and you have an object ballGame (of type BallGame) that you can simply call ballGame.getScore() and you get an object of type myPackage.Score. In other words, the child tags become properties of the parent object. Even better, the attributes become properties, too, so as far as your program is concerned there is no difference whether the property value was originally a tag or an attribute. On top of that, you can tell in your schema that the property has an int value - or another primitive type (that's like that in 1.0, in the early release you'll have to do it in the additional xjs file). So this is a very natural way to explore the data structure of the XML document. Of course there are drawbacks, but they are minor: daunting complexity and, as a consequence, very steep learning curve, documentation that leaves much to reader's phantasy - read trial and error - (the user's guide is too simplicistic and the examples too primitive, e.g. they don't even tell you how to make a schema where a tag has only attributes) and reference manual that has ~200 pages full of technicalities and you have to look with magnifying glas for the really usefull stuff, huge number of generated classes, some of which you may not need at all (and in 1.0 the number has doubled because each class has an accompanying interface), etc., etc. But overall, all that pales compared to the drastically improved efficiency of the programmer's efforts, i.e. your time. The time you'll spend learning the intricacies is well spent, you'll learn it once and then it will shorten your programming time all the time you use it. It's like C and Java, Java is order of magnitude more complex, but you'd probably never be sorry you gave up C.
    Of course the above essay leaves out lots and lots of detail, but I think that it touches the most important points.
    A word about JAXB 1.0 vs. Early Release (EA) version. If you have time, definitively learn 1.0, they are quite different and the main advantage is that the schema combines all the info that you had to formulate in the DTD and in the xjs file when using the EA version. I suggested EA was because you had a DTD already, but in retrospect, you better start from scratch with 1.0. The concepts in 1.0 are here to stay and once your surmounted the learning curve, you'll be glad that you don't have to switch concepts.
    When parser job is done,
    what kind of Java Object we will get? (String,
    InputStream or ...)See above, typically it's an object whose type is defined as a class (and interface in 1.0) within the sources that JABX generates. Or it can be a String or one of the primitive types - you tell the "compiler" in the schema (xjs file in EA) what you want!
    2. If we want to use JAXB, we have to contain a
    XJS-file? Something like:In EA, yes. In 1.0 no - it's all in the schema.
    I am very new to XML, is there any simpler way to get
    around them? It has already take me 4 days to find a
    simple parser which give it XML and DTD, then return
    to me Java objects ... I mean if that kind of parser
    exists....It'll take you probably magnitude longer that that to get really familiar with JAXB, but believe me it's worth it. You'll save countless days if not weeks once you'll start developing serious software with it. How long did it take you to learn Java and it's main APIs? You'll either invest the time learning how to use the software others have written, or you invest it writing it yourself. I'll take the former any time. But it's only my opinion...
    Jan

  • XML Marshalling/Unmarshalling

    All,
    I am familiar with XMLBeans and JAXB. However, I would prefer not to use either of these for two reasons:
    I am not a schema guru (not do I want to be)
    I hate code generation in the build processI'm looking for something that would map an X-Path to a Java object. However, I do not want the tool to actually generate that Java object. Rather, a developer will.
    Any technology out there that anyone has used that fits those requirements?
    Thanks,
    - Saish

    BTW, sorry for posting so late, but I am heading out for the day. See you all in 16 hours. :^)
    - Saish

Maybe you are looking for

  • Service PO with Freight Cost

    Hi Experts, Please let me know the possible solution for the below scenario: We have created a Service PO (no service master data), service cost per qty is 5000 and freight cost is Rs. 500 (entered in the condition type). Ex. Sending a Roll for clean

  • Fios not getting max mbps under boot camp

    I have Macbook Pro c2d unibody. I just got Verzion FIOS. Under Mac OS X Snow Leopard I am able to achieve max download and max upload speed. But under boot camp and windows xp sp3 I am only able to get half down, and almost full up. Does anyone know

  • Downloading jars during runtime (Applet).

    I was wondering if someone could give me some example codes on having an applet downloading a jar file from a remote system and loading the jar contents into memory. Do you use JarURLConnection with ClassLoader? or is there something else that I can

  • Zen Micro problem player frozen, can connect to pc, what to d

    hello community, My 6 month old zen micro has frozen after a small drop. I have read of this product freezing at the creative labs screen but mine freezes once it has turned on completely (i see the song/artist/album of the last song i was playing).

  • MIRO invoice reduction balanced amount not zero

    Hi Team, Kindly help as I am getting balanced amount while posting invoice reduction and I am entering the following details: 1) Invoice date 2) Posting date 3) Reference 4) PO & enter 5) Vendor error 6) Entering the vendor amount same as in vendor i