Help with creating a new XML file from an existing DOM tree!!

i want to create a new XML file from an existing DOM tree
i used this code to create a new document:
static public Document createDocument(String fileName) throws ParserConfigurationException//,IOException,SAXException
          try {
               DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
               factory.setIgnoringComments(true);
               factory.setIgnoringElementContentWhitespace(true);
               factory.setValidating(true);
               DocumentBuilder builder =factory.newDocumentBuilder();
               return builder.newDocument();
//          handle exception creating DocumentBuilder
          catch ( ParserConfigurationException parserError ) {
                    throw new ParserConfigurationException();
          }then i used this code to transform the DOM :
public void exportDocument(Document document) {
          try {
               Source xmlSource = new DOMSource( document );
               Result result = new StreamResult( System.out );
               TransformerFactory transformerFactory =
                    TransformerFactory.newInstance();
               Transformer transformer =transformerFactory.newTransformer();
               transformer.setOutputProperty( "indent", "yes" );
               transformer.transform( xmlSource, result );
       //then catching the exceptions
But the file was not created and i didn't find where can i specify the DTD that the XML file should use and where can i enter the name of the XML file itself
Another questoin can i write a DTD file dynamically during the execution of the program??

Cross-post: http://forum.java.sun.com/thread.jspa?threadID=784467&messageID=4459240#4459240

Similar Messages

  • Create a new MP3 file from an existing AIFF or MPEG file

    The iTunes 9 on my old Mac allows me to create an MP3 version of a song track in the Advanced pull-down menu. The iTunes 10 on my new iMac only allows me to create an AIFF file in Advanced. Is there a way to make these conversions in iTunes 10? I want to be able to create a CD using MP3 files (of classical music NOT purchased from the iTunes store). Thanks for advice.

    The conversion setting in the Advanced menu reflects the Import Setting in iTunes > Preferences > General. Change the Import Setting to MP3 and the Advanced menu will also change to MP3. When you have finished your conversions, reset the Import Setting to the format you prefer.

  • Best Practice for Creating a New WebHelp Project from an Existing One

    I'm currently working in WebHelp Pro (RH version is 9.0.2.271).
    I have a WebHelp project which currently supports the 2012 version of one of our projects. What I needed to do was to create a separate 2013 project, using the 2012 files as the starting point. I couldn't find a way in RH to create a new project by importing an existing WebHelp project, so I copied the 2012 files to a new directory, opened up the project, and renamed it.
    What prompts this question is that following this exercise, all seemed well, for a time. However, I have recently had to create new topics in the 2012 version. However, when I imported these topics to the 2013 project and compiled, they vanished--although the htm files still appear in the appropriate 2013 file folder (when viewed with Windows Explorer).
    After reading some forum postings, I thought that I might have corrupted my database by improperly creating the new project--but if what I did is the wrong way to go about it, I'm not sure what the correct way is. I will be grateful for any suggestions.

    The easy way to do this is create a copy using Windows Explorer.
    Open the project and go to File > Rename.
    Then you have your 2013 ready made project.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Help with creating a new document

    Hi,
    I will have to work on creating a new document from scratch which will serve as a billing statement to a customer.
    I have to construct it and I am really confused on how to structure my forms and subforms.
    Can any of you please point me to a right place where I can get a good design guidelines?? Or is there anything like a good design for this.
    Will the form structuring impact performance. This document can run really long based on the number of transactions.
    I am using castor and object to xml mapping and using the data file to dynamically load the data on to pdf.
    Since I am going to start this fresh, I want to get the structure and design correct.
    Appreciate your time and help.
    Thanks

    A document was produced for Designer 7.1 and the principles still apply.
    http://partners.adobe.com/public/developer/en/pdf/lc_designer_perf_guidelines.pdf
    You can poke around here as well....
    http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm
    Steve

  • Help with XQueriyng an AWS XML file

    --Oracle Database 11g Express Edition Release 11.2.0.2.0 - Beta
    I am trying to query an XML file returned from Amazon AWS. I'm learning this slowly, and i think examples would really help . I'm reading and looking through the documentation " [Using XQuery with Oracle XML DB|http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_xquery.htm] ".
    I made an batch of 2 ItemLookup requests to AWS, which returned one item for the first lookup, and two for the second, which i think is a good example. I used a bogus account id (it's used for tracking) and a key pair which i deleted after using it, so it is the actual reply. It is too large to be passed as a literal, so i put it on pastebin. It shows a valid request. There are two levels of validity, one is no error, the other IsValid. Had there been an error, like a missing parameter, the following would be between the </Arguments> and <RequestProcessingTime> tags:
        <Errors>
          <Error>
            <Code>AWS.MissingParameters</Code>
            <Message>Your request is missing required parameters. Required parameters include ItemId.</Message>
          </Error>
        </Errors>Meaning, first the XML document must be checked for the Errors tag; second, the IsValid element must be True; third, actual data can be perused. The Errors tag mean there may be multiple errors. The IsValid is per Items (not Item). Then individual details may be grabbed, such as ListPrice.
    I'm guessing XQuery is the right way to go here, using XMLTABLE to create records to be queried. Here is what i have so far:
    SELECT
    FROM
         XMLTABLE
          XMLNAMESPACES(DEFAULT 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'),
          '/ItemLookupResponse/OperationRequest/Errors/Error,
         for $Error in /ItemLookupResponse/OperationRequest/Errors/Error
           return
              <Error>
               $Error/Code,
               $Error/Message
              </Error>,
          for $Item in /ItemLookupResponse/Items
           return
              <Item>
               $Item/Request/IsValid
              </Item>'
          PASSING
              (code to get XML document: e.g. ItemLookup('036500101794', 'UPC', 'OfficeProducts', '5011363525517', 'EAN', 'Toys'))
          COLUMNS
              Id FOR ORDINALITY,
              Error_Code     VARCHAR2(10) PATH 'Code',
              Error_Message     VARCHAR2(10) PATH 'Message',
              IsValid          VARCHAR2(05) PATH 'IsValid'
         );Of which the response is:
            ID ERROR_CODE ERROR_MESS ISVAL
             1                       True
             2                       TrueOstensibly, there are no errors, so the first record is the IsValid element for the first Items tag, and the second for the second. Now, i need to loop inside each Items for all of its Item tags.
    1) Is this a good approach. I ask because this is really my first XQuery.
    2) Is the for loop for Errors good? I am assuming it will only have a record if there is an error.
    3) Do i nest for loops to get each Item in each Items?
    4) How do i know which Items is being used when in the (sub) Item tag?
    I would appreciate any help. It just hasn't "clicked" yet, and i am having a hard time knowing what to do.

    OK, figured it out....The XMLTABLE does the join, so the FULL JOIN is simply not required:
    Making the final code:
         WITH
              XML(Document)
         AS
               SELECT
                   Amazon_PAPI.Get_Response(Amazon_PAPI.ItemLookup('036500101794', 'UPC', 'OfficeProducts', '5011363525517', 'EAN', 'Toys'))
               FROM
                   Dual
         SELECT
              Items.Id,
              Items.Code,
              Items.Message,
              Items.Isvalid,
              Item.Id Item_Id,
              Item.ASIN
         FROM
              XMLTABLE
               XMLNAMESPACES(DEFAULT 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'),
               '/ItemLookupResponse/OperationRequest/Errors/Error
               | /ItemLookupResponse/Items'
               PASSING
                   (SELECT Document FROM XML)
               COLUMNS
                    Id          FOR ORDINALITY,
                   Code          VARCHAR2(0050)     PATH 'Code',
                   Message          VARCHAR2(4000)     PATH 'Message',
                   IsValid          VARCHAR2(005)     PATH 'Request/IsValid',
                   Item          XMLTYPE          PATH 'Item'
              ) Items
         LEFT JOIN
              XMLTABLE
               XMLNAMESPACES(DEFAULT 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'),
               '/Item'
               PASSING
                   Items.Item
               COLUMNS
                   Id                    FOR ORDINALITY,
                   ASIN                    VARCHAR2(0010)     PATH 'ASIN'
              ) Item
          ON
              1 = 1
         ORDER BY
              Items.Id,
              Item.Id;With the result, when successful:
            ID CODE                                     MESSAGE                                            ISVAL    ITEM_ID ASIN
             1                                                                                             True       1 B004WL0L9S
             2                                                                                             True       1 B0042ET8OO
             2                                                                                             True       2 B00004TQMQAnd when not successful:
            ID CODE                                     MESSAGE                                            ISVAL    ITEM_ID ASIN
             1 AWS.InvalidEnumeratedParameter           The value you specified for IdType is invalid.
                                                        Valid values include ['ASIN', 'SKU',
                                                        'UPC', 'EAN','ISBN'].
             2 AWS.RestrictedParameterValueCombination  Your request contained a restricted parameter
                                                        combination.  When IdType equals UPCa, SearchIndex
                                                        cannot be present.Still looking to test a no-error IsValid = False case though. :)

  • Help with Photo Gallery using XML file

    I am creating a photo gallery using Spry.  I used the Photo Gallery Demo (Photo Gallery Version 2) on the labs.adobe.com website.  I was successful in creating my site, and having the layout I want.  However I would like to display a caption with each photo that is in the large view.
    As this example uses XML, I updated my file to look like this:
    <photos id="images">
                <photo path="aff2010_01.jpg" width="263" height="350" thumbpath="aff2010_01.jpg" thumbwidth="56"
                   thumbheight="75" pcaption="CaptionHere01"></photo>
                <photo path="aff2010_02.jpg" width="350" height="263" thumbpath="aff2010_02.jpg" thumbwidth="75"
                   thumbheight="56" pcaption="CaptionHere02"></photo>
                <photo path="aff2010_03.jpg" width="350" height="263" thumbpath="aff2010_03.jpg" thumbwidth="75"
                   thumbheight="56" pcaption="CaptionHere03"></photo>
    </photos>
    The images when read into the main file (index.asp) show the images in the thumbnail area and display the correct image in the picture pain.  Since I added the pcaption field to the XML file, how do I get it to display?  The code in my index.html file looks like this:

    rest of the code here:
            <div id="previews">
                <div id="controls">
                    <ul id="transport">
                        <li><a href="#" class="previousBtn" title="Previous">Previous</a></li>
                        <li><a href="#" class="playBtn" title="Play/Pause" id="playLabel"><span class="playLabel">Play</span><span class="pauseLabel">Pause</span></a></li>
                        <li><a href="#" class="nextBtn" title="Next">Next</a></li>
                    </ul>
                </div>
                <div id="thumbnails" spry:region="dsPhotos" class="SpryHiddenRegion">
                    <div class="thumbnail" spry:repeat="dsPhotos"><a href="{path}"><img alt="" src="{thumbpath}"/></a><br /></div>
                    <p class="ClearAll"></p>
                </div>
            </div>
            <div id="picture">
                <div id="mainImageOutline"><img id="mainImage" alt="main image" src=""/><br /> Caption:  {pcaption}</div>
            </div>
            <p class="clear"></p>
        </div>
    Any help with getting the caption to display would be greatly appreciated.  The Caption {pcaption} does not work,

  • Help with creating a new window

    Hi there
    Could anyone help me with the coding to create a new window in java? Basically its when i click on a button a new window pops up
    thanks

    Icer_age828 wrote:
    Could anyone help me with the coding to create a new window in java? Basically its when i click on a button a new window pops upWe need more information on what you mean here, what you know and what you don't know. Do you understand the basics of Java? Are you talking about using Swing? If so, what exactly do you mean by a "new window"? You can create a simple dialog via the method JOptionPane.showMessage(...) method. Do you mean to create and show a new JDialog? JFrame? Do you know about ActionListeners and how to add them to jbuttons? Given your post, I think that your best bet would be to start going through the Sun Java Swing tutorial from the beginning. Look here .

  • Help in creating 3 voice .wav files from 1

    I am trying to use Audition to record news in just voice format.  I would like to record 1 track and then be able to split or cut/paste sections of the long track into 3 separate tracks to be saved as 3 separate .wav files.  How do I do this easily?
    As well, when I am recording, I make some mistakes along the way and would like to toggle off the recording, then toggle it back on at the point where I made a mistake and continue on, while leaving a marker at the spot where I made the mistake.  That way I can come back and edit the track where I made the mistakes, which could easily be found because of the markers.  I can't figure out how to do this.  Whenever I record a track and make a mistake, if I hit the spacebar, it stops the recording and goes back to the beginning of the track.  I don't want that.  I want to be able to stop the recording, then restart AT THAT SPOT moving forward with recording the rest of the track....then when I am finished, I can come back and edit the part where I made a mistake.  Help please?

    There are several different ways to do what you want in your first question and split tracks away.  Here's how I do this, but YMMV and you may prefer a different way suggested by somebody else.  First, very important, with a file like this, do not edit the only copy, because it's easy to screw up and save and close a file without realizing that you deleted critical material you still wanted. So start by going to File>Save Copy As and making a copy of the original file with a distinct name, and edit from there.  What I do is highlight the material I want to split away (dragging the mouse over it), then right-click the highlighted material, and click Save Selection (or File>Save Selection), then Cut to remove that fragment and continue editing what's left.  It's important to note that you want Save Selection, not Save; otherwise, it just resaves the entire file and not the highlighted selection.
    I don't have an answer to your question on how to save a marker in a specific spot.  I don't think Audition 1.5, which I'm working with, has that feature (though I've wanted that feature, too) but maybe AA3 does.  Somebody else will know.  What I do during playback that I'm allowing to continue is click on the graph to move the horizontal, dashed yellow line to a point I want to come back to, but that's only a temporary measure and one-of-a-kind, and I think you're looking for something more enduring and allowing multiple mark-ups, when there's only one of those start-point lines. The other thing I do is keep a list of approximate playback points with pencil and paper.
    Hitting the spacebar during playback is the equivalent of clicking the Stop button in the bottom left with your mouse.  This will reset playback to the cursor, as you saw.  Instead, you want to click the Pause button with your mouse.  Then you can hit the spacebar to resume playback where you paused, or click the Play arrow with the mouse (same thing).

  • Help with Creating A New Application Form

    Hi, completely new to this and trying to create a new application form for a conference.
    I've created the form and set each of the packages delegates can buy and added a select button on the right hand side of each of the 6 packages but I can't seem to get it to the point where only one package can be selected - each has details ie B&B and dinner etc so I want delegates to select the one they want beside it.
    Also I've managed to create the link to create the email address to populate to send it back but it isn't attaching the completed form - how do I do this?
    All help EXTREMELY welcomed! Thanks
    Colin

    Hi,
    as I know, you can change your cursors by system software or/and browser. On the other hand you can use programs "outside" of your DW. I suggest to "Google" for them, as I did, and found for example this:
    http://www.google.de/#hl=de&xhr=t&q=create+cursor&cp=13&pf=p&sclient=psy&site=&source=hp&a q=0&aqi=g2&aql=&oq=create+cursor&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=e8c6fad3e718b799&biw=1280 &bih=785
    or http://www.cursors-4u.com/ and while examining this website my cursor changed immediately.
    Hans-Günter

  • How do I create a new boot disk from an existing one?

    I have a G4 Quicksilver with internal PATA disk, running 10.4. I want to upgrade the internal disk from 40 GB to 160 GB. I have installed a second disk and can see it fine, but what I really want is to put the system on the new disk and have it be the one and only boot disk in the system. Is there a straightforward way to do this? Is a carbon copy cloner the way to go? Will that have problems with the different disk sizes? Will it handle bad blocks properly? Isn't there a way to just use drag-and-drop?
    Once I have made a copy, how do I make it the boot disk? Do I have to swap it into the PATA "master" position to do this?

    Cloning And Backup Tools
    A bootable clone is an exact copy of your drive which is capable of booting your computer. Making a copy of your computer which is capable of actually starting the computer requires special copying procedures. Some people just back up data files but if you have problems you have to reinstall all your operating system and all your applications. With a bootable clone you just start up from the backup drive and clone back everything.
    To copy files from one hard drive to another hard drive you can use:
    [CarbonCopy Cloner|http://www.bombich.com/software/ccc.html] (donationware)
    [SuperDuper|http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html] (shareware)
    [IBackup|http://www.grapefruit.ch/iBackup/index.html] (free)
    The Restore function of Disk Utility included in OS X. [Kappy's directions|http://discussions.apple.com/message.jspa?messageID=8799711#8799711]
    [Tri-Backup (commercial)|http://www.tri-edre.com/english/tribackup.html] (payware)
    [Silverkeeper|http://www.lacie.com/silverkeeper> (free) - version 2 has some issues (references: [1|http://www.macintouch.com/readerreports/backup/index.html#d12jan2009],
    [2|http://www.macintouch.com/readerreports/backup/index.html#d13jan2009]) and it is recommended Tiger users stick with 1.1.4.
    [Kappy's Backup Software Recommendations|http://discussions.apple.com/message.jspa?messageID=9065665#906 5665]
    [Overview of Mac OS X Backup Programs|http://8help.osu.edu/1247.html]

  • Trouble in creating a new iCloud account from the existing one

    my dad gave me his iPad which he bought(iPad 2) it's troubling me with the iCloud account, the iPad has my dad's existing iCloud account and I want to delete it but I don't have the password so does my dad he doesn't have the password for the account.so my question is could you assist me on how to create a new iCloud account without having the password of the old one.it uses iOS 7.1.2.

    You won't be able to delete the existing account in order to set up a new one without the password for the old account.  If your father doesn't remember the password, he can reset it as explained here: iCloud: Change your iCloud password.

  • I would like to programatically create a 3D pdf file from an existing application.

    Hello, I have an existing software application.
    I would like to add the ability to create 3D PDF files to this application. The PDF files would illustrate underground water pipes, manhole structures, catchbasins etc. These are pretty simple structures, either cylindrical or rectangular and have pipes intersecting the structures.
    Does an API or activeX exist that I can call from an existing application to create these types of 3D PDF documents?
    I have some example images that illustrate what I am trying to accomplish.

    Moved to Acrobat SDK

  • Noob help with creating a new function module

    Hi everyone,
    I'm just learning SAP and trying to integrate a WMS system towards it and I'm losing hair over it hehehe
    The scenario is that I want to extract Purchase Order Rows details and that's not a hard thing to do since there are multiple BAPIs that can be invoked, for example BAPI_PO_GETDETAIL.
    I'm using .NET Connector 3 to talk to SAP.
    The problem however is that I want to see how many articles that have already been delivered into the warehouse using BAPI_GOODSMVT_CREATE. There is no information returned when using BAPI_PO_GETDETAIL that specifies that a Purchase Order Row has a quantity of 30 and that 20 has already been delivered.
    That information can be retrieved by using BAPI_GOODSMVT_GETITEMS.
    The problem with using BAPI_GOODSMVT_GETITEMS is that it returns all of the rows and I am only interrested in retrieveing the rows with quantity for a specific purchase order.
    So i decided to create my own BAPI or Function Module (or whatever it's called) that would take a PO_NUMBER and PO_ITEM and return the quantity of already delivered items. For example if one of the PO Rows (10) has 100 items and there has been 2 partial deliveries of 20 and 30. The function should return the value of 50 because it's the sum of 20 and 30.
    My code looks like this:
    FUNCTION ZBAPI_GOODSMVT_GETITEMS.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(PO_NUMBER) TYPE  BSTNR
    *"     VALUE(PO_ITEM) TYPE  EBELP
    *"  EXPORTING
    *"     REFERENCE(ENTRY_QNT) TYPE  ERFMG
    SELECT SUM( MENGE ) INTO ENTRY_QNT FROM MSEG
      WHERE
      EBELN = PO_NUMBER AND
      EBELP = PO_ITEM.
    ENDFUNCTION.
    The problem is that when i try to Activate it it says:
    REPORT/PROGRAM statement missing, or program type is INCLUDE.          
    What am i missing? Is there an easier way to extract already delivered quantities when extracting PO information?

    A document was produced for Designer 7.1 and the principles still apply.
    http://partners.adobe.com/public/developer/en/pdf/lc_designer_perf_guidelines.pdf
    You can poke around here as well....
    http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm
    Steve

  • Help with creating a new account!

    Due to the fact that I had to erase my hard drive and put a fresh latest version of iLife06 on it, I am having some issues trying to create an account within iTunes Music Store. iTunes wants me to add credit card information for purchases. In the past, I have been buying pre paid iTunes cards and would rather continue doing this. So how can I get around putting my CC info in? It won't let me get pass that step in the setting up the account process.When I click sign in and put my info in it says that my information has never accessed the music store and wants me to register. The first screen that comes up is the Credit Card screen.
    Thanks!

    yea I sent them an email already and waiting for a response. I have tried several different combinations of logins both AOL and a @mac.com and getting no where. In the FAQ's it said there was an option to select NONE if the person did not have credit cards and would have to use the pre paid cards. Well I don't see a NONE listed as an option and I have the very latest version of iTunes too! So who knows whats up! I'll have to wait and hear from them.

  • How to create a new database instance from an existing one?

    Hi, I basically want to create a snapshot of a production
    instance (version 8.1.7) for querying purposes. Would anyone
    tell me the steps involved? What I did as follows:
    1. Copy all data files to a new location
    2. Modify init.ora accordingly. I believe there is no separate
    control file for this version.
    But when I startup the instance, got this error:
    ORA-01103: database name 'TRITON' in controlfile is not 'HERCULE'
    What is missing? Do these data files contains links to the
    previous instance name?
    Thanks for any help.

    Hi All,
    I need some help in recreating new database instance.
    Here are the steps I have done so far:
    1. Created a database with name 'LASTDB' using DBCA
    2. Connected to RMAN.
    3. RMAN>SET DBID=******; (of the source database)
    4. Connect to target. RMAN>connect target SYS/*****;
    5. Executed controlfile restore on RMAN.
         RMAN>Run{
    Allocate channel D1 Type DISK;
              Set controlfile autobackup format for device type DISK to
    ‘\\<ip_address>\Backup\Prod\%F’;
    Restore controlfile from autobackup;
    6. RMAN> ALTER DATABASE MOUNT;
    Now got an error saying ORA-01103: database name ‘PRODDB' in control file is not ‘LASTDB’
    I tried using NID to change the database name but it's throwing an error that database is not mounted.
    I have browsed a lot and found that I need to recreate a control file of the production database using ALTER DATABASE BACKUP CONTROLFILE TO TRACE and should edit the trace file. But it also says to shutdown the source database which is production database and I cannot try that.
    Also I have tried adding a line to init.ora like lock_space_name = LASTDB. Also tried replacing everything from LASTDB to PRODDB but that didn't work either.
    I have been trying to find a solution to this. Please bear with me as I'm a beginner and please let me know how I can fix the error.
    I am running oracle 10.1.0.2.0 enterprise edition on windows 2000.
    Thanks for your patience,
    KG

Maybe you are looking for

  • Creating multiple screens

    Hi.  I want to create five different views. Each view consists of some numeric indicators showing values that i get from a database. I want my main screen to be consisting of icons. Can i make five different independent views Can i use icons to switc

  • HT5312 Can I set a rescue email to an account that I already have? If so, how do I do it's.

    when I made my account I didn't have a second email so I was wondering if there is a way I could add one now.

  • Videos Not evenGoing onto list

    Well I just bought my 30g ipod video and im all pumped about this video stuff. So i get home and i get my song's on and then try to get some movies that i have had on my computer for along time. But when i try to drag them to the iTunes music list th

  • Importing from DVD-R

    Hi: A friend of mine and I are producing an instructional dance DVD. My friend's camera uses the mini DVD-Rs. We did a test run tonight. After doing a test run, she gave me the formatted mini DVD-R. I realized that I cannot download the media from th

  • IP or DHCP address issue with VPN

    setup: Mac server 10.6.8, VPN service L2TP, Airpot Extreme software fully updated in company LAN set to DHCP: IP range is 10.0.0/24, DHCP service is OFF in server admin... VPN IP range is 10.0.0/24 I noticed sometimes when I VPN into my company netwo