Adding an attribute to some pre-existing XML

Hi all,
I have a table with some small XML documents in a CLOB column and i'd like to add an attribute to one of the elements using SQL. Neither the table nor the XML is "mine" so I can't make any significant changes to the structure or current content - I just want to add this one attriibute.
For example a row has this value in the CLOB column :
<?xml version="1.0"?>
<product>
<detail>
<supplier id="12345"/>
</detail>
</product>
and i'd like to add a "test" attribute to the <product> element, like this :
<?xml version="1.0"?>
<product test="yes">
<detail>
<supplier id="12345"/>
</detail>
</product>
I'd hoped updateXML would do it like this, but it won't (unless the attribute already exists, which alas it doesn't always) :
select updatexml(xmltype(my_xml_column), '/product/@test', 'yes') new_xml
from my_table
Can anyone help me here? I've not really delved too deeply into Oracle's XML (or XML generally for that matter) and just need to perform this simple update!
Thanks,
Steve

Thanks for this. I had looked (briefly!) at this package but it did seem a little over complicated for what i wanted - ideally I just wanted to write a SQL statement to do it all.
Is there not a simpler way?
Steve

Similar Messages

  • In ical I just added new calendars to a pre-existing calendar group, I can make events with these calendars, but not reminders, any suggestions?

    in ical I just added new calendars to a pre-existing calendar group, I can make events with these calendars, but not reminders, any suggestions?

    Hi,
    Lion has changed the way reminders (todos as was) work. They now seem to need to be in a seperate calendar.
    In iCal open the File menu and select New Reminder List... and select where to put it.
    Best wishes
    John M

  • Adding a character into a pre-existing filename; Bridge CS5.1

    I would like to know if it is possible  to add a character or in my case a ( Character & a Space ) in-between an already  pre-existing sequential number
    For example,
    1301 Filename.jpg - - - - -> 13 01. Filename.jpg  ( Added a ( Space ) inbetween the two numbers, and placed a ( Period ) aswell.
    I would like to do this action to a group of files using the Batch Rename Feature; inside of Adobe Bridge CS5.1
    Is this possible? Is there a work around?

    I understand how string substitution works, you are misinterpreting the question.
    I would like to change the number sequence from.
    1301 Filename.jpg - - - - - - - -> 13 01. Filename.jpg
    1302 Filename.jpg - - - - - - - -> 13 02. Filename.jpg
    1303 Filename.jpg - - - - - - - -> 13 03. Filename.jpg
    1304 Filename.jpg - - - - - - - -> 13 04. Filename.jpg
    1305 Filename.jpg - - - - - - - -> 13 05. Filename.jpg
    As you can see I would like to ( Add ) Characters not replace. the characters being a ( Space ) and a  ( Period )
    But if there is a way to replace all of my sequence numbers together, that would be a viable option aswell.As of now I am not aware of a substitution command that will get rid of say a four digit combonation of numbers no matter what the actuall numbers
    That last sections of what you copy and pasted states there may be commands ( Expressions ) to replace filename patterns, but I am not aware of any specific commands ( Expressions ) I must type inside of the text bar to achieve the affect I am looking for.
    Any pre-existing help on Expressions?
    They are foreign to me and I would like to study the information for future use.
    I will be searching Google, if by chance I come across information pertaining to this subject, I will let you know. As of now any help is much appreciated.
    Ok I have figured out how to get rid of the string of numbers by using the Regular Expression of [0-9] but,
    I still do not know how to add a ( space ) inbetween the numbers without doing it all manually.
    Regular Expressions is the answer to my question, but now I have a new question. Which Regular Exresion do I use? It seems like it will take quite some time to get a good understanding of Regular Expressions, is there anyone who has a fair amount of knowledge on the subject who is willing to assist me in the mean time?

  • Adding a single page to pre-existing website

    I currently have a website running on Amazon S3 and want to add a page to the domain using Muse and do not want to replace the pre-existing website.
    Example:
    Current web address:
    subsite.mywebsite.com
    Desired address of Muse-created site:
    subsite.mywebsite.com/musesite.html
    subsite.mywebsite.com does not need to be modified in any way—my clients just need to be able to access musesite.html via a link using my brand's domain. Can this be accomplished using BusinessCatalyst provided hosting? If so, how can I accomplish this?

    Hi Joseph,
    You need to create the page in Muse and then export the html to a local folder on your computer and then upload the exported content on the root folder of your existing business catalyst site. You will not be able to use the web forms with this approach.
    If you can host the site in a sub directory, then you can create the page in the Muse and then publish directly to a sub-directory on the root, this way you will be able to use the web forms.
    - Abhishek Maurya

  • How can I get the Attribute Value in the existing XML Elements-Reg.

    Dear All,<br /><br />  I have the InDesign Document with xml Based, now I want to get the XML Elements name and XML Attributes for each Elements, using SDK Concepts. <br /><br />Example:<br /><br /> <chapter>  chapter1 </chapter> id = "ch001"<br /> <sec> Section ....</sec> id ="se001"<br /> <para> para ....</para> id="pa001"<br /><br />How can I get the XMLElements & XML Attributes in the InDesign-XML Structure.<br /><br />Please  any one can suggest me....<br /><br />Thanks & Regards<br />T.R.Harihara SudhaN

    Dear Dirk
    Many Thanks for the Suggestions, Now I search and study the XML concepts. Meanwhile, I need your suggestions for further Development in SDK -XML concepts.
    I am using the SnippetRunner -SDK file, their given some XML based programmes. [Create XML Elements, Elements + Attributes, XML Comments] and etc...
    Hope U will help me to Develop the SDK- XML Concepts.
    Thanks & Regards
    T.R.Harihara SuduhaN

  • Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF

    Hi All,
    When i have tried to build a war with MAVEN, i am facing the below error, please let me know in case of any helpouts
    Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

    This is what I was looking for: http://maveninjdeveloper.blogspot.com/2012/04/handle-adf-application-maven-ant.html
    It further references:
    - http://docs.oracle.com/cd/E24382_01/user.1112/e17455/deploying_apps.htm#BACIIDEJ
    - http://javaosdev.blogspot.in/2011/12/ojdeploy-documentation-for-tool.html
    The only issue now is that Oracle JDeveloper release 11.1.2.2.0 (version being used) does NOT seem to support Ant while release 11.1.2.1.0 does. This necessitates a further kluge to make things work. The amount of difference between versions of JDeveloper is quite amazing.

  • Adding an Attribute to a VO changes the custom properties of the existing

    Adding an Attribute to a VO changes the custom properties of the existing attributes of the VO.
    We had a requirement to add an extra column in the VO.
    We modified the underlying EO to include the new column from the table, and modified the VO as well.
    Jdeveloper was changing the custom properties of the existing attributes in the VO. Our fix was not working as expected.
    Could anyone please inform us:
    1. On what logic does Jdeveloper determine to modify the existing custom properties of other VO attributes.
    2. Can this behavior of Jdeveloper be controlled through any mechanism.
    Thanks in advance,
    Rahul.

    Hi,
    which version of JDeveloper and how to reproduce ?
    Frank

  • Adding a pre-existing podcast to iTunes U using the feed method.

    While trying to add another pre-existing CSULB podcast to our CSULB on iTunes U (using the "feed" method), I encountered an error message that I don't know how to interpret.
    Can you help me with this or is there somebody else at Apple I should work with?
    The pre-existing podcast is at: http://www.ccpe.csulb.edu/citt/podcast/feed.aspx
    The error message reads:
    "While attempting to download. . . iTunes U encountered an authorization error and could not update the content. Verity your authorization access to the feed specified in the feed URL field, including the user name and password permissions, and then try again."
    I have no idea what this means. Can someone please help?
    Walter

    bgerth wrote:
    Is anyone using Podcast Producer 2 to publish content on iTunes U, and if so, does it work reasonably well (do you recommend using it)?
    Its spiffy. I like it, but I'm a softie when it comes to Apple stuff.
    Am I correct in thinking Podcast Producer 2 can only be used to create an RSS feed to point to podcasts stored in its Podcast Library or can you use Podcast Producer to upload files into our institutional iTunes U storage space (yes we are fortunate to have access to Apple's 500 GB storage space)?
    You can choose to do either. Although I haven't seen anything official, I suspect that Apple prefers the use of Podcast Library…but that's just a preference, not any sort of recommendation or future direction. In the end, I suggest (and I think Apple would agree) that you do what makes the most sense for you. For example, we choose to do it both ways.
    Can you provide a link to instructions (or explain how to either identify in iTunes U that the podcast is in Podcast Producer's Podcast Library as an RSS Feed or how to upload the podcast from Podcast Producer to a specific tab in a specific iTunes tab.
    I believe someone (a friend from Apple…??) released a PcP workflow action that deals with iTunes U the same way as PcPv1 did. Overall, though, probably the best kept PcP secret is that Podcast Producer is a generalized workflow solution. Sure, it's cast as a podcasting solution…but if you can get OS X Server to do something, you can get Podcast Producer to turn it into a workflow…anything. Since OS X Server can be scripted to upload content to iTunes U, Podcast Producer can handle that too.
    I appreciate any information given as I have tried with little success to find this information in either the iTunes U or Podcast Producer Admin guides.
    Thanks!!
    BGerth

  • Adding Sequence to pre-existing Encore project

    I want to add a sequence to a pre-existing Encore project, though the dynamic link can only start a new project. Do I have to export it as a .mov file first, then import it into Encore?

    This question has been asked by plenty of users. When you use Encore first by dynamic linking from Premiere, there's no reason to know that the reverse is  built in. And it is not obvious as to where the command is located.

  • Changing an existing XML-File

    Hello everybody,
    is there any way to change an existing xml file (adding an xml element, for example), without copy the hole file?
    I've found kxml2 which can parse the xml files or build new xml files, but it doesn't support changing...
    Thank you
    Micha

    Pradeep thank you for your response. it was helpful. However, I also found the responses to both my questions.
    i. The null pointer exception was due to using a complex query I was using in the LOV query. I tried a simple query and that worked fine.
    ii. For modifying the user defined attributes one can consult the following forum post:
    OIM 11g - Change UDF Field Type form String to LOV
    Thanks

  • When I sync my ipod to add new material, sometimes itunes will automatically rearrange the song order of my pre-existing albums by number of plays. Why does it do this? And is there a way to stop it?

    When I add an album to itunes and subsequently to my ipod, everything is arranged by track number of the album. Sometimes when I sync in order to add new material to my ipod, itunes for some reason automatically rearranges some of my pre-existing material by songs with the greatest number of plays to least (though sometimes it seems to be completely random). When I check itunes on my computer, everything still appears to be in order but the way it appears on the device often is in the previously mentioned disorder. Why does it do this? Is there any setting that I can adjust to make it stop because the only way I've found so far is to delete the rearranged material and re-import the cd and then re-sync. It might sound picky, but I prefer that my music be in order by track number as the artists themselves intended for various reasons the foremost being that I often listen to whole albums from start to finish and this glitch makes such problematic. I have found some settings in preferences that focus on how material is arranged but this seemed to be focused on the actual folders where the music is located on my hard drive and not the way it appears on the ipod. If anyone knows the reason it does this or has suggestions on fixing it, I would be greatly appreciative. Thanks.

    Did the original songs that do not appear on the car player play in the Music app on the iPod? Sometimes glitches happen and they do not. Also, If y ohave a 5G iPod/iOS 7, purchase songs  will show with an cloud icon by them if they are not downloaded if Shall All is turned on in Settings>iTunes and App Store

  • How to update Elements value inside existing xml file

    Hi Gurus,
    Am somehow new to java and working on xml with java, i have a scenario where i want to update the elements of my existing xml file, i know its possible as i have posted one code on this forum which updates the values of the arrtibutes of existing xml file. Ref :
    http://forum.java.sun.com/thread.jsp?forum=34&thread=186091&start=15&range=15&hilite=false&q=
    But am not able to use the same code to update the vlaues of the attribute.
    if i have this xml file :
    <?xml version="1.0"?>
    <RootElement>
    <Transaction>
    <Task9>
    <TaskID>Task9</TaskID>
    <Description>My Test Case</Description>
    <Time>12/12/2004</Time>
    </Task9>
    </Transaction>
    <Transaction>
    <Task2>
    <TaskID>Task2</TaskID>
    <Description>Testing my xml</Description>
    <Time>12/12/2004</Time>
    </Task2>
    </Transaction>
    </RootElemen>
    Now i want to update teh </Description> and </Time> field using the code that i have given above in the link.
    If any one can help me ill really appreciate.

    The value of an element is stored in a child node of that element. For example, let's say that "e" references the node <Description> then:
    e.getFirstChild().getNodeValue() => "My Test Case"

  • How do I find the ports a pre existing program used in DAQ?

    Hi all, 
    I am setting up a laser displacement sensor and trying to utilize a pre existing program that was created by graduate students before me. There are 4 wires coming from the laser displacement sensor that need to be connected to the DAQ but we have no information telling us where these wires are supposed to attach to the DAQ in order to run the pre existing program correctly. 
    Is there any way that we could figure this out? 
    Thank you for your help,
    mccutchen12c

    James, 
    Thank you for your help! Yes, we have looked at a couple different methods on how to tell if the information had been programmed by the previous grad students and we haven't had any success in finding that information. So I believe you are right in assuming its not documented.. We will do a better job of documenting for future grad students after us. 
    I have attached our code. Any insight you could give would be greatly appreciated!
    We have an Acuity AR200-6 laser displacement sensor with green, yellow, black and a wire that isn't wrapped that all lead to the serial port in the back of the computer and ground. We then have white, blue, orange and brown wires that do not have a location.. We did some research and the are as follows:
    white: laser disable
    blue: buttons disable
    orange: voltage output
    brown: voltage RTN
    We are starting to wonder if we are just not supposed to use the DAQ.. Can you confirm the connection is solely through a serial port? 
    Cheers, 
    Carley

  • How do I find and include pre-existing music files on my PC?

    I'm new to iTunes and believe that I should be able to find and include pre-existing music files on my PC?
    I've found out how to show the menu bar but I can't see how to do the above except file/folder by file/folder.

    Hello there, LeighCenturion.
    The following Knowledge Base article provides instruction on how to add content from your computer to iTunes:
    Adding music and other content to iTunes
    http://support.apple.com/kb/HT1473#2
    Specifically:                     
    Adding content on your computer to iTunes
    iTunes helps you add digital audio and video files on your computer directly to your iTunes library. You can add audio files that are in AAC, MP3, WAV, AIFF, Apple Lossless, or Audible.com (.aa) format. If you have unprotected WMA content, iTunes for Windows can convert these files to one of these formats. You can also add video content in QuickTime or MPEG-4 format to iTunes. To learn how to add these files to iTunes follow the steps below.
    Open iTunes
    From the File menu, choose one of the following choices:
    MacAdd to Library
    Windows
    Add File to Library
    Add Folder to Library
    Navigate to and select the file or folder that you want to add
    If iTunes is set to "Copy files to the iTunes Music folder when adding to library," iTunes will copy all content that is added to the iTunes library to the iTunes Music folder. To adjust this setting or change the location of this folder, go to the Advanced tab in iTunes Preferences.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Updating an existing xml file using java code

    hi friends,
    I have simple problem, I have an existing xml file and I want to update some of the values in the file.
    can any one send me the java code for that.
    bye.
    -harish

    org.w3c.dom.Document d = parseXmlFile("D:/www/Detailcache/detail.xml", false);
    public static Document parseXmlFile(String filename, boolean validating) {
    try {
    // Create a builder factory
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(validating);
    // Create the builder and parse the file
    Document doc = factory.newDocumentBuilder().parse(new File(filename));
    return doc;
    } catch (Exception e) {
    System.out.println("ERROR-->");e.printStackTrace();
    return null;
    look at .. for more related examples
    http://javaalmanac.com/egs/javax.xml.parsers/BasicDom.html?l=rel

Maybe you are looking for

  • Nano not showing up in iTunes or My Computer

    I had to reformat my computer hard drive and reload my computer with Windows Vista Ultimate. I lost all of my music on my computer but they still are on my Nano. I tried to reload the music from my Nano to my computer but that didn't work and now I c

  • Master List Horizontal Layout Woes

    I'm combining a jQuery horizontal scroller with Spry datasets. How's that for an invitation for trouble? My Master List items are literally stacked ontop of one another, and I cannot for the life of me figure out how to distribute them horizontally u

  • PowerPC apps are no longer supported.

    I updated my Macbook Pro to Lion 10.7.4 and now Photoshop CS won't open because PowerPC apps are no longer supported. Any ideas? Free ones preferably

  • Updating iphone 4 to ios 5 is required?

    ios 5 full version is released right????how can i update my iphone 4 to ios 5???

  • Alarm clock 8.0.2

    iPhone 6 running iOS 8.0.2. I set my alarm last night for 6 am. It never went off. I opened the clock app and it was off.  So I reset the alarm for a minute in the future, turned it on, put it to sleep, and tried again. The alarm did not go off again