Creating a Java content tree from scratch and then marshal it to XML data

Hi,
After binding a schema using JAXB binding, I wrote a class to create a Java content tree from scratch and then marshal it to create an XML document. To see if the resulting xml document is correct, I opened it in XMLSpy and tried to validate it against the original schema.... I got the following error:
"Unable to locate a reference to a supported schema kind (DTD, DCD, W3C Schema, XML-Data, Biz Talk) within this document instance"
Then I realized that the generated xml document didnot contain the following for the root element:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and xsi:schemaLocation="....."
i.e, the XML Schema Instance namespace and the schema location.
How do I get these attributes incorporated into the XML document generated during the marshal process.
Thanks.

How do I get these attributes incorporated into the XML document generated during the marshal process.
Add xmlns:xsi and xsi:schemaLocation attributes to the root element in the schema.
<xsd:attribute name="xmlns:xsi"  fixed="http://www.w3.org/2001/XMLSchema-instance"/>

Similar Messages

  • JAXB: Creating Java content tree from scratch - examples?

    I'm trying to create XML output by building the content tree from scratch (using a the DDI schema which is fairly complex). I don't have any existing XML instances. Sample application 3 in Sun's JAXB tutorial doesn't give enough info about how to relate the nodes to create the heirarchy. I can create the root node and set it's attributes OK, but then the practical info runs out.
    Can anyone point me at some good practical examples? (i.e. not those of the "How to play the quitar: Put your fingers on the frets and move your other hand around" genre).
    Thanks in advance.

    I don't have examples, but the main thing to remember is that you should use the ObjectFactory to create all of the objects in your tree. That's important.
    You must use the element object class for the root node, but you can use type object classes for all the data contained (you can use element object classes for all the nodes, if that's easier).
    Use the accessor methods to load the data into the objects you create.
    One tip that almost everyone runs into - JAXB only provides a getter for lists - use the getter to get the list, then use .add() methods to add the objects to that list.

  • Creating a external content type for Read and Update data from two tables in sqlserver using sharepoint designer

    Hi
    how to create a external content type for  Read and Update data from two tables in  sqlserver using sharepoint designer 2010
    i created a bcs service using centraladministration site
    i have two tables in sqlserver
    1)Employee
    -empno
    -firstname
    -lastname
    2)EmpDepartment
    -empno
    -deptno
    -location
    i want to just create a list to display employee details from two tables
    empid firstname deptno location
    and same time update  in two tables
    adil

    When I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list.  When I attempt to edit it, I get an error:
    External List fails when attached to a SQL view        
    Sorry, something went wrong
    Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
    I can edit the view in SQL Manager, so it seems strange that it fails.
    Any advice would be greatly GREATLY appreciated. 
    Thanks,
    Randy

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • How to create automatic creation of BP from customer and vendor master data

    Hi gurus,
    can any one tell how to create automatic creation of BP from customer and vendor master data.
    Please give me the steps.
    Thanks
    Sasikanth.

    HI,
    Goto SPRO\ Cross application components \ Master data synchronization \ Synchronization control.
    Assign account groups of customer and vendors to respective BP grouping. This setting is enough to create BP in background while creating customer / vendor. But the fields groups are very much important, ensure mandatory fields should be sync.
    rgds,
    Srini

  • I just bought iPhone 5c. Looking for LifeProof case. Does Nuud will protect my screen from scratches and shatter? Or should I go with Fre?

    I just bought iPhone 5c. Looking for LifeProof case. Will Nuud protect screen from scratches and shatter? Or should I go with Fre?
    Thank you for suggestions.

    Have a look at this comparison from the manufacturer.
    http://www.lifeproof.com/blog/2013/10/nuud-or-fre-lifestyle/

  • How do I start Imac from scratch and the install my backup stuff anew

    How do I start Imac 10.9.2 from scratch and the install my backup stuff anew

    See:
    Mac Maintenance Quick Assist,
    Mac OS X speed FAQ,
    Speeding up Macs,
    How to Speed up Macs,
    Macintosh OS X Routine Maintenance,
    Mac troubleshooting: What to do when your computer is too slow,
    Essential Mac Maintenance: Get set up,
    Essential Mac Maintenance: Rev up your routines,
    Maintaining OS X, 
    Five Mac maintenance myths and
    Myths of required versus not required maintenance for Mac OS X for information.

  • HT2513 I have a mac and an ipad.  when i create and ical event on my mac and then sync to my ipad, the event replicates;   however, when i create an ical event on my ipad and then sync, the ical event does not sync.

    Question:  I have a mac and an ipad.  when i create an ical event on my mac and then sync, the event transfers to my ipad. HOWEVER: when i create an ical event on my ipad and then sync, the event does not transfer.  what am i doing wrong???
    cadybill

    Greetings,
    Go to Apple > Software Update and install all available updates until no more are offered.
    On iPad go to Settings > General > Software Update and install any updates.
    Follow this article for issues with calendars: http://support.apple.com/kb/TS2481
    Hope that helps.

  • I bought my Iphone4S from australia and then moved back to my country which is India. Two days back "GAMES" catogeries was missing from the app store. I have no idea why it went gone missing.I have treied to sign in various times but it doesn't work out.

    I bought my Iphone4S from australia and then moved back to my country which is India. Two days back "GAMES" catogeries was missing from the app store. I have no idea why it went gone missing.I have tried to signing in the app store several times but stil it doesn't show the GAMES catogery. Help me out.

    Try what Terence Devlin posted in this topic:
    Terence Devlin
    Apr 14, 2015 11:21 AM
    Re: Is Iphoto gone ? i want it back!
    in response to Johannes666
    Recommended
    Go to the App Store and check out the Purchases List. If iPhoto is there then it will be v9.6.1
    If it is there, then drag your existing iPhoto app (not the library, just the app) to the trash
    Install the App from the App Store.
    Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
    http://support.apple.com/kb/HT4928
    One question often asked: Will I lose my Photos if I reinstall?
    iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.

  • After creating a mask on a pixel layer and then throwing it away, the pixels disapper

    If I create a mask on a pixel layer and then throw the mask away, the pixels under the old black mask disappear. Help! How do I fix this? I have already reset preferences. I am using the most current version of Photoshop CC 2014 on a Mac with OS 10.9.5

    Or just leave the layer mask in place.  It's a valuable recourse that you might need to use again.  The layer mask exists as an alpha channel.  It's there in the Channels panel when you click on the layer that contains the layer mask.  You might want to restrict an adjustment layer to the same area, or the inverse of that area.  It's not always convenient to do that by clipping — you might be targeting a layer way up the stack.
    OK, you can Ctrl click the layer if you removed the mask by Applying it, but it feels just plain wrong to me to throw a hard won selection in the dustbin.

  • I loaded my ipad photos from camera and all the pictures sorted by date.  Next, I did a sync with my computer and the photos were all reorganized into IMPRT folders an out of date sequence.  Any idea how to put the photos back into date files?

    I loaded my ipad photos from camera and all the pictures sorted by date.  I later sync my ipad with my computer and the photos were all reorganized into IMPRT folders an out of date sequence.  Any idea how to put the photos back into date files other than reloading all of them from camera?

    What version of iPhoto?
    Select one and rotate it. Then rotate it back. Does that make it appear? 
    A much better work flow is the keep the photos after importing.  Check the success the import, wait for at least one successful backup cycle then use you camera's format command to reformat the card
    LN

  • If you bought the iPod touch from somebody and then you locked yourself out of it what should I do because the guy didn't give me his iTunes password?

    If you bought the iPod touch from somebody and then you locked yourself out of it what should I do because the guy didn't give me his iTunes password?

    Sounds like the Activation Lock (iOS 7) is working as designed. It determs theft since y have to know the APple ID's passward to use/restore the iPod foro use. Unless you can get the password you have a nice but thin brick. Likely the iPod was stolen

  • Hi, Is it possible to download music videos from iTunes and then load them onto my classic iPod?

    Hi,
    Is it possible to download music videos from iTunes and then load them onto my classic iPod?
    Thanks,
    GB

    Hey GJBY!
    I have an article for you that can help answer that question:
    iTunes: Frequently asked questions about viewing and syncing videos
    http://support.apple.com/kb/ht2729
    What are the requirements for playing video on mobile devices?
    Mobile Device Family
    Generations that can play video
    iPad
    All
    iPhone
    All
    iPod/iPod classic
    5th or later
    iPod nano*
    3rd or later
    iPod touch
    All
    * iPod Nano (6th generation) does not support video playback.
    To view technical specifications for your device, you can look them up by serial number or browse the Apple Tech Specs.
    Note: Updates to your device may change the iTunes requirements for syncing.
    For additional information about iPod models, refer to Identifying iPod models.
    For additional information about iPhone models, refer to Identifying iPhone models.
    For an overview of where your purchases can be synced, see iTunes Store: Where can I download and sync my purchases?
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • I bought an iphone3g from ebay  and then i tried to upgrade it but it was locked by apple store now what can i do?as it is not my fault and it is not illegal to buy phone from ebay.

    i bought an iphone3g from ebay  and then i tried to upgrade it but it was locked by apple store now what can i do?as it is not my fault and it is not illegal to buy phone from ebay.

    caveat emptor
    x

  • I am switching from an iphone 4s to a 5s. When I try to restore from icloud and then choose a backup, it tells me "No iCloud backups are compatible with the version of iOS on this iphone." How can get into my new phone to update?

    I am switching from an iphone 4s to a 5s. When I try to restore from icloud and then choose a backup, it tells me "No iCloud backups are compatible with the version of iOS on this iphone." How can get into my new phone to update?

    UUpdate the new iphone to iOS 8.3 before you try to restore the backup.

