Why does this throw an error?

just trying to modify an element value here...
declare
v_xml_new xmltype;
doc dbms_xmldom.DOMDocument;
ndoc dbms_xmldom.DOMNode;
node dbms_xmldom.DOMNode;
childnode dbms_xmldom.DOMNode;
nodelist dbms_xmldom.DOMNodelist;
docelem dbms_xmldom.DOMElement;
buffer ta_debug_log.message%type;
begin
v_xml_return.schemaValidate;
ta_debug.writeDebug('DEBUG: xml instance validated '||C_PROCEDURE_NAME||'.');
exception
when others then
-- failed validation
ta_system.writeSystem('ERROR: xml instance message failed schema validation '||C_PROCEDURE_NAME||'.');
-- return a new wellformed instance
ta_debug.writeDebug('DEBUG: creating new empty instance '||C_PROCEDURE_NAME||'.');
v_xml_new := xmltype.createXML(xmldata => rm_xml_survey_maintenance.C_EMPTY_SURVEY_XML_INST,
schema => rm_xml_survey_maintenance.C_SURVEY_SCHEMA_NAME);
ta_debug.writeDebug('DEBUG: creating dom reference '||C_PROCEDURE_NAME||'.');
doc := dbms_xmldom.newDOMDocument(v_xml_new);
-- attempt to populate return xml instance with source info
ta_debug.writeDebug('DEBUG: attempting to acquire and populate source info '||C_PROCEDURE_NAME||'.');
ta_debug.writeDebug('DEBUG: source information requesterID is '||
ta_xml_utils.xml_extract_no_exception(v_xml_return, '/SurveyRequest/messageSource/requesterID/text()')||' '||C_PROCEDURE_NAME||'.');
docelem := dbms_xmldom.getDocumentElement(doc);
nodelist := dbms_xmldom.getElementsByTagName(docelem, 'requesterID');
node := dbms_xmldom.item(nodelist, 0);
childnode := dbms_xmldom.getFirstChild(node);
the last line causes the code the throw:
ERROR: SQLCODE = -31020 SQLERRM = ORA-31020: The operation is not allowed,
Reason: Invalid pl/sql DOM Node hdl
ORA-31154: invalid XML
(rm_xml_survey_maintenance.create_cad_plan_pair).
this code is operating after an xmltype fails to validate. would this be the cause?
are there any simpler methods using pl/sql, the xmltype and xpath to modify contents of an xmltype instance?
any advice most appreciated.

I can't answer the better/simpler method part of the question, other than to say there is an UpdateXML function but it works only from within the scope of a SQL statement. Not sure whether you'd want to make a SQL call just to do something to your XMLType that exists only in PL/SQL.
In regard to your current error, I can only say the following script does not produce an error. If you can develop a test case/script that reproduces the error that would be helpful. You may even uncover the error at that point. Have you confirmed the contents of v_xml_new and if on 10g used DBMS_UTILITY.Format_Error_Backtrace to verify the line that threw the error?
declare
   v_xml_new xmltype;
   doc       dbms_xmldom.domdocument;
   nodelist  dbms_xmldom.domnodelist;
   node      dbms_xmldom.domnode;
   childnode dbms_xmldom.domnode;
