Why does loadXML over-write attributes in data DOM even if 'ignore root element' argument is true?

I'm running Acrobat 9.4 if that makes any difference.  This question was spurred by another discussion on inserting an item into a list.  Basically loadXML is erasing the attributes on the reference node.  For example, if domNode is a node in the data DOM and newXML is a replica of domNode's XML with some child elements changed and newXML_str is the string representation of newXML, then the statement domNode.loadXML(newXML_str,true,true) eliminates the attributes in domNode.  A commenter in the above link states that it happens because the attribute is not stored in the data DOM as an attribute but rather as a child node with prefix '@' but if that were the case it would seem that saveXML should show it as a child element and not as an attribute.  However, saveXML (as shown below) correctly shows the attribute as an attribute.
What I would like to happen is to have the child attribute node(s) preserved and the child element nodes replaced.  It seems to me that if the second argument is true (ignore root element in xmlArg) then the root element in the data DOM (including attributes) should be unchanged but that is not what happens.  
Here is some sample XML:
<docroot>
    <contact uid="29033737">
        <firstName>George</firstName>
        <lastName>Sinkenschneider</lastName>
    </contact>
</docroot>
Here's some JavaScript:
var domNode = xfa.resolveNode("xfa.data.docroot.contact.(uid.value=='29033737')");
var domNodeXML_str = domNode.saveXML();
console.println("  contact data node saveXML (domNode) = ".concat(domNodeXML_str));
console.println("  domNode.uid.value=".concat(domNode.uid.value));
var newXML_str = domNodeXML_str.replace("George", "Johnny");
console.println("  newXML_str = ".concat(newXML_str));
domNode.loadXML(newXML_str, true, true);
console.println("  DOM node after executing loadXML(newXML_str, true, true) = ".concat(domNode.saveXML()));
xfa.form.remerge();
Here's the console output from the script (including all the ugly line-feeds):
  contact data node saveXML (domNode) = <?xml version="1.0" encoding="UTF-8"?>
<contact uid="29033737"
><firstName
>George</firstName
><lastName
>Sinkenschneider</lastName
></contact
>
  domNode.uid.value=29033737
  newXML_str = <?xml version="1.0" encoding="UTF-8"?>
<contact uid="29033737"
><firstName
>Johnny</firstName
><lastName
>Sinkenschneider</lastName
></contact
>
  DOM node after executing loadXML(newXML_str, true, true) = <?xml version="1.0" encoding="UTF-8"?>
<contact
><firstName
>Johnny</firstName
><lastName
>Sinkenschneider</lastName
></contact
>
Note that the uid attribute is missing from the final DOM node.

Looks like you may have found a bug .....If I append the new xml I see that the uid attribute is maintained (oit is not touching the root attribute). If I replace it then it seems that the attribute is ignored when the node is re-written. We will need to open a bug with support ...do you want to do that?
Paul

