XML root elements

Hi i am writing a sql select query to create an xml file.
SELECT
XMLELEMENT("data",
XMLATTRIBUTES('http://smile.mit.edu/shelf/' as "wiki-url",
'SIMILE JFK Timeline' as "wiki-section"),
XMLELEMENT("event",
XMLATTRIBUTES(e.IMP_DATE as "start",
e.NAME||': '|| e.ECCTS as "title",
e.IMP_DATE as "end")
from monica_tab2 e;
When this query runs, it appears to show the data tags as elements for every record. I want this to be a root element so that it only appear once for all the events.
Is there any way i can do this? Examples will be appreciated
Thanks
Edited by: Monica B on Nov 10, 2008 7:21 AM

Try using the XMLAGG function...
SELECT
  XMLELEMENT("data",
             XMLATTRIBUTES('http://smile.mit.edu/shelf/' as "wiki-url",
                           'SIMILE JFK Timeline' as "wiki-section"),
             XMLAGG(XMLELEMENT("event",
                               XMLATTRIBUTES(e.IMP_DATE as "start",
                                             e.NAME||': '|| e.ECCTS as "title",
                                             e.IMP_DATE as "end")
from monica_tab2 e;

Similar Messages

  • Indesign CS3 XML Root element?? , Java Script

    Is there any way to tag the root element using javascript?
    The three usual ways without JS would be:
    Rename the tag in the tag pallete.
    Select and Retag the Element in the Structure.
    Or import an xml to replace the structure.
    This is the closest information I could find, thanks to Dave Saunders
    http://jsid.blogspot.com/2006/07/emaciated-anonymous-invisible-parent.html
    ~Mike

    Does this help:
    app.documents[0].xmlElements[0].markupTag.name = "Fred";
    Dave

  • Read XML root element tag in Java

    Is there any way I can read the tag of the root element? Based on the tag, I process the XML differently.
    Thank you.

    I think I figured it out. I can accomplish this by using the getTagName method. Sorry for the lack of detail in my original question.
    For those interested, I have a class that has XML passed to it. Depending on what the root tag name is, different activities needed to take place. I needed a way to read the tag in order to determine what actions needed to be performed.
    Thank you.

  • Add dynamic namespace declaration into xml root element

    Hello all,
    i've have two scenarios (mail to mail and file to file) with the same issue : no namespace in my XML file and i have to create one 'dynamically' from XML values.
    Example :
    <root>
    <name>test</name>
    <email>test</email>
    <schema>schemaID</schema>
    </root>
    Now I want to add infos into the root element for namespace declaration and so on, without expansion of the xsd. I've must use the value from the field schemaID.
    Example:
    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns: namespace="http://test.de/schemaID">
    <name>test</name>
    <email>test</email>
    </root>
    I've already done it before through XSLT but it wasn't dynamic !! I don't know how to do it in XSL and i am not a java expert.
    Someone got an idea ?
    Thanks,
    Jean-Philippe.

    Hi,
      If you want to add name space at mapping level two options
    1)Using XSLT Mapping ,its very easy,google it to get sample XSLT code ,it will solve your problem.
    2)Using java mapping,in java mapping use regular expression code ,using regex(Regulkar expresion)we can add any content in message at any level.
    Regards,
    Raj

  • Add namespace declaration into xml root element

    Hello experts,
    I have the following problem:
    I generate a xml message with the following structure (example):
    How can I realise this requirement?
    Thanks and best regards!
    Christopher Kühn

    Hi Christopher,
    Call the below code as a javamappinf in the operation mapping... So now your operation mapping will have two mappings one to convert source to target XML and second this java mapping which will add namespace to your target xml
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import  com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.DynamicConfigurationKey;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    import com.sap.aii.mapping.api.InputHeader;
    public class JavaMapping extends AbstractTransformation {
         public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException {
         getTrace().addInfo("JAVA Mapping Called");
         //Input payload is obtained by using arg0.getInputPayload().getInputStream()
         String inData = convertStreamToString(arg0.getInputPayload().getInputStream());
         String outData = inData.replaceFirst("<root>", "<root xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespace=\"http://test.de/test.xsd\">");
         try
         //8. The JAVA mapping output payload is returned using the TransformationOutput class
         // arg1.getOutputPayload().getOutputStream()
              arg1.getOutputPayload().getOutputStream().write(outData.getBytes("UTF-8"));
         catch(Exception exception1) { }
         public String convertStreamToString(InputStream in){
         StringBuffer sb = new StringBuffer();
         try
         InputStreamReader isr = new InputStreamReader(in);
         Reader reader =
         new BufferedReader(isr);
         int ch;
         while((ch = in.read()) > -1) {
              sb.append((char)ch);}
              reader.close();
         catch(Exception exception) { }
         return sb.toString();
    check stefans blog on the jar files that you need to make this mapping /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Regards
    Suraj
    Regards
    Suraj

  • Create Root Element in XML

    Hi Experts,
    I am develpoing a program to generate xml file as output. I am using the method CL_IXML and other interfaces to generate the xml data. Here I need to create a root element. I did search in SDN but I couldnot found anything to generate xml root element.
    My output should be like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Request Version="11.1" IssuerID="1">
            <CreatePurchaseRequest
                RequestID="123456"
                Commonname="test"
            </CreatePurchaseRequest>
    </Request>
    Can anybody plz suggest how can I generate the root element Request here?
    Regards,
    Ranganadh.

    Thanks Sandra,
    My issue got resolved.
    I just created the root element using the method create_sample_element and set the attributes using set_attributes method.
    Thanks for your help.
    w_ixml = cl_ixml=>create( ).
          w_document = w_ixml->create_document( ).
          w_root = w_ixml->create_document( ).
          IF w_document IS INITIAL.
            RAISE EXCEPTION TYPE cx_cmx_da_exception
              EXPORTING
                textid = cx_cmx_da_exception=>cx_cmx_da_error_internal.
          ENDIF.
          w_encoding = w_ixml->create_encoding(
                                 character_set = 'utf-8'
                                 byte_order    = if_ixml_encoding=>co_none ).
          w_document->set_encoding( w_encoding ).
          w_element_inv1  = w_document->create_simple_element(
                      name = 'OrbiscomRequest'
                      parent = w_document ).
          w_element_inv1->set_attribute( name = 'Version'
                                         namespace = ''
                                         value = '11.1' ).
          w_element_inv1->set_attribute( name = 'IssuerID'
                                         namespace = ''
                                         value = '1' ).

  • Adding namespace prefix to the XMLa root element

    I am facing a problem in our application. I am assigning an XML content to a XSD variable. While assignment operation is performed the prefix of the XML root element alone is getting replaced with default namespace, though the source XML has the prefix. Please let me know if any patch or workaround is available to address this issue.
    Thanks!

    Hi All,
    we are also facing the same issue, Please provide the solution if anyone knows. We are also using the SOA Suite 11g Version.

  • (Fatal Error) Start of root element expected

    Hi,
    When running the app, I have got
    Error(1,1): <Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
    I think it is due to some libraries missed inside the app. How to resolve this?
    Regards,

    did u check this file?
    C:\dp\jdev11113\Login\ViewController\public_html\mdssys\mdx\Login4.jspx.rdf
    actually these files gets created which we normally ignore.. you can remove this file.. and wrok normally without this error.. make sure that you have Login4.jspx file
    or fix this file an check if there is a xml root element like
    <?xml version="1.0" encoding="UTF-8"?>

  • The markup in the document following the root element must be well-formed.

    I have my XML root element that looks like this:
    <DataResponseOfListOfSite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www
    .w3.org/2001/XMLSchema" xmlns="http://xxxxxx/webservices/sites/">
    and I get the error "The markup in the document following the root element must be well-formed."
    If I use this it works fine:
    <DataResponseOfListOfSite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www
    .w3.org/2001/XMLSchema" xmlns:xsi="http://xxxxxx/webservices/sites/">
    Does anyone know why I have to have the xmlns:xsi="" instead of just xmlns=""
    If I paste this XML into any validator, it says that its good, so I dont know why Flex is complaining about it.

    In the first one you have two namespaces both with the same prefix.
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and xmlns:xsi="http://xxxxxx/webservices/sites/"
    Thanks,
    Gaurav Jain
    Flex SDK Team
    http://www.gauravj.com/blog

  • Getting oracle.xml.parser.v2.XMLParseException: Start Of root Element

    Hi All,
    I am getting below error while creating STUB/Skeleton in Jdeveloper to call a web service from OAF Page But getting below error while trying to creating Stub/Skeleton to call weservice
    ERROR:
    oracle.xml.parser.v2.XMLParseException: Start Of root Element
    Any suggestion on This
    P.S: I am calling a third party web service so can not able to make changes in XML
    Regards,
    903096

    Possibility is that there is a problem in the XML that is being passed. Can you double check with the third party software? Also check if you can try it outside OA Framework first and then if its tested you can integrate with EBS.

  • Oracle.xml.parser.v2.XMLParseException: Start of root element expected

    Hi,
    while trying to get a soapelement from xml file, i have the error : oracle.xml.parser.v2.XMLParseException: Start of root element expected
    the code i m using is as follow :
    public static SOAPMessage XMLDocToSOAP(String soapBodyAsString ) throws SAXException, IOException,
    SOAPException,
    ParserConfigurationException {
    SOAPMessage message = null;
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    InputStream is = new ByteArrayInputStream(soapBodyAsString.getBytes());
    Document doc = dbf.newDocumentBuilder().parse(is);
    MessageFactory factory = MessageFactory.newInstance();
    message = factory.createMessage();
    message.saveChanges();
    SOAPBodyElement element = message.getSOAPBody().addDocument(doc);
    return message;
    }

    Looks like the XML you are passing is not valid. Check that the XML complies the the definition.
    Also can you post a XML that works and the one that fails.
    cheers
    James

  • Org.xml.sax.SAXParseException: Document root element "taglib", must match D

    hi
    using tomcat 4
    and jdf1.5
    i am getting bellow error
    org.xml.sax.SAXParseException: Document root element "taglib", must match DOCTYPE root "null".

    Check your web.xml once again.

  • Org.xml.sax.SAXParseException: Document root element is missing.

    Hi,
    I am trying to get the portal login id from a weblogic server based application from iplaet portal server.
    I get this follwoing error
    org.xml.sax.SAXParseException: Document root element is missing.
    at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
    at com.sun.xml.parser.Parser.fatal(Parser.java:2805)
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:493)
    at com.sun.xml.parser.Parser.parse(Parser.java:284)
    at com.sun.xml.tree.XmlDocument.createXmlDocument(XmlDocument.java:226)
    at com.iplanet.portalserver.util.XMLParser.<init>(XMLParser.java:70)
    at com.iplanet.portalserver.naming.share.NamingResponseParser.<init>(NamingResponseParser.java:33)
    at com.iplanet.portalserver.naming.share.NamingResponse.parseXML(NamingResponse.java:74)
    at com.iplanet.portalserver.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:174)
    at com.iplanet.portalserver.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:155)
    at com.iplanet.portalserver.naming.WebtopNaming.getServiceURL(WebtopNaming.java:57)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:534)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:520)
    at com.iplanet.portalserver.session.Session.getSession(Session.java:414)
    at jsp_servlet.__eatonPortalLogin._jspService(__eatonPortalLogin.java:155)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    <May 19, 2004 9:01:12 AM EDT> <Error> <HTTP> <101017> <[ServletContext(id=4873279,name=ematrix,context-path=/ematrix)] Root cause of ServletException
    com.iplanet.portalserver.session.SessionException
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:539)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:520)
    at com.iplanet.portalserver.session.Session.getSession(Session.java:414)
    at jsp_servlet.__eatonPortalLogin._jspService(__eatonPortalLogin.java:155)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    Any help/pointers will be appreciated.
    Ashish

    Just for anyone else who hits this problem: I encountered the same issue with an XML document that XMLSpy claims is quite well formed. I opened the document in a hex editor, and there at the from was a three-byte byte order marker - the marker that I believe the UTF-8 standard says is optional. I removed these three bytes, and the file was parsed correctly.
    In this case, the XML file was created using a Microsft DOM (save).
    My solution is to make the java parser - as I use it - a tad more robust: Open the file and create an input stream - a pushback input stream. Read the first three bytes; if they are NOT a BOM, then push those bytes back. Now - in any case - give the stream to the parser to read.
    try {
    // Open file for reading.
    f = new File(path);
    FileInputStream fis = new FileInputStream(f);
    PushbackInputStream pis = new PushbackInputStream(fis);
    byte[] buf = new byte[3];
    pis.read(buf, 0, 3);
    if (! (buf[0] == 0x00EF) && (buf[1] == 0x00BB) && (buf[2] == 0x00BF) ) {
         pis.unread(buf, 0, 3);
    builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    doc = builder.parse(pis);
    catch (Exception x) {
         x.printStackTrace();
    }

  • No root element found in xml

    I am facing a problem when i am trying to use TOAD. Its giving me an error like
    NO ROOT ELEMENT FOUND IN XML. Can someone help me in corrcting this Error ?
    Regards,
    Chandra deep

    NO ROOT ELEMENT FOUND IN XML. Can someone help me in
    corrcting this Error ? That means the XML document is either missing the surrounding <element> ... </element> pair or has more than one pair at the base level of the document. Resolve that and you are done.
    Now ... given that I am probably 4,000+ km away from you and can not see your screen, please look at your question and ask yourself whether you have given sufficient information for troubleshooting. <g>

  • XML "Document root element is missing"

    i have made a research in the forums but i have no definite solution about the error.
    my flash client sends XML stream to my ServerSocket. and i want to parse these XML datas.
    Document XMLDoc;
    DocumentBuilderFactory Factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder Builder = Factory.newDocumentBuilder() ;
    InputSource Is = new InputSource(new BufferedReader(new InputStreamReader(Sock.getInputStream(),"UTF-16LE")));
    XMLDoc = Builder.parse(Is);
    But now i have problem called "Document root element is missing". My XML stream comming from flash client :
    // Actionscript code :
         XDoc = new XML("<?XML version=\"1\"?><LOGIN><USERNAME>KHARON</USERNAME><PASSWORD>485009</PASSWORD></LOGIN>");
    ----- The XML data i want to sent to ...
    <?XML version="1"?>
    <LOGIN>
    <USERNAME>KHARON</USERNAME>
    <PASSWORD>485009</PASSWORD>
    </LOGIN>
    What is the problem ?

    now ?
    // Actionscript
    XSock = new XMLSocket();
    XSock.connect("127.0.0.1",6667);
    XDoc = new XML("<?xml version=\"1.0\"?><LOGIN><USERNAME>KHARON</USERNAME><PASSWORD>ew2345dfs</PASSWORD></LOGIN>");
    // Java
    public void run() {
    try {
    Document XMLDoc;
    DocumentBuilderFactory Factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder Builder = Factory.newDocumentBuilder() ;
    InputSource Is = new InputSource(new BufferedReader(new InputStreamReader(Sock.getInputStream(),"UTF-16LE")));
    XMLDoc = Builder.parse(Is);
    org.w3c.dom.Node Node = XMLDoc.getFirstChild();
    System.out.print(Node.getNodeValue());
    /* Incomming data test code
    System.out.print("Listening to incomming messeges");
    char in ;
    while ( (in = (char)Reader.read()) != -1 ) {
    System.out.print( in );
    but the result
    parser exception ( Document root element is missing )
    ihave made a research ( i am newbee in XML) and i have made some declerations like <!DOCTYPE LOGIN <!Element ...
    i have declared root element with DOC type decleration. but the same error. :|
    since 2 days i am working over these, but solution = null

Maybe you are looking for

  • How to use BAPI_BILLINGDOC_CREATEMULTIPLE ?

    Hi, Does anyone have an example of how to use BAPI BAPI_BILLINGDOC_CREATEMULTIPLE? I am trying to create a billing document with reference to a delivery (I am hoping that this BAPI will take into account the copy control config so I won't have to do

  • Video not fitting into preview window

    Hello, I have been running into a problem that I have not had untill I restored my computer a few months back. To start off I know my video files are in 720p and I have the sequence setting set accordingly. When I place the video files into the "Sour

  • Sun One 6.0 SP3 with JDK1.3.1_08 on Solaris crashing.

    Hi, We are using Sun One 6.0 SP3 with JDK 1.3.1_08 on Solaris 2.8. We are seeing these error messages in the log file. [11/Sep/2003:17:41:16] catastrophe ( 436): Server crash detected (signal SIGSEGV) [11/Sep/2003:17:41:16] info ( 436): Crash occurre

  • Win7 wmp dups and itunes ??

    Hi..I didnt think I was an idiot but I do now, I cant seem to seperate itunes from win media player in win 7 on my new laptop. I dont want all those dup's in win media player like that. I tried to move itunes file but its just not working for me I gu

  • My itunes store will not open.  : (  It has not worked for months.  I have tried everything!

    My itunes store will not open.  It is a blank, white screen when I click on it.  It has not worked for months.  I have installed all software updates more than once during this time and there is still no change.  I am using Mac OSX version 10.6.8 and