Maybe you are looking for

  • View objects, view links, does not search properly

    Hi, I am using Jdev 11.1.2.0 I have created a search criteria based on view objects and view links. It has entities and entity associations as base. The structure is as follow: vo1 ->vl (1 to 1) - > vo2 ->vl ( 1 to many) -> vo3 Any search attribute w

  • OES CIFS abends periodically

    Hello, Thanks in advance if anybody has an idea about the issue bellow. CIFS Log : Jul 15 00:00:33 hec1 CIFS[6637]: ERROR: CODIR: File Handle list is empty in cache entry for file: share.png Jul 15 00:00:33 hec1 CIFS[6637]: ERROR: CODIR: File Handle

  • Recognizing CD/RW

    Hi all, i have a litte problem to find a solution about the filesystem device. I need for my Gui application to change the icon of a Jtree because i use other icons set to show the device like hard disk icon, cdrom reader and other. I have used the F

  • Sending Email Disappears Sometimes

    I help manage an exchange server for a small business (~100 users).  I have 1 user that says her sent email will disappear from time to time.  This is how she described it:  She creates and email and sends it to several users.  Usually about 30-60 mi

  • I have creative cloud photography plan, but cannot update to Lightroom CC

    When i opened Lightroom (part of my CC photography plan) it said to update to Lightroom CC by clicking the adobe app manager thing on the upper bar of my computer (Mac) and clicking "install" next to Lightroom CC. however, next to Lightroom CC it say