How to add attributes in the xml tag

hi,
i have two tables employee,department
employee table
empno number,
empname varchar2(100),
deptno number,
department table
deptno number,
deptname varchar2(100)
i want xml file in the above mentioned two tables.The xml file is as follows,
<?xml version="1.0" encoding="UTF-8" ?>
<EmployeeInfo>
<Data type="employee">
<empno>1</empno>
<empname>siva</empname>
<deptno>10</deptno>
</data>
<Data type="department">
<deptno>10</empno>
<deptname>IT</empname>
</data>
</EmployeeInfo>
can anybody please give plsql code for this requirement.i need to add attributes in the xml tag.Its urgent
By
Siva

A general example (based on the OE sample data/tables)
SQL>SELECT XMLElement("Emp",
  2                     XMLAttributes(employee_id AS "id"
  3                                  , '10' "dept"),
  4                     first_name||' '||last_name) as result
  5 FROM   employees e
  6 WHERE  department_id = 10;
RESULT
<Emp id="200" dept="10">Jennifer Whalen</Emp>

Similar Messages

  • How to add attribute to the elements in XML file in BPEL transformation

    Hi All-
    I have to create a XML file using transformation and file adapater and the parent element is USERRECORDS, now when I am creating the XML file using transformation the XML get creates like
    <?xml version="1.0">
    <USERRECORDS>
    so on
    But I want the parent element and the xml version tags as:
    <?xml version="1.0" encoding="UTF-8"?>
    <USERRECORDS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd">
    as I need to add the attributes.
    Is it possible in transformation?
    Any idea, please suggest.
    Thanks and Regards,
    Sreejit

    I have never come across any functionality like that.
    However I assigned values to attributes in Assign Acitivity using XML Fragment on source side.

  • How to add attribute to already existing tag?

    Hello!
    Could you help me, please. I need to add attribute maxlegth to <h:inputTextarea>, but I don't know how to do it. Maybe, you know?

    <textarea> don't support maxlength by spec. You can use JavaScript instead.
    Or if you really want to create a custom component with this attribute added, check following tuts:
    http://www.jsftutorials.net/components/index.html
    http://www-128.ibm.com/developerworks/java/library/j-jsf4/
    http://java.sun.com/javaee/javaserverfaces/customcomponents.html

  • How to get the attribute of the xml tag

    I have the following xml file
    Example.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <html><set label="09/07/29" value="1241.90"/>
    </html>
    Can any one help me in parsing this xml file
    I want to retrive the attribute values of the tag set
    Example I want to store 09/07/29 to variable1 and 1241.90 to variable2 in order to insert this data into a database table.
    Appreciate if any one can help me..very urgent

    Dup post.
    Answers provided at {message:id=3658564} and {message:id=3658522}

  • How to get attributes of the XML header?

    Hallo!
    Does anybody know peraps, what is the Xpath expression to receive header attribute from XML file? I mean p.e. there is "<?xml version="1.0" encoding="ISO-8859-1"?> (...)
    and so on, I need to get           version = "1.0"             
    they are so called pseudo attributes and expressions like //@version do not work I would be thankful for any ideas!
    K.
    Solved!
    Go to Solution.

    I don't think XPath can do it. However you can simply use a file io to read it.
    TailOfGon
    Certified LabVIEW Architect 2013

  • How to remove the standalone="yes" attribute in the xml declaration?

    Hi,
    I am using JAXB 2.0 to generate XML files. Can anyone tell me how to remove the standalone="yes" attribute in the xml declaration? Thanks in advance.
    -Joey

    Just open the file with your favorite text program and type away. If you get a permissions problem (file is locked by...) then just stop tomcat and open/edit/save the file and restart tomcat.
    I also think that the admin context that comes with tomcat might allow you to modify/add/edit your users (not sure though)

  • How to get the XML TAG name itself instead of TAG value

    Hi All,
    I have a question here
    I want to retrieve the XML tag from a XML file instead of its value.
    Example:
    <item>Colgate</item>
    Now I want to retrieve "item" as output from XPath expression, I dont want its value as "colgate"
    How to do that...?
    Thanks
    -Praveen

    You can do this with an axes XPatch expression:
    child::node()/name()
    For more info see: http://www.w3schools.com/xpath/xpath_axes.asp
    HTH,
    Bas

  • How to Find the XML Tag in indesign

    HI!!<br /><br />We are working with XML work flow in indesign. In indesign how could we find the XML Tag in indesign.<br /><br />Example::<br />In the Below list we could have to find the xml tag <chapter> in story editor or in the main text frame in indesign using find option. Kindely sent if any Plugins is available.<br /><br />For exmaple:<br />************<br /><book><br /> <part><br /> <chapter><br />  <head><br />   <para><br />    <bold><br /><br />Thanks,<br />C.K.Venkatesan

    I imported the xml file in vb.net. now i want to find the number of pages and no. of elements. i found out it. but i was not able to find which elements are placed in which page. i want that information. plz kindly help. i am using vb.net. for eg. <ce:figure> placed in which page no., <ce:sections> placed in which page no., etc..,

  • How to get the value in the XML tag?

    hi all,
    i am new to JAXP. i tried the sample program provided in the following link. it just counts the number of tags in the XML file. XML file name is given as command line argument.
    Now, if i want to display the value in the XML tag( say <NAME>xxx</NAME> in this tag i want to display the value 'xxx' ), what has to be done?
    how can i achieve this?
    please help...
    link of the sample program:
    http://xml.apache.org/~edwingo/jaxp-ri-1.2.0-fcs/samples/SAXLocalNameCount/SAXLocalNameCount.java
    thx in advance,
    -Soni.

    implement this method the same way you have startElement...
    public void characters(char[] ch,
                           int start,
                           int length)
                    throws SAXException

  • How to form a regular expression for matching the xml tag?

    hi i wanted to find the and match the xml tag for that i required to write the regex.
    for exmple i have a string[] str={"<data>abc</data>"};
    i want this string has to be splitted like this <data>, abc and </data>. so that i can read the splitted string value.
    the above is for a small excercise but the tagname and value can be of combination of chars/digits/spl symbols like wise.
    so please help me to write the regular expression for the above requirement

    your suggestion is most appreciable if u can give the startup like how to do this. which parser is to be used and stuff like that

  • [CS3 JS] How to associate text with an XML tag

    Hello,
    I have a script that allows one to create or modify an XML tag after one selects text, a text frame or an existing XML tag. It works fine for making the XML tag but it does not associate the text or text frame to the tag. To do that I have to right click on the selection and use the context menu to Tag Text or Tag Frame.
    I want to make this automatic but cannot see how to script it.
    Thanks for any help

    I figured out the problem (which of course creates other interesting problems).
    In the line:
    var elementRef = rootElement.xmlElements.add (tagRef);
    I forgot to add a reference to the xmlContent. It should read:
    var elementRef = rootElement.xmlElements.add (tagRef, whatToTag);
    However, this script is designed to create a dialog box where one can either create a tag along with attributes or edit an existing one. I'll post it when I am done, but there is one hangup. The script not only changes the name of a selected xml tag but all tags with the same name. How can I get it to change only the selected tag? Below is the boiled down script that duplicates that problem.
    Thanks,
    Tom
    var myDoc = app.activeDocument;
    var selObj = app.selection[0];
    var TagIWantToChange = selObj.markupTag;
    var newTagName = "PleaseWork"; //This line replaces all the coding to create a dialog box where the tag name could be edited.
    TagIWantToChange.name = newTagName;

  • Add "ns1:" to an xml tag in a PLSQL

    Hi Friends,
    in the below xml
    i use DomNode approach to create the core XML
    and use the below query
    SELECT XMLSERIALIZE ( DOCUMENT xmlroot  
                                  (XMLELEMENT ( 
                                   "ns1:DeriveCoverageRequest", 
                                   xmlattributes ( 
                                      'urn:xyz:ccw:config:common:data' AS "xmlns", 
                                      'urn:xyz:ccw:config:msa:data' AS "xmlns:ns1"), 
                                   l_xmltype)  
                                   ,version '1.0" encoding="UTF-8' ,STANDALONE YES 
                                   AS CLOB) 
                                   into l_value
    and the XML look like
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns1:DeriveCoverageRequest xmlns="urn:xyz:ccw:config:common:data" xmlns:ns1="urn:xyz:ccw:config:msa:data">
      <majorLine> --
        <lineId>47285</lineId>
        <itemName>xyz15454</itemName>
        <quantity>5</quantity>
        <minorLine>
          <lineId>47293</lineId>
          <itemName>15454-CC-FTA</itemName>
          <quantity>5</quantity>
          <itemPath>xyz15454:15454-</itemPath>  
        </minorLine>
      </majorLine>
    </ns1:DeriveCoverageRequest>
    from dual;
    now i need to add ns1: with the majorLine tag so it should be like
    <ns1:majorLine>
    </ns1:majorLine>
    Code for creating this majorLine is
      l_major_line_node :=
          DBMS_XMLDOM.
           appendChild (
             l_root_node,
             DBMS_XMLDOM.
              makeNode (DBMS_XMLDOM.createElement (l_domdoc, 'majorLine')));
    and i modified like
      l_major_line_node :=
          DBMS_XMLDOM.
           appendChild (
             l_root_node,
             DBMS_XMLDOM.
              makeNode (DBMS_XMLDOM.createElement (l_domdoc, 'ns1:majorLine')));
    but it did not work. could you please suggest some idea on this

    Hi Odie,
    Actually 95% we are good , but one issue
    In the out put XML am getting  like
    <ns1:majorLine xmlns:ns1="urn:xyz:ccw:config:msa:data">
    but the required is
    <ns1:majorLine> only ,
    how to remove the extra info ? I tried like commenting the 
    dbms_xmldom.setattribute(l_major_line_elem, 'xmlns:ns1', 'urn:xyz:ccw:config:msa:data');
    but got some error and tried like putting empty quotes in the place of third parameter
    and
    one more final thing is
    i need to add line id as
    <ns1:majorLine lineID = "1234">
    You helped almost everything, am very grateful to you . Only one more Please..

  • How to apply paragraph styles to xml tag?

    Hi All,
    How to apply paragraph style to xml tag?

    Hi Learner,
    Try the below js code.
    var myDoc = app.activeDocument;
    try{
        mySel=app.selection[0];
        myDoc.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySel});
        }catch(e){
            alert(e);
    var myDocument = app.activeDocument;
    app.findGrepPreferences.appliedParagraphStyle = "test";
    app.findGrepPreferences.findWhat = ".+(?=\\r)"
    var mySearch = myDocument.findGrep(false);
    for (a=0; a<mySearch.length; a++){
        myDocument.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySearch[a]});
    thx,
    csm_phil

  • How to add attribute to Item ?

    Hi,
    I have a problem concerning OCS -> Content Service. I try to find out how scaleable the tool is. Do you know is it possible to add attribute to the Item? For example how to add some link to Document in repository?
    Best regards

    Content Services support adding attributes (we
    support Categories which are named collections of
    attributes) to documents.
    We also have support for document and folder links.so, there is no problem with adding an attribute to a document? Attribute could consist of a collection of links to any Document (Document, Folder etc.)?
    Regards

  • RE: how to add attributes in graphical modulator in segment builder .

    Hi Gurus,
    can you please help me how to add attributes in graphical modulator in segment builder in sap CRM 7.0 WEB-UI.
    thanks and regards
    satyanarayana
    Edited by: koradasatya on Oct 27, 2011 8:14 PM

    Hi Gurus,
    thanks for your reply my requirement from client is given below if you could answer this it will be a great help for me.
    WKSC needs to be able to make selections (in segment builder) with the possibilities to use stored data on organizations. The information we are missing in Segment builder (SB) (and Account search for industrycode) are Industrycode (we want to see values not codes) and responsible salesrep (values not codes).
    These variables together with regions and other marketing attributes is crucial for us. Without it we cannot use the functionality built.
    We also need it so that we can extract smaller parts of our customers and prospects and update them with information from the thirdparty or adding new persons to them.
    Everyone using the SB should be able to use the fields for selections. i.e. Marketers, marketing managers and power users.
    Example
    We would like to make selections that could look like this.
    Region: A and B
    Organization in Industrycode C
    Sales rep: D, E, and F
    Turnover: above 50000
    CP on selected orgs
    CP has title G or H
    CP has Email not blank
    thanks and regards
    satya

