Best way to use JAXB for this problem?

I have an input XML which is very large and complicated. It comes with it's own schema
I only need to extract a few parts of the data contained in that XML, scattered throughout the document. I care not about most of the XML file but I do care about performance and overhead so would like to perform a Special Ops mission where I go in without anyone noticing, grab the data I need, and get out before the thing becomes a mess.
Can I do this simply with JAXB?
If so, what is the best approach, from a high level perspective?
I am totally new to JAXB.

I agree with gimbal2 because, as far as I can see, jaxb is intended for "mapping" a xml tree to a very similar structure of classes.
When you say that your xml is complex I assume that it has many nesting levels. This means many jaxb classes (say about one-per-level) ... in order to retrieve few elements.
An Xpath approach requires only one line of code per element.
I usually use the library dom4j for this kind of job.
bye

Similar Messages

  • What is the best way to store data for this project?

    hey everyone,
    I have been subscribed to this for a while, not sure if I have ever actually asked anything though.
    I have a project on the go for myself/portfolio
    It is a booking sheet, where by I have a GUI that has a diary system of a day followed by time slots. This also has a date picker that can change the date of the booking sheet
    I want to be able to store mainly strings and ints,
    I need to be able to store, retrieve and on occasion change some data.
    I was looking at using something called JExcelAPI but I cant get that to work at all, I asked for assistance but was refered to here.
    what would be the best way to implement this data storage?
    davyk

    Hey everyone,
    Back again,
    I got this this little snippet of code working but want to ask you guys for a little bit of help on it. if thats ok?
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         String dataSourceName = "mdbTEST";
         String dbURL = "jdbc:odbc:" + dataSourceName;
         Connection con = DriverManager.getConnection(dbURL, "","");
         // try and create a java.sql.Statement so we can run queries
         Statement s = con.createStatement();
         s.execute("create table TEST1234567 ( column_1 char(27), column_2 char(150), column_3 char(150), column_4 char(150), column_5 char(150), column_6 char(150))"); // create a table
         s.execute("insert into TEST1234567 values('"+date+"','"+a+"','"+b+"','"+c+"','"+d+"','"+e+"',)"); // insert some data into the table
         s.execute("select column_7 from TEST1234567"); // select the data from the table
         ResultSet rs = s.getResultSet(); // get any ResultSet that came from our query
         if (rs != null) // if rs == null, then there is no ResultSet to view
                    while ( rs.next() ) // this will step through our data row-by-row
              /* the next line will get the first column in our current row's ResultSet
              as a String ( getString( columnNumber) ) and output it to the screen */
                   System.out.println("Data from column_2: " + rs.getString(1) );
         s.execute("drop table TEST1234567");
         s.close(); // close the Statement to let the database know we're done with it
         con.close(); // close the Connection to let the database know we're done with it
    catch (Exception err)
         System.out.println("ERROR: " + err);
         err.printStackTrace();
    }there are more columns, but i cut this code down.
    my question is:
    I think I want a method with an if statement to see whether the table is created or not, if not create it, but how do I go about this? I have searched the API and google, but my brain is fried.
    Also do I always have to do the try/catch and have the code of Class.forname to Statement s in all methods that want to deal with the table?
    davy

  • Best Way to Use iPhoto for Lectures?

    The old utility "iphotowebshare" turns itself off frequently under Mavericks, so I'm forced to look for a better way to do what once worked perfectly.
    Here's my situation:
    I've got a few hundred images in an iPhoto library that I have been using for class lectures.  These images are sorted into nice, discrete albums, each of which is named for a specific day's lecture.  Everything's so well organized in iPhoto, that the thought of moving everything somewhere else makes me cranky.
    Here's what used to work:
    Running in the background (accessed via System Preferences), "iphotowebshare" makes all these albums available via web interface.  I don't have to export the images.  I don't have to remember to click the right buttons to sync different applications.  I don't have multiple versions of my images floating around in different places.
    The only thing I've had to worry about is iPhoto.  I can reorganize, retitle, re-order, annotate, and otherwise mess with my iPhoto images right up to the second that I'm supposed to be in class.  Then I can walk away from my office and expect to find my images available in my classroom, just as I've most recently assembled them in iPhoto.
    "iphotowebshare" seems simply to make my iPhoto Library—as it is, and as it changes—available to a simple web page (that "iphotowebshare" itself builds and makes available on port 8080).
    Only problem, now, as I've mentioned, is that the "iphotowebshare" System Preference keeps turning itself off.
    So, reluctantly, I have to adopt a new method, and a couple of hours with Google has not turned up an alternative that does what "iphotowebshare" has been doing so nicely for years.
    I spent thirty minutes or so messing with the iPhoto-Flickr sync, but found that iPhoto is creating new, duplicate "synced" albums beside the albums I've already created.  Syncing between iPhoto and Flickr requires deliberate button clicking (I know: First World Problems. But I'm confident that I will forget to click the sync and then will find myself in class with an obsolete arrangement of images).
    Any advice?  Simpler the better.

    I'm aware that iphotowebshare is problematic and un-updated.  That is, in fact, the problem.  Because with iphotowebshare, iPhoto works perfectly well as a presentation tool in my circumstances.
    Because my circumstances haven't changed, even if software has, what I'm trying to find is something that does what iphotowebshare does (without intermittently shutting off) or that duplicates the same functionality (which is, basically, to put my iPhoto library on the web, live, without bothering me).
    A secondary app will require deliberate second and third steps, not to mention some extra care about how these images get made available online.
    Besides iPhoto is a "presentation tool" to the extent that it's designed to "present" one's images (via slide shows [with a soundtrack, no less] and printed books, if nothing else).  So, I'm pretty sure I'm not asking for an apple to be an orange, so to speak.  Especially since iphotowebshare has demonstrated iPhoto's functionality in this respect.

  • Advice/opinions on best way to use Flash for website

    Hi
    I am working on an animation in After Effects (dimensions 1000px x 350px) which will sit in the masthead area of a website. I intend to render from After Effects as a flv (or as uncompressed avi and then convert to flv) and then import this into a mc and export as a swf to be placed in the masthead. However, I would be grateful for some feedback/suggestions on a couple of points...
    My guess is that the final swf of flv will be about 9mb, which is quite hefty. I need the quality to be good and crisp. If you look at the excellent CS5 trailer on the adobe.com home page you will get an idea as to the quality I need. I'm guessing this is a fairly large file yet it plays great with hardly any pre-load. Any ideas how they achieve this? Using Media Server or streaming video isn't an option for me, only bog-standard progressive download.
    One thing I thought was to break the animation down into a number of swfs and load these one after another. It needs to be seamless. Would that work - any ideas?
    Ok,  hope this post isn't too rambling. I'm excited about the project, but I could do with some ideas as how best to get a good looking video or swf to play in the masthead without long preloads etc.
    Thanks in advance.

    It will probably be easier to manage if you make each section a moiveclip by itself,  That way you aren't always manipulating the main timeline to fit in or adjust for changes in each section.  You can either spread them out along the timeline, using frame comands to navigate to the different sections, or you can have them all in one frame and control navigation by controlling the visibility of each section.
    If the frame you mention is to be applied to each section, then having one on the main timeline to cover all would be easier to manage in most cases.

  • Best way to use `checkupdates' for status line

    Hey there,
    I want to have the number of packages for which there exist updates to be indicated in the status bar of dwm. (At the moment I create my status bar via a shell script, not via a C program. Most importantly the script displays at the moment the number of new emails and the date/time.)
    This was my first attempt (other functions and custom colors stripped):
    #!/bin/bash
    pkg(){
    nbr="$(checkupdates | wc -l)"
    echo -en "$nbr"
    xsetroot -name "... $(pkg) | $(date "+%d. %b %H:%M")"
    After the script has been executed it will be launched again after a sleep of two seconds. Now I wonder if it is considered good practice to execute `checkupdates' every few seconds. I guess it is not. What could be the downsides? Problems when invoking pacman in order to update?
    The other way I thought of was to check for updates only every hour via cron and redirecting the number of package updates into a temporary file and reading that file in the status script. But this has a major downside: After updating with pacman, the number of packages to be updated doesn't change until next invocation of the cronjob...
    How would you handle such a notification?
    Edit: Sorry wrong forum. Please move the topic. :-(
    Last edited by ball (2013-08-08 17:48:55)

    #!/bin/bash
    let loops=0
    while true; do
    [[ $(($loops % 150)) -eq 0 ]] && pkg=$(checkupdates | wc -l)
    [[ $(($loops % 30)) -eq 0 ]] && email=...
    xsetroot -name "$pkg | $email"
    loops++
    sleep 2
    done
    This will run checkupdates every 150 times through the loop (every 5 minutes) and do the mail check every 30 (every minute), but print out the latest result from each every time through the loop.  Obviously, the mail part has to be filled in with whatever you use.  This is just to show how to only update at certain intervals rather than wasting processing on something that may not be that dynamic.
    EDIT: for regular use I suppose their should be a check on "loops" to avoid overflow.  At the last line of the loop, for example, add
    [[ $loops -eq 4500 ]] && let loops=0
    Last edited by Trilby (2013-08-08 18:24:58)

  • Question: Best way to use MR for BOS - PIT flight

    Hi all, In august I'm flying to pittsburg from Boston and wanted some advice on making the most of my MR (or whether I should just save my MR for some other use). I've got ~57K MR to play with. Since The flight distance is <650 miles I was thinking avios would be the way to go if I could get a direct US airways flight. I know these exist from the US airways page, but when I search for it on the BA website nothing comes up...does this mean they can't be booked with avios? Do I have any other good options? Jetblue does the flight too, but for more around 16k points each way (and the MR:trueblue ratio is not even 1:1), and delta can do it with layovers for 10k each way. Am I missing anything? Thanks!

    njharlen wrote:
    Hi all, In august I'm flying to pittsburg from Boston and wanted some advice on making the most of my MR (or whether I should just save my MR for some other use). I've got ~57K MR to play with. Since The flight distance is <650 miles I was thinking avios would be the way to go if I could get a direct US airways flight. I know these exist from the US airways page, but when I search for it on the BA website nothing comes up...does this mean they can't be booked with avios? Do I have any other good options? Jetblue does the flight too, but for more around 16k points each way (and the MR:trueblue ratio is not even 1:1), and delta can do it with layovers for 10k each way. Am I missing anything? Thanks!One way?

  • Best approach for this problem

    Hi there Experts,
    I have an Async Sync Bridge BPM, to go from Delivery Idocs to Webservice Calls, after that i map the response to a an ALEAUD Idoc structure and i send it back to erp to update the Delivery Status.
    Currently its working as intended on production system, but the Deliveries quantity is growing exponentially, raising the response times for the whole process.
    I found a solution for this problem, instead of making 1 Webservice call for each delivery, i can group those deliveries and send multiple deliveries per each webservice call, the problem i have appears when i need to map this response to single ALEAUD Idocs.
    To Update the original delivery Idoc i need that idoc number onto the ALEAUD, but the webservice returns the response based on delivery number, therefore i need a mechanism, maybe a temporal table or something, that allows me to store the idoc number with the matching delivery number so i can use it as reference to map the huge response to single ALEAUD Idocs, also i'd like to know if this is possible to achieve using graphical mapping or wich would be the best way to do it.
    Thanks for all the input on the matter,
    Regards,
    Roberto.

    Maybe you can write 2 RFC function modules to maintain values in ECC and the other to read it. These RFC's can be called from within mapping.
    I dont know if it will work or not, but can be tried.

  • Does Adobe Reader for iOS have the ability to open inbedded links to additional PDF docs?  If not, then what would be the best way to use these already created PDF's?

    Does Adobe Reader for iOS have the ability to open inbedded links created with Acrobat Standard to additional PDF docs?  If not, then what would be the best way to use these already created PDF's on an I Pad?

    driddy61,
    As of June 2014, none of the Adobe Reader mobile products support the hyperlink action for opening a separate PDF document.
    Adobe Reader for iOS
    Adobe Reader for Android
    Adobe Reader Touch for Windows 8
    In addition, the Reader mobile products do not open multiple windows/documents simultaneously, which would make the navigation between PDF documents nearly impossible. (Once a hyperlink takes you to a different PDF document, you have no way to go back to the original PDF document.)
    The only Adobe Reader product that fulfills your department's requirements is Adobe Reader XI (mostly for Windows/Mac desktop/laptop computers).  Acrobat Pro and Standard are paid products.
    Because you are in search of a less expensive device for your department, you could get a Windows tablet instead of a Windows desktop/laptop computer. Microsoft Surface Pro (that you've mentioned in your previous reply) is just one example.  You can also find other less expensive Windows tablets.
    Tablets
    However, please keep in mind that there are two different types of Windows tablets running two different operating systems.
    (a) A Windows tablet with an Intel-based processor running Windows 8.1 Pro
    Example: Surface Pro 3
    You can install and run traditional desktop apps (e.g. Adobe Reader XI) and new Windows Store apps ("Modern" or "Metro-style" apps).
    (b) A Windows tablet with an ARM-based processor running Windows RT 8.1
    Example: Surface 2
    You can only install and run Windows Store apps (e.g. Adobe Reader Touch) but not traditional desktop apps like Adobe Reader XI.
    In general, type (b) tablets are more affordable than type (a) tablets.  However, if you want to run Adobe Reader XI, you do need to check the technical specification of each tablet and make sure the following conditions are met.
    Processor: Intel
    Operating system:  Windows 8/8.1 or Windows 8/8.1 Pro, not RT
    Hope this helps you choose the right device for your department.  Please let us know if you have any questions about system requirements or supported features in the Adobe Reader products.

  • Can someonoe please assist me in my Adobe Photoshop CS6 Extended.  I keep getting a 'Couldn't Complete Your Request because Dynamic Link is not Available?" Is there a way of getting a software patch for this problem?  I thought you didn't need extra softw

    Can someonee please assist me in my Adobe Photoshop CS6 Extended.  I keep getting a 'Couldn't Complete Your Request because Dynamic Link is not Available?" Is there a way of getting a software patch for this problem?  I thought you didn't need extra software.  My software other than that problem works fine.

    Couldn't complete what request?   Way more information please.
    What operating system?

  • TA24002 My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know which erase option would be the best solution for this problem.

    My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know what option would be the best solution for this problem?

    You appear to have two issues: 1) a hard drive that is not working properly and 2) files you wish to recover.
    Re 1) you need to answer Kappy's questions.
    Re 2) does the drive load and can you see your photo files? If so can you copy them to another drive?
    Do you not have a backup of the photo files?

  • I have problems in the initiation of the Encore process when opening presents the following error message : "Encore CS6 Cannot Run in Non-Royalty Serialized".... What is the best solution for this problem ?

    Help Me.
    What is the best solution for this problem ?

    Encore is activated when you activate Premiere Pro... so, as Stan asked, how did you install P-Pro?
    Ask for serial number http://forums.adobe.com/thread/1234635 has a FAQ link
    -and a fix for Encore http://forums.adobe.com/thread/1421765?tstart=0 in reply #7
    -plus more Encore http://helpx.adobe.com/encore/kb/cant-write-image-fie-larger1.html

  • I am using photoshop cc 2014.2 And when I use save for Web it gives me a dialog box that says it is using Latin characters I've never seen this before. Does anyone have an answer for this problem or do I need to go back to the older version of Photoshop.

    I'm using Photoshop cc 2014.21 I you save for Web and dialog box comes up that says that Photoshop is using Latin characters and that servers cannot recognize Latin characters in webpages and you may have trouble viewing these pages does anyone have an answer for this problem?

    What Firefox version is currently installed on the computer?
    You can find the full version of the current current Firefox release (37.0.2) in all languages and all operating systems here:
    *https://www.mozilla.org/en-US/firefox/all/
    If you have a very old Firefox version then you could consider to uninstall that version to clean up existing registry keys (especial the uninstall key).
    Make sure NOT to remove "personal data" when you uninstall Firefox, because that will remove all profile folders and you lose personal data like bookmarks and passwords including data in profiles created by other Firefox versions.
    Check the Firefox program folder and remove the Firefox program folder if there are still files left in it.
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure NOT to remove personal data when you uninstall Firefox as that will remove all Firefox profile folders and you lose your personal data.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • I can't connect my personal hotspot using wifi,I can able to find my iphone4 but it's just showing obtaing ip adress ??wat can I do for this problem??

    I can't connect my personal hotspot using wifi,I can able to find my iphone4 but it's just showing obtaing ip adress ??wat can I do for this problem??

    Hey there arunvdi,
    It sounds like you are unable to connect to the Wi-Fi created by your Personal Hotspot. I recommend these troubleshooting steps from the article named:
    iOS: Troubleshooting Personal Hotspot
    http://support.apple.com/kb/ts2756
    Try disabling and reenabling Personal Hotspot from Settings > Personal Hotspot or Settings > General > Cellular > Personal Hotspot.
    Reset network settings by tapping Settings > General > Reset > Reset Network Settings.
    Wi-Fi troubleshooting
    If you encounter an issue using Personal Hotspot with other Wi-Fi devices, try the following:
    Turn Personal Hotspot off.
    Verify Wi-Fi is on in Settings > Wi-Fi.
    Turn Personal Hotspot back on.
    If another device is unable to join your Wi-Fi network, ensure that the user enters the Wi-Fi password correctly. If the device cannot see your Wi-Fi network, verify your device name.
    Note: Windows may not properly display a device name that uses non-ASCII characters.
    Verify how many devices are currently using your Personal Hotspot. Depending on your wireless carrier and, the maximum number of Wi-Fi connections may be limited to three at one time.
    If the other device still cannot connect, try turning Wi-Fi off and on again on the device. Verify that your device can see other Wi-Fi networks.
    Note: If you see an "Unable to Join" or timeout error when trying to connect a device using Wi-Fi, ensure that you remain on the Personal Hotspot screen until the first device connects. After a device has connected, you can leave the Personal Hotspot screen and use your phone normally. Your device will automatically stop broadcasting using Wi-Fi if you put your device to sleep or after 90 seconds elapse with no devices connected using Wi-Fi. You can start broadcasting your Wi-Fi network again by tapping Settings > Personal Hotspot.
    If none of the previous steps resolves your issue, restore the iPhone.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • I am leaglley blind I use a 5 inch window at the top of my screen to see what I am typing. This version does not let me see what I am typing because the window drops down about 1 to 2 inches, obscuring what I am typing. Is there a fix for this problem?

    If there is no fix for this problem, how do I go back to the previous version?

    laderamacguy took a look at it and added a black shape over the tab. he suggested i use a different template next time, such as the black template.

  • HT4484 i used to have an app store and lost it and i created a new one and i can not update the iphoto app because it was updated with the old account, is there a solution for this problem?

    i used to have an app store and lost it and i created a new one and i can not update the iphoto app on my macbook pro because it was updated with the old account, is there a solution for this problem?

    Content and Apple IDs -
    Content is forever tied to the Apple ID that bought it. Apple does not transfer content from one Apple ID to another. Apple does not merge Apple IDs. You will never be able to access your content bought with one Apple ID with a new Apple ID.

Maybe you are looking for