Similar Messages

  • Why does my iphone phone by it self ?even though its password protected, switched off, and has a hard cover over the screen.

    why does my iphone phone by it self ?even though its password protected, switched off, and has a hard cover over the screen.

    the phone started to phone by itself  only numbers in my addressbook, now its phoning random people, has any one any ideas?  also i find it pure cheek from apple that i paid for a phone that cost 100,s € and i have to pay for tech support.

  • Why does my iphone 4s has mobile data instead of cellular data?

    why does my iphone 4s has mobile data instead of cellular data?

    "Mobile data" and "cellular data" are the same thing - just depends what your carrier chooses to call it.

  • Why does my iphone 4s shut down by itself even with full charge? It comes back on only when I do a hard reset! Any solutions to this?

    My friend recently gifted me a brand new iPhone 4s bought in the the US. I live in India though. My phone keeps shutting off by itself even when there is full battery. And, it comes back on only with a hard reset. Why does this happen?

    Thank you! I will try restoring it as new. But getting it back to the US for service is going to be a task!

  • Why does a reboot set the modified-date of the server certificate?

    I was inspecting my certificates and noticed that the certificate I use for my server had a modified date of Dec 12, whereas it was created around April of this year.
    Dec 12 saw a reboot of my server and adding the `uptime` to the 'modified date' of the certificate gets me to 'now'. So, it seems a reboot sets the modified date of the server certificate. Can someone confirm this and does anybody know wht this is the case?

    Yes, I found the same tricks but if I only set pereferred width. the result is not that I expected. so I use the following code to do it:
             tc.setPreferredWidth(maxsize+5);
             tc.setMaxWidth(maxsize+5);I don't know why must I add 5 point to display the string completely.

  • Why does Mail change my attachments to DAT

    I am looking for help on why the mail program on my iMac and MacAir change attachments sent to me to DAT files.  The type of attachments doesn't matter.  They can be Excel, PDF, or whatever, but when they come over, they are using a DAT extension.  I've tried sending from various computers and other friends have sent me e-mails with attachements, but they always get changed to DAT files.  When I receive e-mails on my Roadrunner account, they come over correctly on the same computers.
    Thanks,
    Scott

    Hi Scott, it's because the silly users on the other end. & MS..
    http://www.twistermc.com/583/open-winmaildat-files-mac/
    https://itunes.apple.com/us/app/windat-opener/id405924251?mt=12

  • Why does something as simple as the date on my computer being wrong cause firefox to not allow me to open any websites?

    I saw others have this problem a few times...and people are trying to have them do all kinds of stuff to fix it. This is one of my errors:
    This Connection is Untrusted
    You have asked Firefox to connect securely to www.facebook.com, but we can't confirm that your connection is secure.
    Does that for everything. And sometimes it has a double confirmation to go to the site anyway. Other times it will not let you go to a site no matter what.
    So I came here and I realized what it was on my own after reading some complicated fixes people suggested to others who posted this problem.
    Look at the date...not on your phone...on the computer with the problem.
    So you guys may wanna make part of the warning message mention to make sure the date is correct on your computer. Also you would think a program connected to the internet with access to the correct time would not go by the computers clock. Or maybe you should make it verify the date online when this error occurs so the error message could tell the user what's wrong...or at least let him go to a website. Or maybe not even scare the user with a totally bogus security warning.

    I know I said I figured it out it's just stupid and I wanted others to see the easy solution. So my computers date was 2009 and a current 2014 security certificate was ruled unsafe by firefox. That's logic for ya. Maybe only consider the cert expired when it's PAST the expiration date. You know like read the definition of expired. I think they have it backwards.

  • Why does Oracle SQL query returning a date field without the time component

    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!

    hokim wrote:
    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!http://edstevensdba.wordpress.com/category/nls_date_format/

  • Why does my facebook say restricted under data usage?

    For some reason my phone is using a lot of data when I only use the internet when I'm at home and its connected to our internet.  I checked on my phone under data usage to see where it is all going and everything is using very little data except under facebook it doesnt give me an amount used, instead it says restricted?  I can use facebook but its very limited.  Does anyone know what is going on?
    Thanks,
    Lori

    FB is set to restrict background data maybe?  If so, it only uses data when in the forefront, or while using it.  Check to see and disable if need be under your settings then Mobile Data and scroll down to FB and tap it.  Should see a box stating Restrict Background Data.

  • When I press "sync now", which computer over-writes the sync data?

    Does one computer "dominate" the sync process? The home computer? Or the computer you're on when you push sync now?
    Is the sync based on whatever machine has the most recent changes? Or does it just merge the data?
    For example, if I clear browser history (or delete a bunch of old bookmarks) will that data repopulate when I sync or will it be deleted from the other machine? Does it matter if the machine is the original install of firefox sync or the added device?
    Thanks.

    Does one computer "dominate" the sync process? The home computer? Or the computer you're on when you push sync now?
    Is the sync based on whatever machine has the most recent changes? Or does it just merge the data?
    For example, if I clear browser history (or delete a bunch of old bookmarks) will that data repopulate when I sync or will it be deleted from the other machine? Does it matter if the machine is the original install of firefox sync or the added device?
    Thanks.

  • Why does old sale order (The deliver date before current date) show VSF (independent requirement) in MD04?

    Dear All,
    I face one issue, the old sales order (the delivery date before current date) has became VSF (independent requirement) in MD04, could someone let me know why and how to fix it?
    Take 01.09.2014 as example, we have one 50PC's sales order with delivery date as 25.08.2014, in MD04, the system will show two independent requirements, one is 50PC's customer order and another is 50PC's VSF.
    We are looking forward to your kind help and answer, thanks in advance!
    Best Regards,
    Gavin

    Hi Gavin
    If I understood the issue correctly, system is showing both the sales order and the PIR on the same date, right?
    If this is the case, it's probably a PIR consumption issue. Take a look on the following note, especially question 10:
    772856
    FAQ: Consumption of planned independent requirements
    BR
    Caetano

  • Why does calendar app icon show current date, but weather app icon does not?

    i.e. At time of writing this post, the calendar app icon shows "Sunday 16" but the weather one always always always shows "23 degrees"
    Is there a way of fixing this inconsistency in the UI?

    I now realise that this has been asked previously, only the 'previously asked?' search didnt' pick it up for me.
    Yes I understand the issues about how 'live' it needs to be, but surely you should have the option of picking this? Most people are connected 'all the time' anyway, so so what if there is a tiny bit of weather data flying about?

  • Why does my IMAC super drive recognize data dvd's but not movies?

    My 27" Intel Imac recently stopped playing dvd movies. The drive still recognizes data disks but not movies. When I insert a dvd movie the drive makes noises for 30 seconds then eject the disk.

    Have you changed region codes on movies?  It will only change for a total of 5 codes.
    Regards,
    Captfred

  • Why does Illustrator CC2014 write temporary files instead of updating existing file?

    Illustrator CC 2014 (Win) keeps saving temporary files rather than overwriting an existing file. This results in illustrations not showing as updated in InDesign. The only way round it is to use the Save As command — and that doesn't always work! Also, upon closing a window tab, it frequently changes text in the illustration to default Myriad Pro, without any input from me. I have to undo text changes to make it revert to the intended font.
    I've worked with every version of Illustrator since version 5.0 and this is the first time I've experienced such an apparent glitch. Any ideas why this should be happening top me?
    Nick
    Using: Adobe Creative Suite - Windows 7 Ultimate

    As explained before, when closing a tab, an open *.eps file suddenly acquires the changed asterisk, and when I go that tab it says under Edit "Undo Type Style". Yet, I can't see any change, even when I toggle between "Undo" and "Redo". also, under "Find Font", I can't find any other font other than the branded Interstate font, even though the current font selection window shows Myriad Pro.
    So, on to some serious detective work. I remembered back from the old days that *.eps files can be opened (and manipulated!) using Notepad.
    I saved the file (Figure 8) which said a change had taken place and compared that file with the original by opening in Notepad, copying and pasting into Word and using the latter's compare function. Obviously there are pages and pages to look through, but then I had a Eureka moment! This was what I found:
    dup /FontName get exch definefont pop
    end
    %ADOEndSubsetFont
    /COGQMXCOGQMV+XXXXXXInterstate-Light /XXXXXXInterstate-Light findfont ct_VMDictPut
    /COGQMXCOGQMV+XXXXXXInterstate-Light*1
    [32{/.notdef}rp /space 13{/.notdef}rp /period /.notdef /zero /one /two
    /.notdef /four 3{/.notdef}rp /eight /.notdef /colon /semicolon 9{/.notdef}rp
    /E /F 2{/.notdef}rp /I 9{/.notdef}rp /S /T 12{/.notdef}rp
    /a /b /c /d /e /f /g /h
    /i 2{/.notdef}rp /l /m /n /o /p /.notdef
    /r /s /t /u 138{/.notdef}rp]
    COGQMXCOGQMV+XXXXXXXInterstate-Light nf
    COGQMXCOGQMV+XXXXXXXInterstate-Light*1 [8.8569 0 0 -9 0 0 ]msf
    3.25928 10.4355 mo
    (Figure 8)
    I have used the XXXXXX to protect my client's anonymity, but the crossed out coding "/COGQMX" is to be found in the unchanged file, and the COGQMV in the changed file!
    Although I have described this as a Eureka moment, I actually don't understand the problem, but I feel I have narrowed it down and Mike is right — it IS a font issue!!

  • Why does itunes as me to update my itunes even though it is up to date?

    I am attempting to transfer my music from a backup (that is corrupted) to my laptop. I grabbed the entire itunes folder and copied it to my laptop. I replaced the folder made by itunes with this one. I then proceed to open itunes and I get this error "The file “iTunes Library.itl” cannot be read because it was created by a newer version of iTunes. Would you like to download iTunes now?". I clicked download itunes but after software update checks for any new itunes updates it finds none. What do I do to fix this?

    Download iTunes manually from Apple's web site and install that.  There's probably some residual files on your computer misinforming Software Update what version you have.

Maybe you are looking for

  • Java programming applet issue newbie help

    hello i am a student taking an intro to OOP course using java. i have textMate and blue J as java editing environments. i have successfully managed a few lessons but now i am having trouble with applets. my applet source code will run in blue j but n

  • How develop a quary

    Hi, Vendor invoices are having block for payment but those invoice are cleared. Now my user requirement is that that block should be removed because it will appear in report so that he asked us to develop a QUARY. My question is that how to develop a

  • Data Migration Part - Reg.

    Hi all, While in Implementation of FICO part, what are the data we need to upload thrugh LSMW or BDC like Vendor Master, GL Master? Can any one suggest me and anybody can give Templates source data? Thanks & Regards, M.Mohan.

  • Multiple columns in a column in a JTable

    Hi, I'm trying to have a JTable with 7 columns (for the days of the week) and in these columns I would like to have 6 columns in each column - which in the end will be drop down boxes. Does anybody know if this is possible (I hope I've explained it o

  • Video Furnace: Failed while creating player controls...

    I need some help figuring out how to get Video Furnace to work on my computer. It had run very easily before; I was on campus, and I clicked on the icon, it came up, and played smoothly, but I can't get it to work any longer. It keeps saying: The Aud