Delete xml element

I have a query here
SELECT XMLELEMENT("emp",CHR(10),chr(9),XMLELEMENT("empno",XMLATTRIBUTES(EMPNO AS "value"),CHR(10),chr(9),null),CHR(10)) FROM EMP
WHERE EMPNO=7369
the output is
<emp> <empnovalue="7369">
</empno>
</emp>
here I dont want to show </empno>
my output shold be like this
<emp> <empnovalue="7369">
</emp>
Please help me.
Thanks.

my output shold be like this
<emp>
<empno value="7369"/>
</emp>
SQL> SELECT XMLELEMENT ("emp", XMLFOREST (XMLELEMENT ("empno", xmlattributes (empno "value")) "empno", NULL AS "empno").EXTRACT ('empno/*')).extract('*') xml
FROM emp
WHERE empno = 7369
XML                                        
<emp>                                      
  <empno value="7369"/>                    
</emp>                                     
1 row selected.

Similar Messages

  • Delete xml element not used in document

    Hi,
    If you have a number of texts tagged with an xml element and then delete the text, the element still exist in the structure.
    You can see the element still connected to a text, by the blue diamond on the element symbol.
    But i want do delete the elements that have no connection to texts, but cant find the right property to look for.
    In Java script CS4.
    Anyone knows?
    /Mikael

    If the (text) element is unplaced, its parentStory will be an XmlStory rather than a Story.
    So try:
    var elements = app.activeDocument.xmlElements[0].xmlElements.everyItem().getElements();
    for (var i = elements.length - 1;i >= 0;i--){
        if(elements[i].parentStory.constructor.name === "XmlStory"){
            elements[i].remove();
    This is untested. If you have tagged graphics frames it will need to be modified to not error on those.
    Jeff

  • Deleting XML element in ABAP mapping

    hi All
    I Have I huge xml filen that has to go to an Idoc , but I only want to use the header data.
    is there a way of deleting the unwanted xml elements and their children elements in ABAP mapping.
    Thanks.

    Hi Ravi and all
    Actually I did as you said, but I get this error.
    <Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException:
    XMLParser: Prefix 'ns1' is not mapped to a namespace(:main:, row:177, col:25)
    This position 177 , is the element that is not needed , so I thought if I can delete it , I can get rid of this error and move forward.
    May be you have antoher suggestion to get rid of this error.
    Thank you.

  • How to delete xml tags Urgent

    on release function i am inserting this value
    "(&-box*&", "&*box-&
    " in to my text box,
    in text box will display like this (squarebox), when i am
    trying to delete
    squarebox ,
    box deleting but
    (&-box*&", "&*box-&
    these xml elements are showing , what i have to
    do ? it has to delete,
    it amy have multipule box in my equation. how do delete xml
    elements in this case, this is my xml code. how to delete? any one
    can help me?

    Then you should provide more details on what you want this new script should do.
    To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
    Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project.

  • How can we get the reference of XML element on frame as soon as frame is created in Document?

    Hi,
    When ever we copy any text/table cells from any frame, and paste it directly on page, A new Frame is created and the pasted text is placed inside that frame.
    Now to capture this frame creation, We have two possible solutions:
    1) Attach Observer on Document 'kDocBoss' on IID_IHIERARCHY_DOCUMENT and it will notify on frame creation in update function.
    2) Notification event on new story creation.
    Now, I need to perform some changes in the newly created table, for example:
    a)  Need to delete XML tags from newly created frame
    b)  Need to perform action on table cells if any in the created frame.
    But the problem is, when the event comes, I can access basic properties of frame like it's name, type etc, but it does not give me the
    XML element on frame or tables in frame until the event is com pleat.
    I know it's quite a specif requirement, but I guess many of you might have faced these kind of challenges, while processing the event.
    Does any one has any idea how I can get the reference of XML element on frame as soon as it is created?

    Hi Kapoor,
    please give also others a chance, and excuse that I get up late on vacation ;-)
    Anyway, I'd keep the story creation responder to recognize the copy, then combine it with an observer on the backing xml story to catch the associated XML element which is created there. Something like below:
    UIDRef xmlStoryRef = Utils<IXMLUtils>()->GetBackingStore(doc);
    InterfacePtr<ISubject> subject ( xmlStoryRef,IID_ISUBJECT );
    subject->AttachObserver(observer,IID_IIDXMLELEMENT,observer->GetAttachIID());

  • Hiding XML elements in the structure view – scripting influence to the structure view?

    Hi
    Is there a way to hide specific XML elements (really the elements and not the attributes) in the structure view?
    I am asking this question to know if it is possible to influence the structure view by scripting.
    Many elements are indeed used as a kind of help for constructions which have nothing to do with the actual contents especially in the case of tables.
    You inflate the the structure view unnecessarily and the author will lose track of the real contents. It would be nice if there was a possibility to hide those help construction elements.
    Thank you for any hints.
    Regards
    Apollo102

    Hello Apollo,
    There is a way to hide elements from the Structure View (one such method is offered by the free AXCM plug-in). What happens when you use AXCM (or other methods to hide elements) is that the elements get wrapped into hidden content. This might make the structure view less complex for your authors, but has a number of disadvantages and dangers.
    1. The structure is normally invalidated, as the helper elements are usually required.
    2. Accidentally deleting hidden content may make the invalidation permanent and render your documents useless.
    It is NOT good practice to hide elements from authors in the structure view. Instead, you should either teach authors about the structure, or let them work in the Author View while adding sufficiently clear formatting to show them the underlying structure. In some cases, it might be better to create an authoring structure which is automatically transformed into the required full structure using an XSLT or other processing step. I have created a couple of such environments and they work fine. It just depends on the difference between the structure required for further processing and the structure that would be optimal for your authors (which in turn depends on the level at which your authors are experienced in working with structured content).
    I hope this helps you solve your problem without having to tweak the structure view.
    Kind regards
    Jang

  • DOM xml white space in xml element

    Hi there
    Can anyone please help me out with a issue I'm having with altering an xml, and then storing it.
    The thing is, that when I delete all elements under a parent to insert something new there's a big gap when looking at the xml. Like this
    orginal xml fil(as an example):
    <batch>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    <somethingtag> <- Im removing these
    </somethingtag>
    </batch>
    with code:
              for(int i = 0; i < antallStartTagger ;i++)
                   //System.out.println("Slettet invoicetag nr: " + i);
                   Element startTag = (Element) nodeEn.item(0);                              // Forrige er slettet, s� neste f�rste hele tiden
                   startTag.getParentNode().removeChild(startTag);               
    don't bother the name. The result is:
    <batch>
    <- still space
    </batch>
    and when I insert a new element, it put itself at the far bottom, like this:
    <batch>
    <newtag>
    </newtag>
    <newtag>
    </newtag>
    </batch>
    And for saving the file STILL with gaps I use the Transformer class:
    File xmlOutputFile = new File(filename......);
         FileOutputStream fos = null;
         Transformer transformer = null;
                   fos = new FileOutputStream(xmlOutputFile);
                   // Use a Transformer for output
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
         transformer = transformerFactory.newTransformer();
              DOMSource source = new DOMSource(documentSkjellett);
              StreamResult result = new StreamResult(fos);
              // transform source into result will do save
         transformer.transform(source, result);
         ediLog.append(" -> [" + ediFil + "] lagret");
              catch (FileNotFoundException e)
              {System.out.println("##FEIL## : FileNotFoundException i lagreXMLFil: " + e.getMessage() + " " + e);}
              catch (TransformerConfigurationException e)
              {System.out.println("##FEIL## : TransformerConfigurationException i lagreXMLFil: " + e.getMessage() + " " + e);}
              catch (TransformerException e)
              {System.out.println("##FEIL## : TransformerException i lagreXMLFil: " + e.getMessage() + " " + e);}
    Can anyone advice?
    Paul

    It's because <batch> has two types of children: elements and text nodes.
    Assuming that the text is just whitespace, and you don't care about any text occurring between nodes, first call document.normalize() to aggregate all that text into one big node, then seek out and destroy it.
    Alternately, if you know that there shouldn't be any text directly under <batch>, simply iterate through its child nodes and remove any that are instanceof Text.

  • XML element "userComments" of variable "UserComments" is not defined error while deploying AccountDistribution composite to soa server

    Hi,
    We did deploying AccountDistribution composite to soa server hosted in our test environment but We could not succeed as the following error was thrown on compilation itself in Jdeveloper.
    <snip>
         Error(124): XML element "{http://xmlns.oracle.com/InvoiceSynchronization/AccountDistribution/AccountDistribution}userComments" of variable "UserComments" is not defined
    <snip>
    We have had 4 variables defined with element attribute in our AccountDistribution bpel
    <variable name="UserComments" element="client:userComments"/>
    and for every variable we are coming up with this error on composite deployment.
    We have tried multiple workarounds like deleting SCA-INF of AccountDistribution that is auto generated by Jdeveloper etc but but no luck, we are still coming up with same error.
    We back traced for the element's definition i.e userComments definition and we could find the definition in xsd stored in MDS as per configuration.
    Please provide your advise on how to proceed further on this issue.
    Thanks,
    Satheesh

    Hi Nicolas,
    adf-config.xml is for all the composites present in the project, but we are getting this error in only 1 composite, our other composites are working fine without any error.
    We tried creating a new variable with type element and getting same error.
    Thanks
    Satheesh

  • How replace XML Elements with java

    I have been usint SAX 2.0 and DOM Level 2 api's to represent XML documents, which i parse with apache's Xerces parser... I am trying to delete certain elements and replace them with others, but none of the api's allow this the closes i have come is replacing attributes of elements....

    -jverd
    You might also want to look into jdom or dom4j.Thanks jdom worked for replaceing the elements and attributes...but when i tried to store the changes in a new file, the text nodes were processed. for e.g. if i had &#8217 the char ( ' ) appeared in the new file. how do i keep the unicode...

  • Out XML element values extract

    hi their
    How can I out XML element the values extract and in a loop in variable and/or in an array store?
    Example:
    [loop]
    <SA>'MS','GYM'</SA>
    Values 'MS' and 'GYM' should be in variables e.g var1='MS' and var2='GYM'
    [end loop]
    Please, help me!!!! Urgent
    thanx you for advice
    kind regards
    Holger

    create or replace procedure spTestXML is
      xml   xmltype;
      test  varchar2(100);
      test2 xmltype;
      cursor lvCur_GetAllSecGrps is
        SELECT extractValue(value(asec), '/SEC_GRP/NAME') as Name
        FROM table(xmlsequence(xml)) a,
             table(xmlsequence(extract(value(a), '/EVENT/SEC_GRP_LIST/SEC_GRP'))) asec;
    begin
      xml := xmltype('<EVENT>
    <SWTSUPDATE TYPE="1">
    <MEMBERID>9822598</MEMBERID>
    <DATETIME>Fri Jun 09 14:51:33 CDT 2006</DATETIME>
    <USERID>W951FVK</USERID>
    </SWTSUPDATE>
    <CONTACT_HISTORY>
    <USER>
    <USER_ID>W951FVK</USER_ID>
    <FIRST_NAME>John</FIRST_NAME>
    <LAST_NAME>Givens</LAST_NAME>
    </USER>
    <USER>
    <USER_ID>W951FNN</USER_ID>
    <FIRST_NAME>Mary</FIRST_NAME>
    <LAST_NAME>McNair</LAST_NAME>
    </USER>
    <CONSUMER>
    <CONS_SEQ_NBR>1387445</CONS_SEQ_NBR>
    <FIRST_NAME>SPRINGHOUSE</FIRST_NAME>
    <LAST_NAME>ELLIS</LAST_NAME>
    </CONSUMER>
    </CONTACT_HISTORY>
    <SEC_GRP_LIST>
    <SEC_GRP><NAME>cspupdatecustpayee</NAME><DESCRIPTION>Add/Update/Delete CSP Customer Payees</DESCRIPTION></SEC_GRP>
    <SEC_GRP><NAME>cspupdatepayment</NAME><DESCRIPTION>Add/Update/Delete CSP Payment</DESCRIPTION></SEC_GRP>
    <SEC_GRP><NAME>adminreports</NAME><DESCRIPTION>Administrate Reports</DESCRIPTION></SEC_GRP>
    <SEC_GRP><NAME>billopscsr</NAME><DESCRIPTION>Bill Operations CSR</DESCRIPTION></SEC_GRP>
    </SEC_GRP_LIST>
    </EVENT>');
      if xml.existsNode('/EVENT/SEC_GRP_LIST/SEC_GRP/NAME') != 0 THEN
        for lvAllSecGrps in lvCur_GetAllSecGrps loop
          dbms_output.put_line('Found: '||lvAllSecGrps.Name);
        end loop;
      end if;
    end spTestXML;gives
    Found: cspupdatecustpayee
    Found: cspupdatepayment
    Found: adminreports
    Found: billopscsrhth

  • How to delete XML Tags in already tagged text?

    Hi everyone,
    I looked in all the topics but with no results.
    Is there anyone that can help me with this script?
    Thanks
    Ivan

    Then you should provide more details on what you want this new script should do.
    To "delete XML tags in already tagged text", all you need is use the "untag" command on an XML Element. But how would the script "know" what XML Element should be untagged?
    Disclaimer: This reply is in no way enforceable, legally binding, a promise or contract, an agreement (written, verbal, or otherwise), a commitment, obligation, or free or paid-for offer of any kind to further help, guide, aid, tip, or not hinder you, or contribute to, correct, investigate, comment on or assist with any existing, forthcoming, or planned project.

  • Search for, edit, and delete XML tag (Adobe InDesign Server CS5)

    Hi all,
    I'm working with Indesign Server CS5 and JavaScript, though having some trouble coming up with a solution to a problem...
    I need to build a JS script (called through SOAP) that will enable me to search an InDesign file for a given XML tag.
    Upon finding the XML tag, if the 'action' variable is set to delete, it should delete the tag and its contents.
    If the action is set to edit, it should change the contents of the tag to some user-specified content.
    The primary caveat is that the XML tag is variable, as is the XML structure of the InDesign file.
    Here's what I have in mind, in pseudocode:
    function findXMLTag(tag, action) {
         app.searchForTag(tag);
         if (tagIsFound) {
              if (action == "delete") {
                   tag.delete;
              } else if (action == "edit") {
                   tag.contents = "Updated content";
    Any help would be greatly appreciated!
    Thanks,
    Ben Kay

    'searchForTag' can be implemented as a recursive function.
    Recursion is defined like this: I thought, "I'll just search this forum for 'recursion'." The first post I found was one of my own, suggesting that the poster should search the forum for 'recursion'.
    Here is an example: find the XML Element [<email>]
    And another: Remove xml element using JS[CS3] (read carefully, as the OP got stuck on how to successfully remove an element and continue)
    And one, using XML Rules -- which I'm totally unfamiliar with, but may work for you: Changing Values in XML tags

  • How to replace XML elements using java

    I have been usint SAX 2.0 and DOM Level 2 api's to represent XML documents, which i parse with apache's Xerces parser... I am trying to delete certain elements and replace them with others, but none of the api's allow this the closes i have come is replacing attributes of elements....

    Answered in crosspost.
    http://forum.java.sun.com/thread.jspa?threadID=638156

  • XMLBeans - how to delete an element?

    Guys,
    How do you delete an element within an xml data element?
    If there's more than one way what are they?
    Currently, I've generated XML java objects. I see a setNil() method and a couple removeXXX methods but neither appear to delete the element I'm trying to give the axe to.
    Thanks!
    -mark

    makk_88 wrote:
    since u want the simple method.....
    just overrite the position of the element that need to be deleted with the next element in the array..
    by doing this, element need to be deleted will not be accessibe..
    i think u got..what i'm saying.
    thnx..Mak,
    Say we wish to delete the second element of an array a[1]. Do you really believe that a[1] = a[2] somehow magically deletes a[1]? I really don't think so Tim.
    Two eggs, minus 1, equals two eggs? Interesting theory, but I think you're probably wrong.
    *@OP:* My advise is just use an ArrayList.
    Cheers. Keith.

  • XML tag markers moved: Find and Replace causing problem in xml elements

    Hi All,
    I am doing find and replace using GREP. While using the expression like $1, $2 (Found Items) in the change to field it changes the placement of tag marker. If the found item is a part of two of more xml elements, I am getting a serious problem while replacing it. (ie. The xml tag markers are moved.)
    See the screen shot below, then you may get better idea. And help me to overcome this issue.
    This is just an example to show you what i'm trying to say, there are so many cases like this.
    Original text/ Before doing find replace
    After replacing
    Green4ever

    Hi Peter and John,
    but it seems to me that the example is looking for any space that
    follows a semi-colon and has two word characters following it, and
    repalce that with an em space. I think you could do the same using look
    behind and look ahead and not need to replace the found text.
    Yes you are right about the look behind and look ahead. I'd like to show some more examples to show what the actual problem is,
    Original/Before Replacing,
    (Consider there is another case here, instead of em-space some times normal word space will also be there)
    Using the Grep:
    Find What---------> ^(\d+\.(?:\d+)?)~m
    Change To------------->$1\t
    After Replace:
    Did I make any sense? Eventhough this will not make any changes in the layout, my requirement is to insert the tab out-side the tag marker not indise.
    Green4ever

Maybe you are looking for

  • Can we import a timestamp column in DIAdem

    I have a 2 channels with time information - one in string format and the other in timestamp format.  It seems that when I try to open my TDM file, DIAdem gets stuck.  I'm sure that its because I can't have string or timestamp information in a TDM fil

  • How to archive Open items

    Hi All, I am using FI_DOUMNT to archive Vendor/Customer Open Items. If i run the Object for open items saying that 1 of the 1 company codes selected still have open periods. How can i archive Open items, Any alternatives. thanks, sriram

  • WLAN with 802.1x

    Hi! Since the sw upgrade to version 7.3.101.0 (wlc 5508) i have the following issue. We have a WLAN with 802.1x (WPA2/AES) secured. Before the update the users need to enter user/ pw every time when they reconnect (WLAN switch off/ on again) to the W

  • Virtual InfoCube - Data Selection Logic

    Hi, I have a query that accesses a Virtual InfoProvider.  Anyone have an example of the code required to access or use the query selections in the InfoProvider Function Module?  The Virtual InfoProvider "How To" doesn't show this... Thanks,

  • Guides and Objects snap back when holding to long

    When placing a new guide or resizing or moving objects these things snap back or disappear when holding the mouse button to long. I. e. when trying to position a guid I only have a few seconds to to, otherwise the guide just disappears. Same behaviou