Changing node data not the node itself.

Dear everyone,
I'm trying to nest DOM hierarchies within another, and I have most of it worked out,
but there are a few niggles.
The first problem is as follows:
My first document is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WfMessage>
<ATO_ATO>
<ATO_FileLoadedIntoSystem>No</ATO_FileLoadedIntoSystem>
<ATO_RawXML>XML DATA HERE</ATO_RawXML>
</ATO_ATO>
</ProcInstInputData>
</ProcessTemplateExecute>
</WfMessage>
What I want to do is to insert my second XML file between the tags so that
it reads:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WfMessage>
<ATO_ATO>
<ATO_FileLoadedIntoSystem>No</ATO_FileLoadedIntoSystem>
<ATO_RawXML>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
(XML data in here...snipped for brevity)
</ATO_RawXML>
</ATO_ATO>
</ProcInstInputData>
</ProcessTemplateExecute>
</WfMessage>
(By the way, I do need the second root in the nested document- thats the second problem!)
I've come up with some code that comes up with the following XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WfMessage>
<ATO_ATO>
<ATO_FileLoadedIntoSystem>No</ATO_FileLoadedIntoSystem>
(data in here...snipped for brevity) // TAGS AND ROOT MISSING !!!
</ATO_ATO>
</ProcInstInputData>
</ProcessTemplateExecute>
</WfMessage>
Which is nearly what I need when I use the following code:
ATO_document = builder.parse( "D:\\ATO.xml" );
XML_document = builder.parse( "D:\\XML.xml" );
NodeList replacedNodeList = XML_document.getElementsByTagName("ATO_RawXML");
Node foundnode = replacedNodeList.item(0);
if ( foundnode != null )
Node modfiedReplacedDocument = replaceNode(XML_document, ATO_document,
foundnode);}
else
// error message here.
and replaceNode is defined as follows:
public static Node replaceNode(Document replacedDocument, Document
replacingDocument, Node replacedNode)
//Create a documentFragment of the replacingDocument
DocumentFragment docFrag = replacingDocument.createDocumentFragment();
Element rootElement = replacingDocument.getDocumentElement();
docFrag.appendChild(rootElement);
//Import docFrag under the ownership of replacedDocument
Node replacingNode =
((replacedDocument).importNode(docFrag, true));
//In order to replace the node need to retrieve replacedNode's parent
Node replaceNodeParent = replacedNode.getParentNode();
replaceNodeParent.replaceChild(replacingNode, replacedNode);
return replacedDocument;
I've tried using insertBefore functions in the replaced document to
artificially recreate the <ATO_RawXML> tags, but the code
grumbles that the parent element is missing. I'm sure a solution is very
simple
but I am losing my hair over this. Can anyone suggest anything (other than
a lotion to keep my hair in) ?
Best wishes
Paul

A XML document should have one declaration in the beginning of the document.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Xml document has two xml declarations.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WfMessage>
<ATO_ATO>
<ATO_FileLoadedIntoSystem>No</ATO_FileLoadedIntoSystem>
<ATO_RawXML>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
(XML data in here...snipped for brevity)
</ATO_RawXML>
</ATO_ATO>
</ProcInstInputData>
</ProcessTemplateExecute>
</WfMessage>

