JAXB looking for tag type rather than tag name?

Hi everyone.
I'm trying to use JAXB to load an xml file, [http://www.unimod.org/xml/unimod.xml|http://www.unimod.org/xml/unimod.xml] . The schema is at [http://www.unimod.org/xmlns/schema/unimod_2/unimod_2.xsd|http://www.unimod.org/xmlns/schema/unimod_2/unimod_2.xsd] . I generate my classes using xjc with no problems. My unmarshalling code is simple enough:
try {
    JAXBContext ctx = JAXBContext.newInstance(new Class[] {UnimodT.class});
    Unmarshaller um = ctx.createUnmarshaller();
    return (UnimodT) um.unmarshal(is);
} catch (JAXBException ex) {
}At first I got an exception saying that unimod (the top-level tag) is unexpected and that the expected element is (none). I solved this by adding the @XmlRootElement tag into my UnimodT class. Now I am getting a javax.xml.bind.UnmarshalException :
"unexpected element (uri:"http://www.unimod.org/xmlns/schema/unimod_2", local:"unimod"). Expected elements are <{http://www.unimod.org/xmlns/schema/unimod_2}unimodT>"
I am guessing this means that it is looking for a <unimodT> tag while the actual tag name is <unimod>.
This is how the xml file starts:
<umod:unimod xsi:schemaLocation="http://www.unimod.org/xmlns/schema/unimod_2 http://www.unimod.org/xmlns/schema/unimod_2/unimod_2.xsd" majorVersion="2" minorVersion="0">
    <umod:elements>
          ....and here is the fragment from the xml schema defining the root element:
     <xs:element name="unimod" type="umod:unimod_t">Other guesses I am having are:
1) Maybe I should do something with the namespace, "umod"?
2) The underscore in the type name is confusing xjc?
Please help if you can. I am guessing it is something simple but I have no idea what.

I seem to have solved my problem by adding the namespace and name of the tag on the XmlRootElement annotation:
@XmlRootElement(name="unimod",namespace="http://www.unimod.org/xmlns/schema/unimod_2")however I still don't understand
1) why it's not enough to specify the name of the tag in the @XmlType annotation
2) why the @XmlRootElement tag was not specified automatically
I guess I should just be happy that it works now.

