DOM XML creation

Hi Experts,
I want to create a XML file representing the orgainzation structure tree in HR by Creating a DOM tree using the standard classes and methods. I am refereing to the following link
http://help.sap.com/saphelp_nw04/Helpdata/EN/86/8280db12d511d5991b00508b6b8b11/frameset.htm
CAn any one share abap code or example related to this?
Thanks and Regards,
SHilpa Dhawan

Is there any chance that you have came across with [this document|http://help.sap.com/saphelp_nw04/Helpdata/EN/86/8280d212d511d5991b00508b6b8b11/content.htm]?
Cheers

Similar Messages

  • Does PHP 5.1.2 that comes shipped with OAS 10.1.3.4.0 support DOM/XML?

    Hello,
    We have installed OAS 10.1.3.0. PatchSet 10.1.3.4.0. It comes with PHP4 by default and the Oracle HTTP Server. We did the necessary instructions from Metalink and the README on how to enable PHP5. We can bring up Apache with no issues and phpinfo shows PHP 5.1.2. However, the DOM/XML is not enabled in this bundled PHP that came with OAS. Is DOM/XML supported? Is there an Oracle product that bundles PHP that supports DOM/XML? Thanks.

    You would have to make sure the extension is enabled when you build PHP yourself.
    "Installing OCI8 with Oracle Application Server on Linux" in the 2008 edition of http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf has some notes on installing PHP on AS.

  • DOM XML parser program

    Hi,
    I am trying to write a sample program using DOM xml parser in java to read the values in a XML file.
    please suggest me what are all the things I have to do for that.
    I know Java and XML. I want to know how to access values from XML file in java.
    Thanks
    Selvakumar

    Study up on the javax.xml.parsers API here at Sun. Next, download Xerces from Apache (xml.apache.org). Finally, take a tutorial.
    - Saish

  • Installing a DOM XML Parser

    Hey, I apologize for the newbie question but I suppose this is as good a place as any for it. I'm in desperate need of a DOM XML parser and have decided upon the Apache parser, "Xerces," featured here. My problem is this, every time I make a move towards installing it, I get all mixed up at the mention of my "Apache, ant and forrest" installations that I am apparently supposed to have in order for this library to work. My question is, is this library only for use in web-based applications and thus requires Apache in order to run? I ask because the application I'm working on is simply for desktop usage and the users it will be distributed to will not have Apache installations. If somebody could help me out with a quick little walk-through on the installation of this library it would be IMMENSELY appreciated.
    Edited by: Tracekill on Sep 13, 2009 11:01 AM

    Study up on the javax.xml.parsers API here at Sun. Next, download Xerces from Apache (xml.apache.org). Finally, take a tutorial.
    - Saish

  • Question about DOM XML

    Hi Experts
    Do you Know how can I write I DOM XML
    the header of file I Mean
    <?xml version="1.0" encoding="iso-8859-8"?>
    Regards
    Yossi

    hi,
    say u have xml with following structure
    <xml>
    <Age>xyz</Age>
    </xml>
    to append age node, parse the xml string or file and try the following code
    HERE DOM is used
    Document xmlDoc = wdThis.ParseFile(xmlString);
    Node root=xmlDoc.getDocumentElement();
    Node AgeNode = xmlDoc.createElement("Age");
    Node AgeTextNode = xmlDoc.createTextNode("25");
    AgeNode.appendChild(AgeTextNode);
    root.appendChild(AgeNode);
    following code to parse the xml string
    public org.w3c.dom.Document mParseFile( java.lang.String XmlString )
    //@@begin mParseFile()
    //pearse the xml string passed
    IWDMessageManager mesg = wdComponentAPI.getMessageManager();
    String l_method = "mParseFile";
    //parsing xml string to xml document
    ByteArrayInputStream l_xmlDataInputStream = new ByteArrayInputStream(p_XmlString.getBytes());
    Document l_doc = null;
    InputSource in = new InputSource((InputStream) l_xmlDataInputStream );
    DocumentBuilderFactory l_dbf = DocumentBuilderFactory.newInstance();
    l_dbf.setValidating(true);
    l_dbf.setNamespaceAware(true);
    DocumentBuilder l_db;
    try {
    l_db = l_dbf.newDocumentBuilder();
    l_doc = l_db.parse(in);
    catch (ParserConfigurationException e) {
    } catch (SAXException e) {
    } catch (IOException e) {
    //returns xml document
    return l_doc;

  • XML creation/parsing/validation & performance

    Hello friends. I'm faced with a situation in which I need to create and parse many relatively small xml documents. Most of the XML I will be exchanging is very simple, such as:
    <? xml version="1.0"?>
    <transactionId>12345</transactionId>
    <accountId>98765</accountId>
    <address>123 Main Street</address>
    I have done enough research and prototyping to create and parse these simple documents using the DOM model. I have really started to wonder if I'd be better of simply hardcoding the creation and parsing of these documents. I'm getting some of these documents as a String over HTTP and then creating a DOM which I then can parse and am just not sure if what I am gaining in good programming practice is worth incurring the overhead of the DOM creation and parsing process.
    I'm even more divided on the issue of using DTDs or XML Schemas to validate the structure of these tiny documents. I will be having to exchange a lot of these tiny XML messages and am comfortable with the fact that the parties I am trading XML with are not going to be changing things up on the fly.
    On the other hand, I am a beginner in the XML world and am sure there could be a hundred things I haven't thought off.
    I am grateful for any assistance.
    CM

    Also,
    I assume that the values in you XML document are values from Java Objects, so why not have an interface defining a "toXml()" method for application classes to implement. All the classes would need to do is to know how to write its properties (variables) to an XML document. Again JDOM can handle his very easily... see below code....
    /** method to return the entity properties as an XML string.
    * @return the objects properties in an XML document String.
    public String toXml() {
    XMLOutputter out = null;
    String xml = null;
    Document document = new Document(new Element( "gallery-xml" ));
    Element root = document.getRootElement();
    Element content = new Element("gallery");
    content.addContent(new Comment("Details of Gallery as an XML document"));
    * Add attributes to xml document
    DateFormat format = DateFormat.getDateInstance();
    content.addContent(new Element( "image-id" ).addContent( getUUID() ));
    content.addContent(new Element( "name" ).addContent( this.getImageName() ));
    content.addContent(new Element( "student-name" ).addContent( this.getStudentName() ));
    //content.addContent(new Element( "image-bytes" ).addContent( new String(this.getImageBytes()) ));
    content.addContent(new Element( "image-file" ).addContent( this.getImageFile() ));
    content.addContent(new Element( "date-created" ).addContent( format.format( this.getDateCreated() )));
    content.addContent(new Element( "description" ).addContent( this.getDescription() ));
    content.addContent(new Element( "subset" ).addContent( this.getSubset() ));
    content.addContent(new Element( "year" ).addContent( this.getYear() ));
    content.addContent(new Element( "course-id" ).addContent( this.getCourseId() ));
    root.addContent( content );
    //write to a string
    out = new XMLOutputter(" ", true);
    xml = out.outputString(document);
    if (Logger.DEBUG) System.out.println( out.outputString( document ) );
    return xml;

  • DOM, XML Schema, Java.  Confused!!!

    Hi all,
    Please help me to answer the 3 questions. I'm totally confused.
    1. Does DOM allow us to add invalid data based on the XML schema?
    2. I have an XML file. I want to use DOM to add, modify and delete nodes from the file, then print out an XML output file. If DOM does not prevent us from adding invalid data, I guess we have to run the validation after the output file is printed out?
    3. There are so many parsers, DOM, ... outthere that I am totally confused. Please give me your suggestions. I want to use Java to populate the DOM tree, check the data integrity based on the XML schema as I modify the DOM tree (if possible) or after printing the XML output to a file. What parser should I use? What DOM should I use (DOM or JDOM)? Can I use MS XML parser (because that what my main client uses), DOM, and Java? If so what do I need. I have read 2 books and many sites, but still don't have the answer clear yet.
    Very appreciate your help,
    Nam.

    1.
    never tried with Schema, with DTD: yes
    2.
    it is what I did*, which is pretty clumsy: currently AmauryDebou has started another thread on this subject but there's no answer yet.
    *in fact I do everything in RAM (no file needed): I ouptut the DOM in a byte array and then reparse it
    3.
    Xalan/Xerces is pretty standard (they are used in JAXP).
    JDOM has a reputation of being faster than DOM - depends on the amount of data you deal with.
    if you develop in Java, forget MSXML
    if parsing speed is an issue, you can achieve excellent performances with James Clark's XP.

  • DOM xml file, reading

    I have an XML file I am parsing, or trying to parse. I can get the Document object but how do you traverse the elements?? It seems simple but the Node methods are somewhat vague in what they return, per the Javadoc. I've tried trial and error to much frustration and very little success...
    is there an easy way to traverse the xml elements in a DOM Document object? I'm using the org.w3c package for most of what I'm doing...
    I'm sure this is just a few lines of code but it's been driving me crazy.

    from the document you would do,,
    Element e = document.getDocumentElement();
    From there you have two choices, you can navigate strictly via the tree with, calls of
    Element child = e.getFirstChild();
    while (child != null)
    //do something
    child = child.getNextSibling();
    or you can collect all the Elements that have a certain tag, as in
    NodeList list = e.getElementsByTagName( "MyElementName" );

  • XML Creation Using Jdevloper

    Hi Gurus.
    I m developing a web service using Jdevloper. In this I am creating one xml file.
    problem is I want to store this xml file under my web service package. but Its gettingcreated to another location
    here is my file creation code
    File file = new File("./generic-config.xml");
    this file is creating under " C:\OAFramework\jdevbin\j2ee\home "
    What is the reason behind this ? and how to store it inside my web service folder
    my web service folder is " C:\OAFramework\jdevhome\jdev\mywork\GenericWebservices\GenericWebservice "
    Regards,
    Ajay

    File file = new File("./generic-config.xml");This line creates a file relative to the "working directory" of the JVM. the JVM you are running in must therefore have the working directory "C:\OAFramework\jdevbin\j2ee\home". if you are running within a Servlet container, you may be able to use http://docs.oracle.com/javaee/5/api/javax/servlet/ServletContext.html#getRealPath%28java.lang.String%29 to get the path to your servlet directory. otherwise, i don't know a way of getting that path from within the jvm.

  • DOM(XML) + StyledDocuments

    Hi there,
    I wonder how one could adapt the structure of DOM-Documents to the structure StyledDocuments are made up.
    What I want to do is the following:
    I want to parse a XML file by using DOM. The I want the DOM-Object (containing the parsed XML-file) to be displayed in a JTextPane, and I want to be able to specify for each tag what it should look like in the TextPane (color, font,...).
    Does anyone have an idea how to realize this? I am grateful to any help.
    Sincerely
    Karlheinz Toni

    Hi Karlheiz Toni,
    you would have to build your own mapper between a DOM document and a Java document which would convert from a DOM document to a Java document.
    Another option would be to build an own DOMEditorKit with a ViewFactory and Views built to render DOM documents for JTextPane directly.
    And a third solution would be to parse the XML file directly into a Java document instead of a DOM document.
    But all solutions would involve quite a lot effort and as far as I have seen nothing exists for that so far.
    Ulrich

  • DOM XML Parser in Stateless Session Bean- Not able to generate Container

    I am trying to do some XML Parsing using a DOM Parser in a Stateless Session Bean. I am importing org.apache.xerces.parsers.DOMParser and trying the following statement DOMParser parser = new DOMParser();
    Even though I am able to compile and generate the initial jar file. When I try to generate the container using the Weblogic Deployer GUI tool, the process keeps on going(I mean that I see the small window saying Container Generating working) and it never stops.
    Any suggestions are welcome.

    Many thanks ksaks for replying.
    Actually day before yesterday we were able to do something like this. But then I kept this thread open only to see if experts have some good way of doing this.
    What I mean is if this way is industry standards in terms of design and does it follow the most popular way how experts do it?
    I am asking this as WebProjects have webcontent/web-inf directory wherein we put those xsds and property files, but we do not have anything like this in an EJB project. so was just wondering if this is the correct way of doing it or not.
    I am still following this approach because I had to proceed further in my development. Confirmation would erase any other doubts on this.
    Hope you find time to reply.
    Kind Regards,
    user2205
    Edited by: user2205 on Nov 10, 2008 11:43 PM

  • XML Creation

    I have three big stumbling blocks when creating XML files (thru scripting).
    1) How can I utilize variables inside my xml code.
    ex. var myRoot = new XML ("<job> <task> 1 </task> </job>")
    How can I replace the 1 with a variable?
    2) How can I have quotes appear in the elements?
    ex. <winexe> "R:\Apps\AfterEffects6\Support Files\aerender.exe" </winexe>
    It generates an error (needs a following ')' )when adding them into the code, since it's trying to terminate the '= new XML ("'
    3) How can I add "comment" code to the XML document
    ex. I need it to say: <!-- Set Frame Settings -->
    Thanks for your help!
    -Dave

    Not sure why I couldn't get the quotes working before... Perhaps I needed to add a space after it..
    This works:
    var catWinexe = " \"R:\\Apps\\AfterEffects6\\Support Files\\aerender.exe\" ";
    Another question:
    I've now moved onto UI creation... What I would like to do is create edittext boxes, which would populate my variables.. I'm having a problem on my first attempt..
    // Add a panel to contain the components
    win.pnlA = win.add("panel", [10, 10, 400, 450], "Settings");
    win.pnlA.displayTextLbl = win.pnlA.add("statictext", [10, 415, 100, 430], "XML Name:");
    XMLName = win.pnlA.add("edittext", [100, 415, 225, 430], 'XMLTest5');
    var logFile = new File("/c/TEMP/" + XMLName + ".xml");
    Most of the rest of the script creates lots more static and edit texts with other panels... My problem is, I'm not sure how to get the result of the edittext (in my example, XMLTest5) to appear in the variable/filename. My filename is unwantingly written as [object EditText].xml
    Thanks again for your help.
    -Dave

  • Dom - XML Error

    Hi,
    i have a big problem...
    When i transform my document object to a xml object following message
    is thrown:
    Only a default namespace can have an empty URI. Error processing resource 'http://squid.cis.cs.tu-berlin.de:8000/NEX/NESearchResult.jsp?query=rkerte'. Line 29, Position 773
    <?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:NS0="http://nutria.cs.tu-berlin.de/roodolf/rdfs#" xmlns:lom-life="http://ltsc.ieee.org/2002/09/lom-lifecycle#" xmlns:lom-edu="http://ltsc.ieee.org/2002/09/lom-educational#" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:NS1="http://purl.org/dc/elements/1.1/#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom-tech="http://ltsc.ieee.org/2002/09/lom-technical#" xmlns:neweco="http://nutria.cs.tu-berlin.de/NE/rdfs#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:lom="http://ltsc.ieee.org/2002/09/lom-base#" xmlns="">
    <rdf:Description xmlns:rdf="" rdf:about="http://fert.dwd.de">
    <NS0:cachedSize xmlns:NS0="">5k</NS0:cachedSize>
    <NS0:relatedInformationPresent xmlns:NS0="">
    true
    <dc:description xmlns:dc="">
    Chief rkerte TEST
    </dc:description><dc:title xmlns:dc="">
    Homepage of rkerte TEST
    </dc:title><dc:subject xmlns:dc="">
    In java:
    org.w3c.dom.Document outputDocument = roodolfFactory.newDocumentBuilder().newDocument();
    Element root = outputDocument.createElement("rdf:RDF");
    root.setAttribute("xmlns:rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
    root.setAttribute("xmlns:rdfs", "http://www.w3.org/2000/01/rdf-schema#");
    root.setAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
    root.setAttribute("xmlns:dcterms", "http://purl.org/dc/terms/");
    root.setAttribute("xmlns:vCard", "http://www.w3.org/2001/vcard-rdf/3.0#");
    root.setAttribute("xmlns:lom-life", "http://ltsc.ieee.org/2002/09/lom-lifecycle#");
    root.setAttribute("xmlns:lom-edu", "http://ltsc.ieee.org/2002/09/lom-educational#");
    root.setAttribute("xmlns:lom-tech", "http://ltsc.ieee.org/2002/09/lom-technical#");
    root.setAttribute("xmlns:lom", "http://ltsc.ieee.org/2002/09/lom-base#");
    root.setAttribute("xmlns:neweco", "http://nutria.cs.tu-berlin.de/NE/rdfs#");
    root.setAttribute("xmlns:NS0", "http://nutria.cs.tu-berlin.de/roodolf/rdfs#");
    root.setAttribute("xmlns:NS1", "http://purl.org/dc/elements/1.1/#");
    I already tried: root.setAttribute("xmlns", "http://....");
    The I create the childs an append it to the root!
    Can someone help me?
    Greetings connan

    I already tried: root.setAttribute("xmlns", "http://....");
    What you need to add to the root is not an attribute, but a namespace. Unfortunately the DOM design doesn't deal with namespaces very well. Look for methods like setAttributeNS instead of setAttribute. You'll probably find that you can't declare the namespace in the root element, but you have to set it on every attribute you add. (Although I could be wrong about this... if I'm correct, you can still produce an equivalent XML document that repeatedly declares the namespace in every element.)

  • DOM - XML File

    Hi,
    Another question I had is pretty simple, and I'm sure it's documented somewhere, but I can't seem to find it.
    If I have parsed an XML file using DOM (thus have a master context), how do I write the DOM back to an XML file?
    Thanks,
    Mark

    print() method on XMLDocument.
    e.g. to Print the document to
    a printwriter do:
    myDocument.print(myPrintWriter);
    If myDocument is of type "Document" (DOM)
    then you need to cast it to XMLDocument:
    ((XMLDocument)myDocument).print(myPrintWriter);
    since printing functionality is not specified in the core DOM interfaces.

  • Validating a Dom XML tree

    Is there a solution to validate a XML document represented by a DOM Document ?
    The class DocumentBuilder let us validate a XML document but only when parsing XML file and not a DOM tree.
    In my program, I build an XML document using DOM (Node.appendChild(), ...); and I'd like, after having built it, to validate it. How can I do ?
    Thank's.

    Serialize it to some output format, making sure you include a reference to the DTD you want to validate against. Then read that output back into a validating parser.

Maybe you are looking for

  • Turn off pdf automatically opening when printing to pdf?

    I print to pdf multiple times in Autocad and I do not want Adobe opening each new pdf page...I just want to continue creating the pages without the preview

  • How do I fix this when updating my credit card?

    Hi All, When I go to update my credit card details I get this message:  This may be due to one of two reasons: 1. The FI you are trying to access is deactivated 2. The access to the FI is restricted for specific IP addresses, and your address is not

  • Help with Telnet

    Hi, Although I'm able to reboot my router using Telnet, like so: localhost:~ eb$ telnet 192.168.1.1 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'. Password: ****** Copyright (c) 2001 - 2006 TrendChip Technologies Corp. tc>

  • Chinese characters on tabs

    Please advise if Mozilla are working on fixing the bug where Chinese characters appear over the tabs. This has only happened since the new version install. I am aware of the official response that it's a conflict with McAfee Site Advisor, but I am no

  • How to enter Backslash "\" on E71?

    That could be a weird question, but anybody know how to enter the Back Slash on E71 "\"... I need it to enter my corporate mail, but where I can found that? It´s not on QWERTY keyboard, neither on "Car" Key, where is it? Thanks for the help. Message