A really DOM question

very new to the java DOM and here's my (I expect very simple) problem:
I have parsed in an xml file and created my DOM document.
I have searched through the document for the required node.
Now I want to write this node, and all its descendants, out as an xml string - how? There doesn't seem to be any toString(), write(), save() or similar functions on nodes, elements, documents etc

thanks to all, bbritta gets the points (as I don't have any of the books to hand)
The actual code I have now used:
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer xslTransform = transFactory.newTransformer();
Source xmlSource = new DOMSource(myNode);
StringWriter xmlStrWriter = new StringWriter();
Result result = new StreamResult(xmlStrWriter);
xslTransform.transform(xmlSource, result);
String myResultStr = xmlStrWriter.toString());
Somewhere along the line it has added a
<?xml version="1.0" encoding="UTF-8"?>
tag to the front of the result string, but I can cope with that

Similar Messages

  • Possibly really stupid question.

    What I've read about backing up itunes always refers to making sure that your purchased music doesn't get lost. There's a lot of other "stuff" in there also, things that weren't purchased...my own CD's, audiobooks, videos, etc`.
    Here's the really dumb question: If I hook up my external hard drive and copy itunes to it, does everything I have get copied to the external drive...music, videos, whatever?

    I know very little about the file structure on a Windows PC (Apple since 1984). On a Mac, which may be similar to Windows, I just select the *iTunes Music* folder, grab and drag it to the desired location on my external HD and let go. This creates an exact copy of the folder on my external drive.
    As far as getting there (to your *iTunes Music* folder) I can be of little help.

  • This maybe a really dumb question...

    I know this maybe a really dumb question but I do need to ask:
    -Do I need to buy a new vista to install on my new mac?
    (I have a start up one that was included with my previous pc laptop..)
    -In terms of partitioning, how should I distribute space?
    Thank you in advance.

    jlee636:
    The Boot Camp installation guide is [HERE|http://www.apple.com/support/bootcamp>. It should be able to answer questions related to installation. Of course these discussions have several other information on boot camp/ windows. All you need to do is launch a search on them.
    -In terms of partitioning, how should I distribute space?
    Too many people make a partition very small and then regret having done so. My recommendation is to have a partition of at least 32GB. It is highly dependent on what your will be installing on Windows XP/Vista.
    -Do I need to buy a new vista to install on my new mac?(I have a start up one that was included with my previous pc laptop..)
    It is more than likely that the Windows disk that came with your previous PC/Laptop is an OEM disk and will only work properly with that particular PC. This is generally the case with Dell, HP, Sony etc. The installation disk in the cases above are usually branded.
    For more information on which Windows version(s) work with Boot Camp then please click [HERE|http://docs.info.apple.com/article.html?path=Mac/10.5/en/11889.html].
    Axel F.

  • A really easy question...I think.

    Hi everyone,
    I have turned the internet inside-out looking for a simple
    tutorial on this and so far I think they have all taken me kind of
    a long way around. Basically what I want is text/photos/buttons/
    inside the
    box that are
    "scrollable" without having to scroll left or right. My Flash
    document is 800x533px. I've tried doing the whole ScrollPane thing
    going through about 5 tutorials with different methods but it says
    I have to do New Symbol/Movie Clip and the so-called "stage" that
    you construct the movie on doesn't allow you to change dimentions
    as far as I know. I can only change the dimensions of the main
    Stage and the ScrollPane. I feel like this is a simple task so any
    help would be greatly appreciated. I apologize if this is a stupid
    question. Thanks everyone.
    ~Bryan

    kodemonki wrote:
    > Ok, I think this is a really easy question, but I've
    been looking for a while
    > online, in these forums, my site's code, and in my WACK
    book.
    >
    > How do you set a request time out for a specific page so
    that it can run for
    > an hour or so? I'm using 4.5 so I can't use cfsetting,
    but I'm pretty sure
    > I've seen this before.
    >
    > Please help, thanks!
    >
    I have not been able to dig this out, but I have a vague
    memory of there
    being an URL parameter you could pass to a page to allow it
    to run longer.

  • Microsoft Office Update Log -- Really quick question!

    Hey,
    I have an log file entitled, "MAU 1.1.2 Update Log" in my root hard drive folder.
    Probably a dumb question, but can I delete that log safely, it just looks stupid sitting there not serving really any purpose right? Like it's only 16 KB but still, I just wanna get rid of it.
    Should I be alright to delete it? It's just a log file.

    Yup!
    The number leeds me to believe its from an old update. If you haven't done so you should download and install the 11.3.4 Office 2004 patch.
    Get it from here:
    Click Here

  • FF 3.6.10 can't find Bookmarks / DOM question

    Seems like a lot of questions about Bookmarks and FF. I've got a page generated by a server script, in which &lt;a name="xx"/&gt; tags are scattered throughout the HTML. They are inside a &lt;table&gt;, inside a &lt;tr&gt; tag, but outside the &lt;td&gt;'s for that row.
    Are there any limitations on where an &lt;a&gt; tag can sit within HTML, to be properly interpreted by FF?
    When I look at DOM Inspector, the A tags look like they've been relocated outside the &lt;table&gt; which seems awful odd. In any case, the A's don't work in Firefox, but they do work in my IE6.

    There are several video download applications that work on Firefox 4, for example:
    * Video DownloadHelper - https://addons.mozilla.org/firefox/addon/video-downloadhelper
    * Easy YouTube Video Downloader - https://addons.mozilla.org/firefox/addon/easy-youtube-video-downl-10137
    * Flash Video Downloader (Youtube Downloader) - https://addons.mozilla.org/firefox/addon/flash-video-downloader-youtube
    Are there any other add-ons that you particularly want in Firefox 4? There may be updates to them or alternatives.
    To downgrade to Firefox 3.6.* you can uninstall Firefox 4, but do not select the option to "Remove my Firefox personal data". If you select that option it will delete your bookmarks, passwords and other user data.
    You can then install Firefox 3.6.* available from http://www.mozilla.com - it will automatically use your current bookmarks, passwords etc.
    To avoid possible problems with downgrading, I recommend going to your profile folder and deleting the following files if they exist - extensions.cache, extensions.rdf, extensions.ini, extensions.sqlite and localstore.rdf. Deleting these files will force Firefox to rebuild the list of installed extensions, checking their compatibility, and reset toolbar customizations.
    For details of how to find your profile folder see https://support.mozilla.com/kb/Profiles

  • Really basic question: why?

    Why does Java Web Start exist?
    If you want a Java application to run in a browser, isn't easier just to write an applet?

    This sounds good, but it looks to me like Java Web
    Start really doesn't deliver on its promise.It has some issues that are left to be resolved (download of a special JRE seems not to work, some proxy related madness, some stuff involving admin priviledges is not easy..) but in general it is much easier to use than the bl**dy browser plug ins.
    I believe it is the easiest method to deploy Java apps over the web.
    got to install a JRE and JWS in a completely separate
    process, and if something causes the client-side
    configuration to change, it fails.It comes down to one install (JWS which includes the JRE or the new 1.4 JDK/JRE, which includes JWS).
    I still can't it to install correctly, and can't get the demos to run. What system, what problem?
    For my application, running in a browser is ok. I've
    seen some articles that suggest that you can get out
    of the sandbox with a signed applet, although a brief
    look suggests that the procedure for installing a
    certificate is a headache.You sign the jars (one command line call) and your users have to click "yes, I accept" one time - this is not too much asked.
    So the question remains: why use JWS, given that
    installation is more difficult than for an applet?You can do real apps (not bound to the browser windows) and you can deploy different versions (updating is easy).
    All in all this is a developing technology, which is already very useful.
    Regards,
    Marc

  • Two really embarrassing questions from iPod newbie!

    Although I've been using Macs since the steam-powered Mac SE, I've never actually owned an iPod (until now), because I never listen to music 'on the go'.
    However, I've just ordered an 80Gb Classic from the Apple Store, principally as a handy way to have all the songs I've written or played on in one handy, small location.
    However, because I've never owned one before, I have a couple of questions that probably seem +really stoopid+ (red face)...
    1. I guess I will copy all the songs from CD to iTunes on my iMac and then upload them to the iPod. But will I have to keep all those songs in iTunes? If I subseqiently delete them from iTunes, will they be automatically deleted on the iPod the next time I try and copy any songs from iTunes to it?
    2. When I copy the music files to iTunefrom CD, can I copy the music files to an external Firewire HD, not my main hard drive? There are a lot of songs to copy and I don't want to fill a significant chunk of my main hard drive if I don't have to. Would iTunes 'see' them on an external HD? Or can I copy them straight from the CDs to the iPod via iTunes, without physically copying them to an HD at all?
    Sorry for the basic questions, I hope someone can help.

    Robin,
    You might want to consider a few things before you wipe your iTunes library clean (assuming you have already trasnfered them onto your iPod).
    If, for some reason, you need to restore your iPod and put music back on, iTunes will have to transfer that music back to your iPod. If you have wiped your iTunes library clean that could mean spending a lot of time REformatting your music collection to put back on your iPod.
    Also, I have had a few instances where, although I have iTunes set to 'manually' manage my transfers, iTunes has deleted all of my music. Thank God I had my library on my hard drive as it only meant a 20 minute sync to transfer 6,000 songs back on.
    If hard drive space on your desktop or laptop is limited, iTunes offers a way to 'backup' the library on DVD+R or similar media. So, for about $10 in blank DVD costs, you can just make a portable backup to put in a drawer.
    Just PLEASE think about these issues before you put music on your iPod and delete it from your hard drive. From experience, things happen and you don't want to go through the 'ripping' hassle again! (ripping, the term for making mp3/wma/aac files from a CD)
    Last, if this is your first attempt at putting your music collection on your computer, you might want to keep them there. You might be surprised at how handy it is to have all of your music in one place close by, especially if you invest in a pretty moderately priced speaker setup for your computer.
    Best of luck!

  • 2 (promise) really backward questions

    Please forgive this - I truly did search the web, but couldn't find a clear answer.
    I have GoLive CS2 and wondered if it can still be used to design a website, not merely for upkeep/updating an existing site.
    The second question is if I can then transfer the created website via CD from an offline G4 tower to an online iBook G4.
    Thank you so much for any reply. I do know these idiot questions are annoying, and promise not to impose again. I'm a portrait painter and really need to create a site. I'll be reading and learning here only after this, not interrupting.
    Sanford

    Thanks ever so much! I've tried repeatedly to sign back in, to thank you 'publicly' in the thread (have checked both my ID and password, but to no avail). I'll keep trying.
    Super forum, and thanks to you, I'll be able to forge forth!!

  • A really stupid question from newbie...

    hello all,
    i am very new to java and i am trying to build a j2ee application...
    rite now....i need to let my app communicate w/ an outside program thru' XML..
    i had just learnt many thing about java w/ xml and i decided to use the XMLEncoder... it seems quite simple to use...BUT i have no idea on how to send/receive these XML files...i had thought of using socket connection, but i just found out that an EJB wouldn't allow socket networking... i bet this must be quite a stupid question coz i found nowhere teaching me this...=P
    if u know about this, pls point me to some relevant docs / sites....i am anxious to learn about it...
    thx so much,
    karloogunna~

    hello maesj, rune, and others,
    thx alot for your advice...
    and here's the environment i am working in:
    OS: w2k
    JDK: 1.4.1.01
    j2ee: 1.3.1
    jboss: 3.0.2
    i am using flash as my UI, so i need communication
    between the j2ee app and flash.
    the data transfer involves a number of arrays of
    objects (each object w/ a list of attributes...) so, i
    think using XML as data-exchange is quite suitable (am
    i wrong on this??)I don't know the first thing about Flash, but using XML as a means for exchanging data seams like a good idea, for the scenario you described.
    >
    and i am reading about the message-driven beans, i see
    that they got a function onMessage() from where i can
    get the XML strings (?), but i don't know how i can
    feed these strings into this JMS from flash...do i
    need to write a small java program on the client
    side?I haven't that much experience with Message Driven Beans. What I do know is that they employ the Java Messaging Service (JMS). If you write a small client appplication with JMS support... you might be close.
    >
    also, i am not sure if i can send out XML strings
    through the message-driven beans, i am reading on the
    JMS...it got the MessageProducer, MessageConsumer,
    MessageListener, and MessageSelector....should i be
    using this? or can i use this together with the
    message-driven beans??
    In a Messaging system you will need message producers, and message consumers. To enable two-way communication, you can setup both the EJB and the client to handle both. When a message arrives at the consumer (or subscriber if you like), the JMS Service invokes the onMessage method. So you should implement your logic in the onMessage method, for example inspect the XML content, and act upon its content.
    i am very sorry for my disorganized questions...(i
    used to do low-level programming =P)
    and really thank you for your advice!!!!
    No problem, the amount of information to read can be quite overwhelming. Using JMS is just a suggestion, and might be considered overkill for your application. If you're using an IDE, like Sun ONE, creating a message driven bean is easy, and can be tried out, without too much hours passing.
    Kind Regards,
    Rune Bj�rnstad.

  • Really stupid question - Migrating from 6i to 11g

    Hi all,
    I'm a developer that have been working with oracle since Forms 3, right now I use Forms 6i and I would like to know what I need to use Forms 11g. I understand this new environment is web based, but to start developing and deploying, what I need? for example if I buy the Oracle Forms & Report 11g, I also will need the OAS? or just with Forms and Report I could deploy (somehow) the application?
    Please don't flame me, I just want to understand how this works now.
    Best Regards

    As my old college profession used to say - "The only stupid question is the one that doesn't get asked!" Forms 11g only supports web deployment. This means you will need the OAS with the Forms and Reports Services installed as well. Typically, the setup is three tiered ( 1 server = Database, 1 server = Application Server, 1 server = Infrastructure server ). You don't have to set up the technology stack multitiered - all three could reside on the same server or you could have the all three on the same machine but is not recommended. I would at least have the database on a server seperate from OAS.
    Here are a few links to get you started.
    Oracle Documentation
    * Check out: Development Tools - Oracle Forms, Middleware - Applications Server - Oracle Fusion Middleware 11g and Middleware - Data Warehousing and Business Intelligence - Oracle Reports
    Since you will be upgrading from Forms 6i to 11g, be sure to visit the Oracle Forms-Upgrading Forms 6i to Forms 11g documentation.
    BTW, welcome to the forums!
    Craig
    If a response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on May 6, 2010 2:09 PM

  • Really stupid question

    I am looking at a machine with a database and developer tools installed and tested.
    However there is a directory with 9iAs structure.
    Question: How can I test to know if app. Server is installed?
    Note:
    This is a machine that is being recovered so I don't
    know who did the installs.

    True, on BES 4.1 and later, PIN messages can be logged via the IT Policy of the your employer. Whether or not they are logged, is up to your BES Admin or corporate policy.
    That is logged by your employer, not RIM.
    If you are on a corporate BES account, consider nothing confidential.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Really dumb question re Quicktime Pro

    Good morning . .
    My Mac is running OS 10.4.9 and I have updated my Quicktime player to 7.3.1.
    Purchased Quicktime PRO, registered successfully but still only get Quicktime Player when opening the program. Any suggestions where to find QT Pro? Sorry for the dumb question but thanks for your help.
    Jon

    There is no separate QT Pro application. Successfully registering Pro enables Pro features already present in the Player. Items that previosly mentioned Pro should now just list the feature without mentioning Pro.
    Message was edited by: Dick Napoli

  • Really quick question about printing a book

    hello,
    always asking questions... but you people on these forums are super nice and smart....
    if i should upload the pictures to iphoto to print a book should i export the pictures as AdobeRGB 1998 or ProPhotoRGB .jpegs????
    the website only says jpegs..... what would my best choice be.....????
    answers are appreciated and thank you in advance

    Yes - do not use Adobe RGB - sRGB is correct
    and test a few photos - some people have had problems importing Lightroom edited photos into iPhoto
    LN

  • Really basic questions about dvd

    I have figured out that if I slide a DVD into the slot on the right side of my iMAC, then after a pause an application called "DVD Player" will open and the DVD will play.  I have also discovered that to get the disk OUT I can find an image of it on the desktop and drag it to the trash which changes to show an upward pointing arrow.  Or I can right click on the icon and select "Eject".
    Where do I go to get answers to the following questions:
    Are there other choices for the application that plays my DVD?
    Can ITunes play this DVD?

    1. Only if you've installed any(or Apple's MPEG-2 playback component for unprotected DVDs).
    2. No, not even if the playback component is installed. That codec enables the QuickTime Player and similar applications to play unprotected DVDs.
    (60720)

Maybe you are looking for