Maybe you are looking for

  • Not able to download all of my music onto my ipod 5 after 8.2 update

    After updating my 5th gen ipod touch to 8.2 software I am not able to download all of my music from my itunes library. I have updated the software twice now and have restored and gone back to factory settings and have started over from scratch. Befor

  • PALM V / WINDOWS XP HOME HOTSYNC PROBLEM

    Out of the blue, my Palm stopped hotsyncing with my G3 Mac  (see http://forums.palm.com/t5/Macintosh-HotSync/PALM-V-MAC-OS9-2-2-HOTSYNC-PROBLEM/td-p/273892;jsessioni...) so I am trying to move everything over to my Windows XP Home machine. I download

  • Directory structure behaves strangely

    Hi all, I have a volume holding files both for my Macs (using AFP) and for my linux systems (using NFS and mount on the linux machines). For a reason I cannot explain some files do not show when I ls a directory, but if explicitly ls the file it give

  • Multicam project: rendering timeline disabled multicams in viewer

    i am working on a multicam project and recently rendered my timeline, ever since i did that, i have been unable to view the multicams in the viewer while playing back in the timeline. if i go to a spot in the timeline and pause, i can see all cameras

  • DC offset problems in NI-5401 function generator card

    When i give a Dc offset of 1 Volt the output of my function generator reads 1.97v. what is the reason behind this,why is it so what setting have to be made so as to get the dc ofset only when no ac signal is given.