Through DOM how to frame namespace of any element

Hi
I am using javamapping and tried to create target document by using Document class method "createElementNS". However, I failed to create the same. Can any one assist me in creation of Namespace for a xml. it's gr8 in case u provide any reference/link .
Thanks

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document soapDoc = db.newDocument();
            Element soapEnv = soapDoc.createElementNS("http://www.w3.org/2001/12/soap-envelope","Envelope");
            Element soapHeader = soapDoc.createElementNS("http://www.w3.org/2001/12/soap-envelope","Header");
            soapEnv.appendChild(soapHeader);
            Element soapBody = soapDoc.createElementNS("http://www.w3.org/2001/12/soap-envelope","Body");
            soapEnv.appendChild(soapBody);
            Element hotelBookingResponse = soapDoc.createElementNS(
                                 "http://www.MyHotel.com/partnerservice/",
                                 "GetSpecialDiscountedBookingForPartnersResponse");
            hotelBookingResponse.appendChild(
                soapDoc.createElementNS(
                    "http://www.MyHotel.com/partnerservice/",
                    "BookingDetails"));
            soapBody.appendChild(hotelBookingResponse);
            soapDoc.appendChild(soapEnv);
http://webservices.xml.com/2003/11/25/examples/Listing1.html

Similar Messages

  • How can I to control any element of my GUI from another class?

    How can I to control any element of my GUI from another class?

    For that, you need the external class to have the reference to your element.. If your idea is to change basic properties like width, height etc.. then you can have the constructor of the external class to take the object of the parent of your class as the parameter and modify ..
    However, if the properties to be altered/accessed are custom to your element, then you will have to have the class accept an object of your class as the parameter. No other option..
    What exactly is your requirement?

  • How to remove namespace from root-element

    Hi Gurus,
    I want one xml output from xslt transformation with no namespace. I managed to remove namespace from child elements by leveraging elementFormDefault ='unqualified' property of xsd. But not able remove namespace from root-element.
    Output that I want is :
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <inp1:Email_Mod_Root>
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
              <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    Output that I am getting:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <inp1:Email_Mod_Root xmlns:inp1="http://www.example.org">
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
             <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    Anyone, pls suggest.
    Thanks in advance,
    SG_SOA

    First of all :
    <inp1:Email_Mod_Root>
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
              <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    isn't valid xml (you start with inp1: prefix and you end the tag with no prefix, but let's assume you don't want any prefix/namespace at all)
    if i use :
    [code]
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:inp1="http://www.example.org" exclude-result-prefixes="inp1">
      <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="*">
        <xsl:element name="{local-name(.)}">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:element>
      </xsl:template>
      <xsl:template match="@*">
        <xsl:attribute name="{local-name(.)}">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:template>
    </xsl:stylesheet>
    [/code]
    i get this
    [code]
    <Email_Root_Element>
      <Email_Record>
      <EMPLID>EMPLID46</EMPLID>
      <EMAIL>EMAIL48</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE49</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
      <Email_Record>
      <EMPLID>EMPLID47</EMPLID>
      <EMAIL>EMAIL49</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE50</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
      <Email_Record>
      <EMPLID>EMPLID48</EMPLID>
      <EMAIL>EMAIL49</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE51</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
    </Email_Root_Element>
    [/code]

  • How to Add namespace to all elements in a xml document

    Hi,
    I am trying to read an xml file that does not have any namespace definitions. I have been able to create another schema in which i specify the namespace defination as shown below.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://TargetNamespace.com/AckPaymentFile_PL" targetNamespace="http://TargetNamespace.com/AckPaymentFile_PL" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" nxsd:version="DTD" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <include schemaLocation="PM_XML_FILE_ACK_SCHEMA_NO_NAMESPACE.xsd"/>
    </xs:schema>
    Once i do it, i am able to see the namespace has been assigned to the root element. I am looking for a way to assign the namespace and prefix tag to all elements in the xml document. If i don't i am unable to access any part of the xml document, keep getting please verify if xpath is correct.
    Thanks
    Sridhar

    Hello,
    Once you've answered all the above.
    If you can run xpath that supports functions against the xml, the expression:
    count(//phone)Otherwise, without leaving SQL:
    select count(*) from
    xmltable('//phone' passing
      -- Your XML goes here, could be a table column with type XMLTYPE.
      xmltype('<person><phone>123-456-7890</phone><phone>098-765-4321</phone></person>')
      columns phone varchar2(24 char) path '/phone'
    ;

  • I cant upload any apps it is telling me to activate the apple ID through itunes how do i do that

    i cant upload any apps it is telling me to activate the apple ID through itunes how do i do that

    In the menu bar, click on File. Almost at the bottom of the dropdown list will be the Work Offline option. If it has a tick next to it, then FF is working in offline mode. Just click on it once & all will be sorted.

  • How to upload and download any file from plsql through weblogic server

    hi all,
    how to upload and download any file from plsql through weblogic server? i am using oracle 10g express edition and jboss.
    Thanks and Regards,
    MSORA

    hi bala ,
    for a windown server u can use VNC (virtual network connection) which opens a session on u r desktop later u can drag and drop form there vice versa and for a linux box you can use Win SCP which helps to open a session with interface to u r desktop in both cases you can upload and down load files very easiy just as we drag and drop items in a simple pc .. we use the same technique...
    bye
    vamshi

  • I have a Mac computer and am trying to use a Photoshop CS4 program, but after accessing my desktop files through Adobe Bridge and clicking twice on any of the pictures to get into Photoshop,  instead of entering photoshop I get an enlarged version of the

    I have a Mac computer and am trying to use a Photoshop CS4 program, but after accessing my desktop files through Adobe Bridge and clicking twice on any of the pictures to get into Photoshop, instead of entering photoshop, I get on the lefthand side an enlarged version of the picture with red, yellow and green buttons on top. Any suggestions on what is wrong, or what can be corrected ?

    And there is the problem. Your pictures are opening up in Mac's own Preview app.
    Do you want all your jpegs to open in Photoshop, or only when you are in Bridge?
    Selecting a program to open a certain file is called: File Type Association.
    You can choose this at the MacOS level or the Bridge level.
    Here's how to do both:
    Either MacOS or Bridge has the wrong app associated with the jpeg. Let's start with MacOS
    Close Bridge and Preview. Select one of your jpegs, and press Cmd i, That will bring up the file info window.
    Go down to the "Open with" section of File Info.
    Choose Photoshop CS4 and click on the Change All... button to apply this choice to every jpeg on your Mac.
    Then open Bridge and see if double-clicking opens it in Photoshop.
    Now that means all jpegs on your Mac will open in Photoshop.  Maybe you don't want that.
    You can set your jpegs to open in Preview when Bridge is closed.
    When you open Bridge, there is Preferences > File Type Associations where you can direct Bridge to open the jpegs in Photoshop when you are viewing in Bridge.

  • Trying to Publish my new site. Already own domain through goDaddy. how do I do this? Go Daddy told me to call Adobe.

    I have built a site through Muse,
    I own a domain with Godaddy, and my current site is through their web builder.
    I would now like to publish my new 'muse' site with my existing domain, but can't find the info on how to do so.
    Any help?
    Thanks,
    Hannah

    Typical GoDaddy support ....
    Where are you trying to publish it to? Back on your GoDaddy hosting or with Adobe Business Catalyst?

  • How to get total of any field in sapscript?

    Hello ,
    i m making sapscript...
    How to get total of any field in sapscript?

    Hi
    Yes, you can define a variabe in your print program and pass it to the SAPScript.
    LIKE:
    Define L_SUM in the Global data.
    DATA: L_SUM TYPE BSEG-DMBTR.
    LOOP AT ITAB.
    L_SUM = L_SUM + ITAB-AMOUNT.
    ENDLOOP.
    CALL FUNCTION 'WRITE_FORM'
    WINDOW = 'MAIN'
    ELEMENT = 'TOTAL'.
    Now, in your SAPScript, create a text element in MAIN window
    /E TOTAL
    Total,, &L_SUM&.
    Go through below link
    http://sap-img.com/sapscripts/sapscript-how-to-calculate-totals-and-subtotals.htm
    Regards,
    Chandru

  • How modify SOAP Namespace on ABAP WS

    Hi Experts,
    I need to modify namespace on the web service, I have to provide this WS from an ABAP AS 7.0 SP10 (we don't have XI or PI infrastructure) and the request generated from SAP WSDL is like this:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
    <soap:Body>
    <urn:GetExAvailability>
    </urn:GetExAvailability>
    is it possible to change the namespace urn="urn:sap-com:document:sap:soap:functions:mc-style" with customer namespace and cancel the prefix "urn" before the WS name "GetExAv..."?
    From Service Definition in the transaction SE80 the SOAP NameSpace is read only, but the customer that have to call this WS, can olnly post a request(they say that can't modify their standards) like this:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <GetExAvailability xmlns="http://www.customercompany.de/">
    </GetExAvailability>
    Any help would be greatly appreciated.
    Thanks!
    Regards,
    Max.

    Hi Max,
    we are facing a similar problem and would like to change a namespace from "urn:sap-com:document:sap:soap:functions:mc-style" to "urn:sap-com:document:sap:rfc:functions"
    Did you find a solution to the problem?
    I found the explanations on how the the different namespaces work, but there is no documentation on where this namespace is configured or how to change it.
    Any help would be greatly appreciated.
    Thanks,
    Fabian

  • Hey, I just downloaded an album from iTunes Store. Four of the tracks stop halfway through. How can I redownload them?

    Hey, I just downloaded an album from iTunes Store. Four of the tracks stop halfway through. How can I redownload them? Any help would be appreciated

    Delete the current copies and then download again (free) from your purchased history. If the problem persists contact iTunes Store support staff through the report a problem links in your account history.
    tt2

  • How to attach sound to any button?which will continue that sound.

    Hi,
    Am working on Flash cs5.Can anyone tell me how to attach sound to any button?which will play after click on button.this sound should play continue till 2-3 scenes ahead.Am working on project which has 3 button with diffrent sound.and the sound button contains some scene which has volume seter.I mean,if user want to hear that sound in slow,medium or high pitch.the code should set as per this.Its in as 2.
    This site is like "karaoke".just the sound is classical music.It will continue on software and user will sing a song.
    Can anyone help me?At working on this from last 2 months.and its hard for me to get perfect answer.

    Add your sound clip to the library and give it a Linkage ID of "mySoundClip"
    Assume your button is in frame 1.
    GIve your button the instance name of "mySoundBtn". And put this code on frame 1 (timeline).
    stop();
    mySoundBtn.onRelease = function () {
              mySoundC = new Sound(this);
              mySoundC.attachSound("mySoundClip");
              mySoundC.start(0, 10);  //10 represents the number of loops
              gotoAndPlay(2);
    than put this code on the timeline frame where you need the sounsd to stop.
    stopAllSounds();
    Also If you want to be able to play the sound from your local disk without attaching it to the swf, use .loadSound("the url", true);

  • I want to step through a .mov file frame-by-frame looking at geometry of an aircraft in the video to establish the rotational speed of the propeller.  This should be fairly straightforwaHow to find the frame exposure time of a variable frame rate mov file

    I want to step through a .mov file frame-by-frame looking at geometry of an aircraft in the video to establish the rotational speed of the propeller.  This should be fairly straightforward by looking at how much the propeller moves between each frame and using the exposure time of each frame.
    However the .mov file is from an iPhone 4S and looking at the details, has a variable frame rate.  What I need to know is the duration that each frame is displayed for in order to do my analysis.  Does anyone know how to find out this information?

    I want to step through a .mov file frame-by-frame looking at geometry of an aircraft in the video to establish the rotational speed of the propeller.  This should be fairly straightforward by looking at how much the propeller moves between each frame and using the exposure time of each frame.
    However the .mov file is from an iPhone 4S and looking at the details, has a variable frame rate.  What I need to know is the duration that each frame is displayed for in order to do my analysis.  Does anyone know how to find out this information?

  • Been trying to make a purchase on an App.  It says Opps transaction cannot go through.  On the Apps end it shows the purchase was created but never went through. How do I fix it so I can make the purchase

    Been trying to make a purchase and the App says Opps, transaction error.  On the Apps end it shows the transaction was created but didn't go through.  How can I get the transaction to go through

    just call them...i bought my PB when it came out...but I had an issue recently and called them up and they helped me out....
    Sorry can't help you with any of the other problems...mine are working fine...

  • MY ID DOM'T WORK WITHOUT CREDIT CARD ANY SOLUTION'S ?

    MY ID DOM'T WORK WITHOUT CREDIT CARD ANY SOLUTION'S ?
    MY EMAIL ID AND PASSWORD IS CORRECT BUT NOT WORIKING IN ITUNES EVERY TIME ASKING FOR CREADITE CARED AND I HAVE NO CREADIT CARD....

    Unfortunitely, there is no way to fix this without a credit card. If you are willing to create a new account, here are the instructions on how to make one without a credit card. Hope this helps.
    http://support.apple.com/kb/ht2534

Maybe you are looking for