Similar Messages

  • When loading LR4.3 is it necessay to download to Drive c (SSD TYPE) rather than to drive D with 3T?

    When downloading LR4.3 is it necessary to download program to drive C with limited space (SSD type) rather than to drive D with 3T storage or will this not work properly (using a PC with Windows 8)?

    Let's straighten out terminology, shall we?!: It doesn't matter where you download it to, but it matters where you install it. The install will default to your system drive and while you can change the folder for the main part to point to your 3TB drive, some parts will always be installed on your SSD.
    Mylenium

  • List CD as a BOOK type rather than MUSIC

    I imported a CD into my iTunes library (Mac Mountain Lion OS). The CD is excerpts and meditation exercises from a book I am reading. Just wondering if there is a way to have the CD show up as a BOOK type rather than MUSIC?
    Thanks for any help.

    Hi,
    Select tracks the from file menu select File / Get info / Options and change media type to Audiobook.
    Jim

  • Search for a phrase rather than a single word in speech analysis text?

    Is it possible to search for a phrase rather than a single word in speech analysis text?

    Did you try Apache POI?
    It's here:
    http://jakarta.apache.org/poi/

  • I created a website with iWeb but use GoDady for hosting it rather than MobileMe. The images on my Gallery page do not show at all on the external domain but they DO show when seen on MobileMe. Has anyone encountered this problem before? Many thanks!

    Hello al!
    I created a website with iWeb but use GoDady for hosting it rather than MobileMe. The images on my Gallery page do not show at all on the external domain but they DO show when seen on MobileMe. Has anyone encountered this problem before? Many thanks!

    Just create a new page (or use the existing photo page) on your external site and use html to add an iframe sized to the page and link it to the mobilme gallery page. Works for me just fine when showing my gallery from a yahoo site.
    like this
    <iframe scrolling="off" allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;height:100%;border:none" src="http://gallery.me.com/your_account_name"></iframe>

  • Will Logic Pro 10 support plug-in selection by type rather than manufacturer ?

    Will Logic Pro 10 support plug-in selection by type rather than manufacturer ?

    Any comment would be just guessing or wishing, because there is no Logic Pro 10.

  • Why do we gor for SAP BW rather than using the other Data Warehouse S/W's

    Hi All,
    Can any one tell me Why do we especially go for SAP BW, rather than other Warehouse S/W's available in the IT Market.
    Plzzzz..... Reply back me to [email protected]
    Regards,
    Kiran

    Hello Kiran Telkar,
    How r u ?
    1. Multi Dimentional Modelling Concept is available in BW
    2. Most of the 3rd party DataBases could be connected to BW
    3. Very effective Reporting Solution is given by BW
    4. Integration of Transactional Data & Master Data
    5. Tight integration with R/3 and the Business Content functionality, which handles core areas & processes.
    and more !
    Best Regards....
    Sankar Kumar
    +91 98403 47141

  • In "Save As", display as "Kind" rather than by "Name"

    Hi. I have a number of users asking this question. On their Mac, when trying to "Save As", how do they get to sort the contents of the target folder by "Kind" rather than by "Name". The default way results in a muddled display of files and folders. It would be nice to Have all the folders listed, and then the file names. (See below)
    In Finder, I have this button,
    enabling me to get the desired result.
    Thank you.

    rjlee@work wrote:
    Hi
    Sadly...from Text Editor, I dont.
    Click this first (list view):
    Sorry, I should have mentioned, the 'save as' is from Word, Excel etc. In Text editor, I see the Kind header, but it is just a lable, not an active column.
    It can be done in Excel also. 
    (You might have to right-click the colm headings and select Kind to have it listed):

  • TOC based on filenames rather than heading names.

    I created a WebHelp project by linking to a FrameMaker 12 book. After first generating the output, the TOC and index were not included although they were part of the book. I click an icon in the TOC pod to generate the TOC, but the TOC is now based on filenames rather than heading names. How can I fix this?

    You should be posting over in the FM Integration section – you’ll need to adjust your Conversion settings and force an update to suck in the FM TOC and IX

  • HTTP 404 - The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    I have created a web app in our SP 2010 test env. From our dev environment I brought in a content db and attached it to this web app using Mount Powershell command.The command worked without errors.The content db had one site collection in it. When I navigate
    to that site I get the error below.I followed the same approach in dev and didn't have any issues.The content DB was migrated from MOSS 2007 site collection.
    Please help.
    HTTP Error 404.0 - Not Found
    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
    It says the most likely causes are:
    The directory or file specified does not exist on the Web server.
    The URL contains a typographical error.
    A custom filter or module, such as URLScan, restricts access to the file.
    This error means that the file or directory does not exist on the server. Create the file or directory and try the request again.
    Sreeni

    try this trick
    open page in web browser and go to view source and check the file that missing

  • I am looking for this type of mailling list

    HI! I am not sure if its even called a mailing list as most
    of the ones that
    I looked for at Google are newsletter databases. What I want
    is a mailing
    list that when a user subscribes to this email list he will
    receive all
    emails that others have sent to a given address.
    An example of this is at
    http://lists.deconcept.com/listinfo.cgi/flashobject-deconcept.com
    It allows to post all the list members, send email to
    [email protected]
    If one post to the above email address then all members of
    that list will
    receive that post as well.
    This is what I am looking for, does anyone know where I can
    find a ASP
    version of this type of script?
    Paul

    In article <e20ofn$hnn$[email protected]>,
    "Paul" <[email protected]> wrote:
    > HI! I am not sure if its even called a mailing list as
    most of the ones that
    > I looked for at Google are newsletter databases. What I
    want is a mailing
    > list that when a user subscribes to this email list he
    will receive all
    > emails that others have sent to a given address.
    >
    > An example of this is at
    >
    http://lists.deconcept.com/listinfo.cgi/flashobject-deconcept.com
    >
    > It allows to post all the list members, send email to
    > [email protected]
    > If one post to the above email address then all members
    of that list will
    > receive that post as well.
    >
    > This is what I am looking for, does anyone know where I
    can find a ASP
    > version of this type of script?
    >
    > Paul
    My web host (dreamhost.com) provides the service of LISTSERV.
    It's email
    that arrives in your Inbox after subscribing. It can be
    administered via
    web panel. Users can subscribe online or via email to 'you'.
    All email
    is sent from the listserv with the *originator's* email
    address. All
    postings are done to the listserv address.
    While my service is included with my plan, I'm sure others
    provide it
    too either included or extra. I *think* there are different
    types and
    some are definitely better than others (I subscribe to one
    and it's gone
    through several kinds.)
    Important: control such as what happens to reject mail,
    filters, spam,
    bounces, how to sign on, sign off, temporary suspend, and
    more.

  • Searching for tag names

    I have a requirement to perform intermedia searches of xml documents based on tag names. I know it is possible to search for content within tags, but can a search be done on just the tag names themselves?
    If so, what would the syntax look like?
    Thanks.

    There are new features for XML searching in 9i. Please take a look at them: http://technet.oracle.com/products/text/x/Tech_Overviews/text_901.html#xml

  • How do I see the charts for all countries rather than just my own country simultaneously in iTunes? The album chart...

    I produced a song on Lecrae's new album, Gravity, "Higher" f/Tenth Ave North, which is #1 in the US today upon its release. But I've heard that it also topped charts in other countries as well, and do not know how to adjust the Top Album Charts view to show me the top 10 albums in each country rather than just in the US. I've done it before, but over a year ago when Rehab: The Overdose dropped, but can't recall how I did it. Please help! Thanks and God bless...

    I agree that this does work.  Thanks.
    However, I now have the issue that I scroll the whole screen down to show the shows at the bottom.  When I highlight the last show, the 10 shows are not visibile as they are at the top of the screen.  I have to scroll the whole screen back up to the top to see episodes.
    This is not the most elegant solution but at least with lots of double scrolling, it is possible.

  • Vendor payment doc type KZ looking for account type A which is not defined

    Hi Experts
    We are processing a Vendor payment where discount is received, howeve,  the message "For document type KZ, account type A is not defined'  in the job log.
    Can anyone please put some light on this error.
    Many thanks
    Kind regards
    Dawn

    Hi,
    T-code OBA7: there it is defined which doc. type is allowed to use which acount types.
    SAP standard for KZ is to use vendor + GL account types.
    So check your document that you are going tro post or, if you think its ok, post the same document in a test client and enable doc. type KZ in OBA7 to be used with asset account types to view the result of your posting.
    Best regards, Christian

  • Restriction for tag name and column name

    It seems that the XML tag name has to be the same as the
    corresponging column name when using xmlgen.insertXML. Is there
    any plan to relax this restriction?
    null

    Yes, tag names have to be the same as the corresponding column
    names. That is the how we can figure out which tag/element
    should be loaded into which column. This seems to be the simples
    and the cleanest way of mapping tags to columns. Nevertheless, we
    are open to suggestions.
    Also, keep in mind that you can use XSLT to do all sorts of
    transformation (including tag name transformations) to your XML
    document, before inserting it into the database. This might
    solve your problem.
    B Lou (guest) wrote:
    : It seems that the XML tag name has to be the same as the
    : corresponging column name when using xmlgen.insertXML. Is there
    : any plan to relax this restriction?
    Oracle Technology Network
    http://technet.oracle.com
    null

Maybe you are looking for

  • What is the minimum spec for a Macbook Pro to run FCPX?

    I have FCP X installed on my 2009 iMac which has 8Gb of RAM. It works okay, more or less, but I need the portability of a laptop. As cash matters, what is the cheapest Macbook Pro option?  I would boost the RAM to 8gb but what else woud I need? I wou

  • What user name and password does adobe reader want to install reader

    what user name and password is adobe reader wanting in order to install reader?

  • Calendar Events Missing

    Today I opened my iPad calendar, and all the events were missing. It was working fine before, including yesterday. I tried resetting the iPad twice, but this has not worked.

  • Image levels in ODS

    What are those 7 image levels in ODS ? Can anybody give me the correct answers.

  • Interpreting Frame Rate issues

    Hey guys, got a tough one here: I'm rendering Toonboom animations to Quicktime Mov Files at 24fps - although when i import them into Premiere CS6 it will only 50% of the time recognise the correct frame rate - the other times it will choose a random