Similar Messages

  • Photoshop CC on Windows 7 is saving the file "date" as the created date not the modified date

    I have been using a much older version of PS (CS2) and just decided to update to PS CC. I have installed the trial version of PS CC and will begin the CC subscription as soon as the trial expires.
    I have noticed that PS CC saves the (main) date of the files as the "created date" not the "modified date" as it pertains to Windows Explorer and the Windows OS.
    Here is what is happening: I have a file that I created in 2007 that I use for a template. It is sized to specific dimensions, etc. and when I do my save as, it automatically saves into the desired file folder, so that's why I use this as a template. I setup a new photo and then drag and drop it into my template, flatten the image and save as. When doing this with PS CS2, the date for the newly saved file was assigned as the modified date (current date and time). So, when I searched for the file in Windows Explorer or when I went to open the file, the date shown for the file was the modified date. NOW, with PS CC when I perform the exact same process and do a save as, the file date shown in Windows Explorer and/or when I go to open the file is showing as the created date (3/9/2007), the date that I created and saved the template I use. This is aggravating to me because now when I want to open a file and sort by date, the date shown in Windows Explorer is not accurate. As far as I can tell, this only happens in PS CC. When I open an old file with ID CC and do a save as, it applies the current date, not the created date. And, when I was using PS CS2, whenever I did a save as the current date was applied as well.
    In summary, when performing a save as, the created date is being applied as the main date instead of the modified date. The question is: Is there a way to change this so that the modified date can be applied as the main date for the file when performing a save as?

    Below are two files created the exact same way on the exact same computer: the top one was saved in PS CS2 and the bottom one was saved in PS CC. Both were saved using the "Save As" command. You will notice that when the "Save As" command was used in CS2 it updated the "Created:" date, however, in the CC version the "Created:" date was not updated, only the "Modified:" date was updated. Is there a way to update the "Created:" date when performing a "Save As" in PS CC?

  • ITunes opens but without any text showing.  Drop down menus have text but not the app itself. I have a Mac Powerbook Pro running Windows XP under Boot Camp.

    Running under Windows XP,  a few upgrades ago iTunes started opening without any text showing in the application.  Clicking on PLAY will play music but no text shows to indicate what's playing and no text to show music library. Drop down windows show text but not the app itself.
    Subsequent upgrades and reinstalls have not corrected the problem, When I run under iOS (Snow Leopard), iTunes opens with text and runs correctly.
    Help!

    Because I created FAT32 partition using Boot Camp tool few days ago I installed my custom copy of Windows XP with SP3, IE7 and WMP10 integrated using nLite (for WMP10 integration use RVM Integrator). I did not use Boot Camp tool this time - I just booted CD using Option key. Then I installed Boot Camp 2.0 drivers you can find on Mac Disk 1. After this I installed Boot Camp drivers 2.1 update. In Add or remove Programs I checked drivers - I uninstalled old drivers which call identical, but you can skip this. Everything works fine BTW it is better to format your partition to NTFS - you have much less disk errors, you do not waste time for disk errors scans during Windows startup, your data are much more safe. If you need NTFS write permissions use great tool Paragon NTFS for Mac OSX or open source NTFS driver.
    Message was edited by: limo79

  • 2nd week running, I received an e-mail saying a new episode of Breaking Bad is available.  When I go to download its the "Inside Breaking Bad" short (which gives away spoilers - thanks Apple!) but not the episode itself.  What gives?

    2nd week running, I received an e-mail saying a new episode of Breaking Bad is available.  When I go to download its the "Inside Breaking Bad" short (which gives away spoilers - thanks Apple!) but not the episode itself.  What gives?
    I've tried this on multiple products so I believe its specific to iTunes not a particular device.

    Same thing here- Get the email but nothing but the Inside featurette. It's really annoying. In fact I can't even download it normally using the check for available downloads feature! Every time I do that iTunes tries to download doubles of three Walking Dead episodes I've already downloaded. I don't want what I already have, I just want the new episode.

  • Displaytag to export the only data not the url

    I am using displaytag to export the data but my data is coming like
    but I only want the data to export
    For example I want the only data not the url should be like:
    78190
    My code is as below:
    :<display:table name="bulkDetails" export="true" pagesize="100" id="row" sort="list"> <display:column title="REQUESTID" sortable="true"> <c:url value="../Status" var="url"> <c:param name="Status_Index" value="${row.REQUESTID}"/> </c:url> <a href=${url>${row.REQUESTID} </display:column> while export this data it gives me with full url likebut my need is only data not the full url .
    please help .

    Thanks Helen.
    As you said the files got saved in other location, apart from the specified folder location. However I need info on the files you got after export. Because in my server I can only see GRACSPMRCODE,GRACSPMRCODESDATA and GRACSPMRCODESYSDATA files but not the owners, fire fighters, firefighter ID files.
    Please let me know the files you received.
    Regards,
    Giridhar

  • How do you print an email attachment and not the email itself. please.

    how do you print an email attachment and not the email itself.  please.
    This question was solved.
    View Solution.

    Hi there, if there is text in the body of the email it will print automatically when sent to an ePrint email address. The only way to just have the attachment print is for there to be no text in the email body.
    Hope that helps answer your question.
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • I have Photoshop cs6 Ext on an ASUS laptop. How can I increase the font size of the contents of the FILTER Panel situated on bottom left of screen. The font size is extreamly small and almost unreadable. I have changed display parameters, not the resoluti

    I have Photoshop cs6 Ext on an ASUS laptop. How can I increase the font size of the contents of the FILTER Panel situated on bottom left of screen. The font size is extreamly small and almost unreadable. I have changed display parameters, not the resolution, to no avail.
    David.

    Paragraph breaks are good for readability. ;-)
    Have you noticed any difference between your MacBook and others at the Apple store? Wondering whether this is a configurable setting at the system level, i.e., DPI.
    You can default Firefox to a larger zoom level to avoid having to zoom every page. You'll still be able to adjust the size for individual sites as needed. It sounds as though you are aware of these add-ons:
    * Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    * NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/
    There are some discussions about changing coming in Firefox 22 (I think) to address higher density displays like the Retina display. So perhaps there will be a built-in setting to address this in the future.

  • USER EXIT FOR CHANGING POSTING DATE IN THE MATERIAL DOCUMENT

    Hi,
    Pls advise any USER EXIT FOR CHANGING POSTING DATE IN THE MATERIAL DOCUMENT.
    Regards,

    Hi,
    There is another user exit for updating material document data Upon posting  is MB_CF001
    I hope this will fullfill you.
    Prem

  • Document library: user can see the metadata but not the file itself

    Hello,
    For a specific document library certain users will have the right to see the metadata but not the file itself. The only solution I can  think of is using a http handler. But I don't know if I can get the user that requests the document.
    Are there any other approaches to this requirement?
    Can I get the username of the user that makes that request?
    I guess that http handler is deployed at the Web application level - am I right?
    Thank you
    Christos

    Nicolas, thank you for your answer.
    I think this this is not a strong protection. Everybody can istall sp designer or go through UNC path, like \\myserver\documentlibray or \\myserver\lists\mylist and see the documents- and we use unc paths a lot. I don't want to get into trouble when a (wiki)
    leak is made.
    Christos

  • ITunes disregarded all changes i made on the iPhone itself

    here is the problem:
    I've connected iPhone 4G to my PC.
    Installed some applications by synchronizing the phone with iTunes.
    Then, disconnected the iPhone, rearranged some application icons, and removed some applications.
    When i did next synchronization, everything on the iPhone went back to the way it was after the first synchronization.
    For some reason, iTunes disregarded all changes i made on the iPhone itself.
    As far as I remember, there were no problems like this with 3GS 3.1.2

    Try:
    Reset your iPod
    Getting the latest version of iTunes by clicking Software Update which is in the apple at the top left hand corner of the screen
    Or, when you hook up your iPod, on the summary page uncheck Manually Manage Music and Videos. This may help. Also look here:
    Syncing iPod Touch

  • Flashing question mark folder OS X 10.6.8.  Issue is not the drive itself.

    Received flashing question mark folder on a MBP5,5 running 10.6.8.  Removed the drive and was able to boot on same machine with the drive plugged in as external USB.  Any idea as to what the issue may be?  It's not the drive itself.  Bad connector?  Going to update the drive to mountain lion this weekend to see if that resolves anything.

    Actually, it is the drive in some way.
    Question (?) Mark, Blinking Folder, or Gray Screen at Startup
    These are related but not identical issues. Their causes are outlined in Intel-based Mac- Startup sequence and error codes, symbols. Solutions may be found in:
    A flashing question mark appears when you start your Mac
    Mac OS X- Gray screen appears during startup
    In most cases the problems may be caused by:
    Problem with the computer's PRAM - See Resetting your Mac's PRAM and NVRAM.
    Boot drive's directory has been corrupted - Repair with Disk Utility.
    Critical system files are damaged or deleted - Reinstall OS X.
    The disk drive is physically non-functional - Replace the hard drive.
    Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    The main difference if you are using Lion or Mountain Lion is that you must first boot from the Recovery HD:
    Boot From The Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Reinstall Snow Leopard Without Erasing The drive
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install Mac OS X 10.6.8 Update Combo v1.1.
    Reinstalling Lion/Mountain Lion Without Erasing The Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • How can I sync my iPad with a new laptop (same itunes account) and not lose all my app data, i.e. games data stored on the ipad, not the app itself?

    I want to sync my iPad with a new laptop, so I can get rid of the old computer.  I have already downloaded all the itunes content on the new laptop, but when i go to sync, it tells me that itunes will erase and copy all the apps from the new library.  The 2 computers are on the same account, so is there a way to copy the apps (including app data) onto the new laptop, instead of vice versa?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Batch Change Photos' Date - Not Time

    Is there a way to change a bunch of photos' date, but not the time?

    Neil:
    Not in iPhoto. Unfortunately you've go to change the time as well. If there are not too many of them you can do it this way.
    1 - move all that you want to redate to the same date to a new roll.
    2 - in the Finder copy the folder in the Original folder that represents the roll with the files to be redated to the desktop.
    3 - using an application like PhotoInfo batch change the date to whatever you need. It can just add or subtract a specific number of days, months or years to the date as you see fit.
    4 - change the name of the folder and import back into iPhoto.
    5 - delete the original roll of photos with the incorrect date.
    That's about it. It's not too convoluted and can be done. This way the new date will be embedded in the file and stay with it if needed in a new library or other application.
    Do you Twango?

  • How can I save captured clips to hard disk using the actual video recorded date, not the date I transferred it?

    When using Batch capture in AP5.5, the clips are saved to hard disk using the capture date as the Created Date and Modified Date.  How do I configure Premier to use the actual clips recorded date (Meta Data Basic/Date Created) so that I can view them in Windows folders and other applications based on the date the video was recorded, not when I imported it.

    AFAIK, there's no way to do that with Premiere Pro.  You can probably find a utility on the Internet that will change the dates for you after the fact. 
    Cheers,
    Jeff

  • Changing mail dates of the Visa prepaid card

    Ok Is Verizon changing mail dates every other day on these cards? It seems that they fail to tell you that making changes to your subscription will screw up this offer. Although I have not changed anything nor have I missed any payments they still keep changing the date. My mail box is out in the open and I like to be there when packages and sensitive mail is going to be sent. STOP doing this and send the darn card already. Why would you mess around with this stuff if you are soooooo concerned with customer loyalty and service as you claim to be? Not a smart move to bounce people around your phone lines for an hour as many have complained about. Get it together and send the thing on time.

    They changed the date again...I realize that it is to be sent within 30 days of your 60 day anniversary. They keep giving mailing dates of  "on or around" but they keep changing it everyday. My first notice said  "on or around"  March 5th, then the 7th, then 11th, now the 12th.  I have to ask 'WHY"? Better to just give a correct date than to keep pushing it further and further forward. Its not that big of a deal, but with all the identity theft and mail theft going on, I would like to know when it hits the mail. Please correct this activity, its not beneficial to Verizon or me.

  • Bug in LR 3.4 changing folders show not the 1st photo after setting rating filter

    Bug in LR 3.4 ?
    In the Library module, I have several folders.
    Folder 1 contains 100 photo's
    Folder 2 contains 100 photo's
    After rating the photo's in folder 1 (let say I rated 10 photo's with one star, then I changed the viewing status to Filters - Rated - > 1star) and I get to see the 10 photo's
    Then I switch to folder 2 (which has filters off). In stead of beginning with photo 1 (the beginning), it starts the focus on the image wich is no 17 or anyway much higher (i think the photo no of the 1st rated photo in folder 2).
    Has anyone experienced this behaviour?

    Yes,
    folder 1: Filter - Rating > *
    folder 2: Filters OFF
    And both are sorted at Capture Time. So when changing from folder 1 (with rating) to folder 2 (without rating) it starts not at the beginning.
    I have also a folder 3 without rating (same as folder 2), and if I go from folder 3 to folder 2 it starts at the beginning as it should be.
    Also: if have the following setup concerning filters:
    Library Filters: - Lock Filter
    Library Filters: - Remember each source's filter separately (so I can change the filter settings on each folder)
    NOTE, I can reproduce it:
    It appears that switching from folder 1 to folder2 (as described above) the focus on folder 2 is the first picture with a rating, and NOT the first picture at all. And that is with Filters OFF. Switching from folder 1 to folder 3 (no photos are rated in this folder),it starts at the first photo (as expected).
    Message was edited by: erwin.mvdb, additional info on reproducing the 'bug'

Maybe you are looking for

  • How can I stop Game Center from opening every time I finish a game?

    I despise Game Center and don't want to use it.  Every time I finish a game of Real Solitaire, Game Center opens and bothers me about not logging in.  This is on an iPad 4/128gb.  I never had this problem until I got the new iPad.  Is there any help,

  • Running a system report from SDK

    Is it possible to run a system report such as the "Customer Equipment report" from within SDK and fixing the report selection criteria from within code? I need to be able to place a button on the BP header screen that runs the CE report for that BP w

  • Default UITableViewCell text label background color

    I need a table view cell that just has simple text but with custom backgroundView images when not selected vs. selected. I'm too lazy to implement a custom cell, so I was using the regulation UITableViewCell, setting the backgroundView and background

  • Can My iBook G4 Hold Leopard?

    I have an iBook G4, here are the specs: Processor: 1.33 GHz The rougly 60GB of disc space it came with RAM: 256 or 512MB (supports up to 1.25 or 1.5GB, but I just have what came in it, though I'm not sure which is in mine) I have a disc to upgrade it

  • Question about java threads programming

    Hi I have to develop a program where I need to access data from database, but I need to it using multithreading, currently I go sequentially to each database to access data which is slow I have a Vector called systemnames, this one has list of all th