begin
  v_xml_new := XMLTYPE(
  '<?xml version="1.0" encoding="UTF-8"?>' ||
  '<SurveyRequest>' ||
   '<messageSource>' ||
    '<requesterID>U571</requesterID>' ||
   '</messageSource>' ||
  '</SurveyRequest>'
  doc := dbms_xmldom.newdomdocument(v_xml_new);
  nodelist  := dbms_xmldom.getelementsbytagname(doc, 'requesterID');
  node      := dbms_xmldom.item(nodelist, 0);
  childnode := dbms_xmldom.getfirstchild(node);
end;

Similar Messages

  • While trying to instal Mountain Lion OS on my macbook pro, I got the error message that my HD was damaged and it reverted to my Lion OS. Why does this happen? I bought the OS online through the app store

    While trying to instal Mountain Lion OS on my macbook pro, I got the error message that my HD was damaged and it reverted to my Lion OS. Why does this happen? I bought the OS online through the app store.

    The Mountain Lion installer looks at your internal drive to make certain that it's error-free before continuing installation. You should have an application named "Install OS X Mountain Lion.app" in your Applications folder now so you shouldn't have to download it again. Do this...
    Boot to your Lion recovery partition by holding down both the Command and the R keys while booting. Open Disk Utility from the Recovery partition and select your hard drive (usually named "Macintosh HD" unless you've renamed it) and click on Verify Disk. If you come up with any errors, click on Repair Disk. At the end of the cycle you will get a message that the disk was successfully repaired or a message that the hard drive could not be repaired.
    If you're able to repair the disk, just reboot as normal and open the "Install OS X Mountain Lion.app" and the installation will proceed. If Disk Utility was unable to repair the disk, you need to get to your local Apple Store as soon as possible so that they can see if the disk is salvageable or beyond repair.
    Good luck,
    Clinton

  • I am always getting the message ' could not complete due to program error" Why does this happen

    I am always getting the message ' could not complete due to program error" Why does this happen

    Without knowing a lot more details we can't tell you anything. This is just the most generic Photoshop error message imaginable. What system are you on? What version of Photoshop? what are you doing when the error occurs? Provide as much info as you can. Refer to this as a start:
    Working with your Operating System’s Tools
    Mylenium

  • Why does this message keep appearing when i try to instal windows 7 through bootcamp? - "something went wrong and the USB cannot be configured for the installation"

    Why does this message keep appearing when Itry to instal windows 7 through bootcamp? - "Your bootable USB drive could not be created. An error occurred while copying the Windows installation files."

    Found a solution!
    Follow the extended version of these directions here:
    https://discussions.apple.com/docs/DOC-3581
    Worked like a charm!

  • TS4268 why does it say "an error occurred during activation. Try again." and when I try again it says the same thing?

    Why does the message "an error occurred during activation. try again." keep coming up. I have tried to log in with a different Apple ID and when I pick the e-mail that I would like to receive messages, it sends and allert that states, "unable to verify email because it is already in use."
    How do I log back in?

    See if this previous discussion helps.
    Can't Activate FaceTime

  • Why does logout give timeout error in Local system(India)

    While logging out of the CRM webUI thre system does not signout but waits for the page
    www.sap.com to open and finally gives a timeout error.
    Why does this occur?

    Role based grants are not available within the stored procedures.
    Only explicit grants are recognized when compiling stored code.
    You need to grant select on that table to the user where you are creating this procedure.

  • I use Firefox 6.0.2. When I shut the browser and try to reopen it I get a message saying that Firefox is still running and that I should reboot. This happens constantly. Why does this happen and is there a way around it?

    I use Firefox 6.0.2. When I shut the browser and try to reopen it I get a message saying that Firefox is still running and that I should reboot. This happens constantly. Why does this happen and is there a way around it?

    There are a few possible causes for that error, for details see [[Firefox is already running but is not responding]].

  • Does Hibernate throw and error if the result set is above a specific #

    Does Hibernate throw and error if the result set is above a specific #
    of records?

    why do you ask?Maybe he hasn't been able to find the bug in his code yet, so he's casting further and further about for more and more esoteric explanations for what he's seeing? ;-)
    (God knows I've been there...)

  • TS4268 My iMessage doesn't work on my iPad. My software is up to date, wifi is working, apple ID is working but the verification stops and goes back to sign on. Why does this happen?

    My iMessage doesn't work on my iPad. My software is up to date, wifi is working, apple ID is working but the verification stops and goes back to sign on. Why does this happen?

    Look at no. 5 in this text which was copied from Apple's support site for troubleshooting Messages and FaceTime activation.
    Troubleshooting Apple ID activation
    After each step, toggle iMessage and FaceTime off and then on again in Settings > Messages and Settings > FaceTime.
    Update to the latest version of iOS.
    Ensure that you have an active Internet connection. You can complete activation using Wi-Fi or a cellular data connection. Check your Wi-Fi network using standard Wi-Fi network troubleshooting.
    If you receive an error when signing in to your Apple ID, visit myinfo.apple.com, sign in to your account, and ensure that the primary email address has been verified.
    Ensure that FaceTime has not been restricted: Settings > General > Restrictions > FaceTime.
    In Settings > General > Date & Time, ensure that Set Automatically is on. If Set Automatically is on, but the incorrect time zone is displayed, turn Set Automatically off and then choose the correct time zone, date, and time. Then turn Set Automatically on again.
    Enable iMessage and FaceTime while connected to another Wi-Fi network in a different location.
    This is the support kb article.
    http://support.apple.com/kb/ts4268

  • WriteDomain( dir ) does not throw an error!

    we are trying to automate our domain creation using wlst. If there is an error in the script we expect our program to throw an error such that we can take some preventive measures. That said, we have such script that loads a template and writes the domain to a directory. If for some reason writeDomain fails it does not throw an error!. Which lets our script continue and fail miserably later.
    Is this a bug??
    Thanks,
    /pete

    I have not had that problem. In my script (using WLST on WebLogic 8.1sp5 on Solaris 9) I specified a directory that my user could not create and the return code to UNIX was 255:
    Trace:
    INFO: Writing domain
    Error: writeDomain() failed.
    Traceback (innermost last):
    File "/usr/local/met/btwlst/0_50/bin/load_template.py", line 78, in ?
    File "initWls.py", line 70, in writeDomain
    com.bea.plateng.domain.script.jython.WLSTException: com.bea.plateng.domain.script.ScriptException: com.bea.
    plateng.domain.GenerationException: Unable to create domain directory: /wls_domain/ecommware2a
    at com.bea.plateng.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHan
    dler.java:33)
    at com.bea.plateng.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:897)
    at com.bea.plateng.domain.script.jython.WLScriptContext.writeDomain(WLScriptContext.java:465)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
    at org.python.core.PyMethod.__call__(PyMethod.java)
    at org.python.core.PyObject.__call__(PyObject.java)
    at org.python.core.PyInstance.invoke(PyInstance.java)
    at org.python.pycode._pyx0.writeDomain$14(initWls.py:70)
    at org.python.pycode._pyx0.call_function(initWls.py)
    at org.python.core.PyTableCode.call(PyTableCode.java)
    at org.python.core.PyTableCode.call(PyTableCode.java)
    at org.python.core.PyFunction.__call__(PyFunction.java)
    at org.python.pycode._pyx3.f$0(/usr/local/met/btwlst/0_50/bin/load_template.py:78)
    at org.python.pycode._pyx3.call_function(/usr/local/met/btwlst/0_50/bin/load_template.py)
    at org.python.core.PyTableCode.call(PyTableCode.java)
    at org.python.core.PyCode.call(PyCode.java)
    at org.python.core.Py.runCode(Py.java)
    at org.python.core.__builtin__.execfile_flags(__builtin__.java)
    at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java)
    at com.bea.plateng.domain.script.jython.WLST_offline.main(WLST_offline.java:67)
    Caused by: com.bea.plateng.domain.script.ScriptException: com.bea.plateng.domain.GenerationException: Unabl
    e to create domain directory: /wls_domain/ecommware2a
    at com.bea.plateng.domain.script.ScriptExecutor.runGenerator(ScriptExecutor.java:2143)
    at com.bea.plateng.domain.script.ScriptExecutor.writeDomain(ScriptExecutor.java:531)
    at com.bea.plateng.domain.script.jython.WLScriptContext.writeDomain(WLScriptContext.java:459)
    ... 21 more
    Caused by: com.bea.plateng.domain.GenerationException: Unable to create domain directory: /wls_domain/ecomm
    ware2a
    at com.bea.plateng.domain.DomainGenerator.generate(DomainGenerator.java:137)
    at com.bea.plateng.domain.script.ScriptExecutor$2.run(ScriptExecutor.java:2120)
    com.bea.plateng.domain.script.jython.WLSTException: com.bea.plateng.domain.script.jython.WLSTException: com
    .bea.plateng.domain.script.ScriptException: com.bea.plateng.domain.GenerationException: Unable to create do
    main directory: /wls_domain/ecommware2a
    Script Exit code = 255

  • Lately when I sync certain albums to my iPhone, the tracks are duplicated one behind the other so that I have to listen to each song twice. Why does this happen and how can it be fixed?

    Lately when I sync certain albums to my iPhone, the tracks are duplicated one behind the other so that I have to listen to each song twice. Why does this happen and how can it be fixed?

    Very strange behavior.  Don't entirely give up on the "Manually Added Items" category ... I have seen things magically appear there even after I've checked and seen nothing there.  I think things got real quirky when Apple released iCloud ... I don't remember extra copies of purchases lingering on my iPhone once transferred to my library before that.  Sure, if I bought an album directly to my iPhone it would stay on there even after I sync to my library, but if I deleted the album from the iPhone it stayed deleted.  Now it seems that there are some phantom copies that come and go with no explanation.
    jcburbank wrote:
    I've tried deleting the album from both the phone and from iTunes and then redownloading them to both and the same problem occurs.
    If you're re-downloading an album to iTunes and your iPhone, that may perpetuate the problem.  What happens if you completely delete every copy of the album, then just download to your iTunes library and then sync the album to your iPhone from your library?  That should put only one copy on your iPhone.
    A few other things to try:
    1- Completely sign out of your Apple account on your iPhone, then re-sync to iTunes, then sign into your account on your iPhone again.  Maybe throw in a Reset or at least a power OFF/ON somewhere in the middle.
    2- Go to Settings/ General/ Usage, then select Music and when you see All Music, swipe your finger across it and tap the Delete button.  Before doing anything else, Reset your iPhone.  This does not actually delete your music, but seems to clear up some cobwebs left behind (people use this technique to reduce "Other" that swells up over time).

  • I cannot send an email from my iPad 2? No problem receiving, why does this happen? Have tried the suggestions for setting up email and after doing the sync mail through iTunes receiving worked great but still cannot send? Any help would be great

    I cannot send an email from my iPad 2? No problem receiving, why does this happen? Have tried the suggestions for setting up email and after doing the sync mail through iTunes receiving worked great but still cannot send? Any help would be great!

    The fact that you can receive means you have a valid e mail address, and have established the connection to the incoming server, so all of that works.  Since the send does not work, that means your outgoing server is rejecting whatever settings you used formthe outgoing set up.  Try them again. 
    Google your particular isp, and ipad and many times you will find the exact settings needed for your isp.  Or tell us here, and soneone else may be on the same isp.  Some mail services need you to change a port, or have a unique name for the outgoing server.  
    Kep trying.

  • HT201209 iTunes will not use the redeemed gift cards on my account, I have a $30 credit and when I try to purchase a song it goes right to my credit card on file. Why does this keep happening

    iTunes will not use the redeemed gift cards on my account, I have a $30 credit and when I try to purchase a song it goes right to my credit card on file. Why does this keep happening???

    Any time you've changed anything in your billing, it does this once to very things.

  • TS4062 when i sync my iphone a large portion of my music does not download but rather stays in the cloud. then i must download it from the cloud. why does this happen and how can i stop it from happening

    every time that i sync my iphone with a cord to my imac some large portion of my music is placed in the cloud so that i must down load it from the cloud. this includes music that i have purchased on itunes and other music. it seems random.
    why does this happen? is it a setting? i want to stop it. and music that w

    It was gift back in September. You can follow the instructions in the link below to remove them:
    Remove iTunes gift album "Songs of Innocence" from your iTunes music library and purchases - Apple Support

  • My iphone is suddenly populated by random songs I've downloaded in the past. Why does this happen, and what are apple doing about fixing this?

    Why does this happen?
    What do other people do? (I can't go to sleep knowing there's a rogue album or song in my music. It's 2am now)
    What do we tell apple so that they actually fix it. None of us want to pay £25 to have our own music.

    I am on the monthly payment plan because nobody at BT has told me there is any alternative!
    Each year there I have a long, in-depth conversation with the person who sets up the contract for the next year but the gist of the thing is 'I'm  not going to be paying more than [x amount] per month, am I? Because I can't afford any more'' and each year the person says that no, in fact I should be paying less... and then without notice and even with the bill saying 'We will continue to take....' a totally different - and higher - sum disappears from my bank account.
    Then I go through the painful process of writing to complain about this, get some sort of sum refunded and then the payments go through at the level they should, with me paying any additional (usually small) amounts for usage over the allowance. Until contract end when we start all over again...
    Even if the amount they seem to randomly decide on is based on some sort of forecast, this should not be happening as I am doing what they instruct me to do on the bill to keep my payments the same.
    So something is going wrong, on many levels.
    At no point have I been offered the sort of 'monthly billing' described here; maybe there is some reason I am not allowed it. Unfortunately 'whole bill' direct debit payment is beyond me. I really need to know what I will be paying each month and I need BT to correctly take that amount, as agreed, each month, from the get-go.
    It shouldn't be that hard really! Does anyone from BT read these forums? Can somebody take this on and finally get this straight, please?

Maybe you are looking for

  • First impressions... There's still a long, long way to go

    I'm a very experienced (and still heavy user) of Windows Mobile (not Windows Phone). The Playbook is my first Blackberry and I have been using it for 2 weeks now. I believe both the hardware and OS have much potential but currently feel the latter ha

  • Disable an Input field with the help of a radio button selection.

    Hi Guys, I know it is a very basic question and also has many threads for the mentioned query. None of the threads gave me a real clue about the problem. It is as follows: Simply, I have an input field and there are two more radio buttons on the scre

  • Missing BIOS 26.4 file for MSI H97M ECO motherboard

    The BIOS 26.4 file seems to be missing from the download page for the MSI H97M ECO motherboard - I get an error when clicking on the link in the UK download site. I have installed the 26.3 file instead and I am getting very strange fan rpm on the ECO

  • Can Care Centre install another language into 5800...

    My phone is purchased in Malaysia, and I'm using original firmware which only support input in Malaysian language, Indonesian language, English and Simplified Chinese. I wish I can TYPE Traditional Chinese (Hong Kong) on my phone (it's able to displa

  • Why do I have three versions of illustrator and which one should I use?

    Hello, I have CC, CC 64 bit, and CC 2014 on my computer.  Is there a difference?  I originally downloaded both CC and CC 64 bit because I didn't know if it mattered or not which one I use.  Then the 2014 version was in creative cloud, and I figured i