XML creation help

hi all ! Im trying to create a XML with the following structure:
<Programa> <!--root -->
<Agenda><sub>Piso</sub></Agenda>And Im trying to generate that with the following code:
Element root = doc.createElement("Programa");
            doc.appendChild(root);
            //create a comment and put it in the root element
            Comment comment = doc.createComment("Agenda");
            root.appendChild(comment);*/
            //create child element, add an attribute, and add to root
            Element child = doc.createElement("Agenda");
            child.appendChild(doc.createElement("sub"));
            child.appendChild(doc.createTextNode("Piso"));But the result Im getting is:
<Programa>
<Agenda>
<sub/>Piso</Agenda>
</Programa>How should it be?
Thanks!

So far my code to generate the XML is:
String[] splitString = cadena.split(",");
for(int i=1; i<splitString.length;i++){
System.out.println(splitString);
//create child element, add an attribute, and add to root
Element child = doc.createElement("Agenda");
Element sub = doc.createElement("sub");
sub.appendChild(doc.createTextNode(splitString[i]));
child.appendChild(sub);
root.appendChild(child);The idea is to have the the spaces like this:
so it would be:
<Agenda><sub>DATA1</sub></Agenda>
<Agenda><sub>DATA2</sub></Agenda>
<Agenda><sub>DATA3</sub></Agenda>
SPACE
So all I have to do is to make a new element named space for example.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • 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

  • Cluster creation help!

    Hi there
    Does any one have a fool-proof document for creating and proving a 2 server ColdFusion 10 cluster? Most of the documents I have found are missing something. 
    More specifically, what is the difference between HTTP Port and Admin Component Port in the remote instance manager?
    Should the Cluster Manager show anything on the remote node?
    Is there a cluster monitor that show's its state? Is the there a simple test to prove it works.
    If this is in the remote node server.xml
    <Engine jvmRoute="cfusion" name="Catalina" defaultHost="localhost">
    should the jvmRoute value in the Instance Manager should be set to cfusion?
    Thanks for your help
    Richard

    Vishu
    Thank you for your fast reply. I'm still having problems though. :-(
    Both are Enterprise servers and both are on the same subnet.
    I have created 2 new instances called cluster1 and cluster2, one on each server. Both show HTTP Port 8501 and Remote Port 8103.
    On cluster1 server, I add in a New Remote Instance:
    Instance Name: cluster2
    Remote IP/Name - servername of second server
    Remote Port: 8103
    HTTP Port: 8501
    JVMRoute - In the server.xml in the cluster2 instance, the line is
    <Engine jvmRoute="cluster2" name="Catalina" defaultHost="localhost"> so I have entered "cluster2" for jvmroute
    Load Balance Factor:1
    Admin Component Port: 8500 - the port for the main instance (the 'cfusion' instance")
    Admin Username and Passwords: My administrator details.
    The remote instance does then appear in the list.
    I have added the cluster code in the to cluster2 runtime/conf/server.xml file after the </host> tag.
    I have commented out the ManagerPath in context.xml.
    On the first server I created a cluster and added the local cluster1 and the cluster2_remoteserver name to the server. I restarted both servers
    In the coldfusion-out.log in the cluster2 and cluster1 logs I get
    Cluster1
    22-Aug-2013 10:54:43 org.apache.catalina.tribes.util.UUIDGenerator <clinit>
    INFO: Creation of SecureRandom instance for UUID generation using [SHA1PRNG] took [5,002] milliseconds.
    22-Aug-2013 10:54:43 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
    INFO: Setting cluster mcast soTimeout to 500
    22-Aug-2013 10:54:43 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4
    22-Aug-2013 10:54:44 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Done sleeping, membership established, start level:4
    22-Aug-2013 10:54:45 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8
    22-Aug-2013 10:54:46 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Done sleeping, membership established, start level:8
    INFO: Starting clustering manager at localhost#/
    22-Aug-2013 10:55:15 org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
    INFO: Manager [localhost#/]: skipping state transfer. No members active in cluster group.
    22-Aug-2013 10:55:15 org.apache.catalina.ha.session.JvmRouteBinderValve startInternal
    Cluster2
    22-Aug-2013 10:14:44 org.apache.catalina.ha.tcp.SimpleTcpCluster startInternal
    INFO: Cluster is about to start
    22-Aug-2013 10:14:44 org.apache.catalina.tribes.transport.ReceiverBase bind
    INFO: Receiver Server Socket bound to:/xxxxxxxxxxx:4003
    22-Aug-2013 10:14:49 org.apache.catalina.tribes.util.UUIDGenerator <clinit>
    INFO: Creation of SecureRandom instance for UUID generation using [SHA1PRNG] took [5,002] milliseconds.
    22-Aug-2013 10:14:49 org.apache.catalina.tribes.membership.McastServiceImpl setupSocket
    INFO: Setting cluster mcast soTimeout to 500
    22-Aug-2013 10:14:49 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4
    22-Aug-2013 10:14:50 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Done sleeping, membership established, start level:4
    22-Aug-2013 10:14:50 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8
    22-Aug-2013 10:14:51 org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers
    INFO: Done sleeping, membership established, start level:8
    INFO: Starting clustering manager at localhost#/
    22-Aug-2013 10:15:19 org.apache.catalina.ha.session.DeltaManager getAllClusterSessions
    INFO: Manager [localhost#/]: skipping state transfer. No members active in cluster group.
    22-Aug-2013 10:15:19 org.apache.catalina.ha.session.JvmRouteBinderValve startInternal
    Any ideas on what might being going wrong?
    Thanks
    Richard

  • Reg: XML PUBLISHER HELP

    Hi all,
    I am building report using xml publisher. Problem i facing was ,
    1. I created the template in RTF and attached to data definition
    for eg: my rtf is
    sno item quantity price ( I created this field in table structure and mapped to xml data)
    Total Price ( this also i am getting from data definition)
    The below is sample constant sentence for my client and typed just below Total Price ( field i mentioned above)
    Inspected By Approved By
    1)
    ________________________________ 1)________________________________ Store Incharge : ______________________
    2)
    ________________________________ 2) ________________________________ Received : _______________________
    3)
    ________________________________ 3 ________________________________ Prepared By : _______________________
    NOTE : ABOVE MENTIONED LINES ARE CONSTANT ONE.
    2. When i ran the report, if my data definition return 5 lines means , i am getting PDF output Correctly in single page (1st page)
    3) If my data definition returns lines more than 8 lines means, I am getting PDF output with Table structure values with item, in 1 st page and Constant sentence in 2nd page of PDF
    4) If my data definition returns lines between 5 and 8 means, I am getting PDf output with table structure values with item and some of Constant sentence of my client in 1 st page and few of the constanst sentence in 2nd page.
    Actually my need
    Even if the data definitions exceeds more than 5 lines the constant sentence should be placed either in the first page or in the next page based on the no. of lines in the data definition.
    How to resolve this... any approach most welcome. Wat changes i have to make.

    Hi Shruti,
    You can start with the BI publisher page on OTN http://www.oracle.com/technology/products/xml-publisher/index.html.
    Check out the tutorials (Oracle by Example). There's lot of good information out there. Check out the BI publisher guide here:http://www.oracle.com/technology/products/xml-publisher/xmlpdocs.html
    Search the forum or post questions about any specific questions you may have about formatting numbers and dates.
    Hope this helps.
    Thanks!

  • XML Publisher Help

    Hi,
    We currently have a payslip report that has been developed using Oracle reports, but for this to run we have to change our NLS_LANG setting from UTF8 to WE8ISO8859P1.
    The problem with this is to apply patches Oracle have told us we need to have the NLS_LANG set to UTF8.
    As a result Oracle have said that:
    The only available workaround for generating PDF on a UTF8 character set instance is to install and utilize the XML Publisher product or upgrade to E-Business Suite to Release 12.
    We don't have any plans to upgrade to Release 12, so I am looking to use XML Publisher. I have a couple of questions:
    Is this an add-on?
    Where is the best place to obtain navigation guides and tutorials to teach myself this?
    I have had a look at some of the pre-defined templates already and I am not sure how to create my own rtf file so that my required fields are passed to the template.
    Any help would be greatly appreciated
    Many Thanks
    Martin

    Hi Shruti,
    You can start with the BI publisher page on OTN http://www.oracle.com/technology/products/xml-publisher/index.html.
    Check out the tutorials (Oracle by Example). There's lot of good information out there. Check out the BI publisher guide here:http://www.oracle.com/technology/products/xml-publisher/xmlpdocs.html
    Search the forum or post questions about any specific questions you may have about formatting numbers and dates.
    Hope this helps.
    Thanks!

  • Error in my build.xml file (help with spotting syntax error requested)

    Hi
    I have written an XML file called build.xml for one of my applications. My XML editor complains that there is an error at the last line of the XML file, but I simply find it unable to correct the errror.
    It says:
    Fatal error:Build.xml[76:3-9]: End-Tag without start-tag
    The XML file itself:
    <project basedir="." default="deploy" name="concepts">
    <property name="src.dir" value="src"></property>
    <property name="build.dir" value="${basedir}/build"></property>
    <property name="build.lib" value="${build.dir}/lib"></property>
    <property name="dist.dir" value="dist"></property>
    <property name="classes.dir" value="${build.dir}/classes"></property>
    <property name="build.etc" value="${src.dir}/etc"></property>
    <property name="build.resources" value="${src.dir}/resources"></property>
    <property name="lib.dir" value="lib"></property>
    <property name="web-inf.dir" value="WEB-INF"></property>
    <property name="war.name" value="concepts"></property>
    <property file="../common.properties"></property>
    <target name="init">
    <mkdir dir="${build.dir}"></mkdir>
    <mkdir dir="${classes.dir}"></mkdir>
    <mkdir dir="${dist.dir}"></mkdir>
    </target>
    <target name="deploy" depends="clover-yes, clover-no">
    <javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${libs}" debug="off" optimize="on" deprecation="on" compiler="${compiler}">
    <include name="org/apache/commons/fileupload/**/*.java" />
    <include name="com/portalbook/portlets/**/*.java" />
    <include name="com/portalbook/portlets/content/**/*.java" />
    </javac>
    <target depends="init" name="compile">
    <javac debug="true" deprecation="true" destdir="${classes.dir}" optimize="false">
    <src>
    <pathelement location="${src.dir}"></pathelement>
    </src>
    <classpath>
    <fileset dir="${lib.dir}">
    <include name="*.jar">
    </include>
    </fileset>
    </classpath>
    </javac>
    </target>
    <target depends="compile" name="war">
    <war destfile="${dist.dir}/${war.name}.war" webxml="WEB-INF/web.xml">
    <classes dir="${classes.dir}"></classes>
    <lib dir="${lib.dir}"></lib>
    <webinf dir="${web-inf.dir}"></webinf>
    </war>
    </target>
    <!-- create the portal-concepts-lib.jar -->
    <jar jarfile="${build.lib}/concepts-lib.jar">
    <fileset dir="${classes.dir}"></fileset>
    </jar>
    <jar jarfile="${build.lib}/concepts.war" manifest="${build.etc}/concepts-war.mf">
    <fileset dir="${build.resources}/concepts-war"></fileset>
    </jar>
    <!-- concepts.ear -->
    <copy todir="${build.resources}/concepts-ear">
    <fileset dir="${build.lib}" includes="concepts.war,concepts-lib.jar"></fileset>
    </copy>
    <jar jarfile="${build.lib}/concepts.ear">
    <fileset dir="${build.resources}/concepts-ear" includes="concepts.war,concepts-lib.jar">
    </fileset>
    </jar>
    <target depends="deploy" name="explode">
    <taskdef classname="org.jboss.nukes.common.ant.Explode" classpath="${libs}" name="explode"></taskdef>
    <explode file="${build.lib}/concepts.ear" name="concepts.ear" todir="${build.lib}/exploded"></explode>
    </target>
    <target depends="war" name="all"></target>
    <target name="clean">
    <delete dir="${build.dir}">
    </delete>
    <delete dir="${dist.dir}">
    </delete>
    </target>
    </project>
    I am a little inexperienced in XML files. So I am unable to spot the error.
    I would greatly appreciate it, if some kind soul were to help me out.
    thanks a lot

    The tag
    <target name="deploy" depends="clover-yes, clover-no">...is never closed.
    close that tag:
    <target name="deploy" depends="clover-yes, clover-no">
         <javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${libs}" debug="off" optimize="on" deprecation="on" compiler="${compiler}">
              <include name="org/apache/commons/fileupload/**/*.java" />
              <include name="com/portalbook/portlets/**/*.java" />
              <include name="com/portalbook/portlets/content/**/*.java" />
         </javac>
    </target>Second error is that the depends in there (clover-yes, clover-no) are not existing as targets in your xml.

  • Methods in XML--pL help

    I have string...as
    String xstr="<?xml version=\"1.0\"?>\n"+
    "<UserGroups>\n<u_bit><![CDATA[1]]></u_bit>\n"+
    "<u_title><![CDATA[public]]></u_title>\n<u_description><![CDATA[Pages are available to all visitors - no restrictions are applied]]></u_description>\n"+
    "<u_used><![CDATA[1]]></u_used>\n<u_fromname/>\n<u_fromemail/>\n<pw_email/>\n<u_user/>\n<u_password/>\n</UserGroups>"+
    I am trying to form a xmlDoc using String Reader as follows..
    java.io.Reader reader = new java.io.StringReader(xstr);
         org.xml.sax.InputSource source = new org.xml.sax.InputSource(reader);
         org.w3c.dom.Document xmlDoc=null;
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
         xmlDoc = builder.parse(source);           
         Element xmlRoot=xmlDoc.getDocumentElement();
         Table_Name=xmlRoot.getNodeName();
         NodeList oNodeList = xmlRoot.getChildNodes();
         Node PNode=oNodeList.item(0);
         But at the end...ONodeList.item(0)...does not give anything...Am I doing anything wrong...Pl help if possible soon
    smita

    since Value is within the CDATA tag...You see a "CDATA tag", as you call it, in your XML, but the parser strips that all off and normalizes it to an ordinary string. So writing
    <![CDATA[public]]>
    is exactly the same as writing
    public
    and the parser treats them identically. So identically, in fact, that there is no way for you to find out whether CDATA was used at all.
    Sorry, that doesn't answer your actual question, but hopefully it prevents you looking in the wrong direction.

  • Photoshop CS4, 3D Model Creation help

    Hello,
    I am a video editor and have the Adobe CS4 suite.
    I would like to ask the community for the best and easiest way to achieve this:
    - Create 3D text for end use in After Effects
    - Take an Illustrator file like a Logo and extrude it to make a 3D model for use in After effects
    It seems 3D programs have so many options that simple tasks are way more involved than I have time for.
    I just want to take a client supplied logo or some text, give it some depth and use it in After Effects as a 3D object.
    I have seen a plugin for Photoshop from Strata that might be a good option, but I only looked at their website.
    Thanks for your help and input.

    While I will say that what the OP wants isn't do able in Photoshop. You can
    doing it using Illustrator and Photoshop, but not Photoshop alone. However,
    Jim isn't 100% correct either. Photoshop does have some limited 3D creation
    capabilities. One of which is turning a flat photo of say the Grand Canyon
    in to a 3D plane that one can then move through in 3D space. You can also
    mape flat photos to simple 3D objects like spheres, etc.
    However, Jim is also correct that Photoshop isn't like Maya, etc. it doesn't
    create complex 3D models and things like that. It is more to complement
    applications like Maya, etc.
    BTW if you would like to see the photo to 3D plane feature in action take a
    look at:
    http://av.adobe.com/russellbrown/MeshFromGrayCanyon_SM.mov
    It is actually a pretty cool option.
    Robert

  • Procedure to generate invoice in xml---please help

    Hi all,
    I have to write code review of a pakage which contain procedure to generate invoice in XML.The procedure contain two
    files .pkb and .pks.All i know is that it will deliver elemt of the post script layout.?But i dont understand what it mean nor i am able to understand the code.I dont have any prior knowledge about this.Please help me and tell me any tutorial to understand and know how this is done.
    Also i have pasted some part of code here .please help me in understanding what is going on.
    help help help
    * GET_INVOICE_XML
    FUNCTION GET_INVOICE_XML(inInvId NUMBER) RETURN CLOB IS
    BEGIN
      IF NOT isClobReady THEN
        dbms_lob.createtemporary(invClob, TRUE);
        isClobReady := TRUE;
      ELSE
        dbms_lob.trim(invClob, 0);
      END IF;
      vInvoice :=
        XML_VER_STR || NL ||
        ' <!DOCTYPE INVOICE_FILE SYSTEM "invoicfile.dtd">' || NL ||
        '<INVOICE_FILE VERSION="1.1">' || NL;
      GEN_PROLOG(InvId);
      GEN_INVOICE(InvId, 1);
      vInvoice := vInvoice ||
        '</INVOICE_FILE>' || NL || NL;
      APPEND_INVOICE(0);
      RETURN invClob;
    END GET_INVOICE_XML;
    PROCEDURE GEN_INVOICE(InvId NUMBER, inITBMode NUMBER) IS
    vP1    PLS_INTEGER;
    vP2    PLS_INTEGER;
    vAtt     BOOLEAN;
    inv      ABCINVOICE%ROWTYPE;
    cdr_no   NUMBER;
    t0       TIMESTAMP;
    t1       TIMESTAMP;
    execTime NUMBER(12,6);
    BEGIN
      t0 := LOCALTIMESTAMP;
      SELECT * INTO inv FROM ABCINVOICE WHERE OACT = InvId;
      dti := inv.DTI;
      SELECT NVL(SUM(cdrNO),0) INTO cdr_no FROM ABCCONTRACTS WHERE OACT = InvId AND ITB IN ('Y', 'F');
      vInvoice := vInvoice ||
        ' <INVOICE>' || NL ||
        '  <HEADER>' || NL ||
        '   <SEQ>' || inv.SEQ || '/' || inv.PROC_ID || '</SEQ>' || NL ||
        '   <LEN ';
      vPos1 := INSTR(inv.LEN, '|', 1, 1);
      vInvoice := vInvoice || 'INV="' || SUBSTR(inv.LEN, 1, vPos1-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'BAL="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
      vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
      vInvoice := vInvoice || 'DET="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'PDET="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
      vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
      vInvoice := vInvoice || 'ITM="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'PITM="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" NTF="' ||
        SUBSTR(inv.LEN, vPos2+1) || '"/>' || NL;
      vInvoice := vInvoice ||
        '   <BAR>' || inv.BAR || '</BAR>' || NL ||
        '   <BCD>' || inv.BCD || '</BCD>' || NL ||
        CASE WHEN inv.BIC IS NULL THEN '' ELSE '   <BIC>' || inv.BIC || '</BIC>' || NL END ||
        '   <REF>' || inv.REF || '</REF>' || NL ||
        '   <OHX>' || inv.OHXACT || '</OHX>' || NL ||
        '   <CID>' || inv.CID || '</CID>' || NL ||
        '   <CCO>' || inv.CCO || '</CCO>' || NL ||
        '   <CND>' || inv.CND || '</CND>' || NL ||
        '   <PBF>' || inv.PBF || '</PBF>' || NL ||
        '   <DTI>' || inv.DTI || '</DTI>' || NL ||
        '   <DTD>' || inv.DTD || '</DTD>' || NL ||
        '   <DPS>' || inv.DPS || '</DPS>' || NL ||
        '   <DPE>' || inv.DPE || '</DPE>' || NL ||
        '   <DAS>' || inv.DAS || '</DAS>' || NL ||
        '   <DAE>' || inv.DAE || '</DAE>' || NL ||
        '   <PAY>' || inv.PAY || '</PAY>' || NL ||
        '   <NAM>' || ABCUTIL.CONVERT_POL_CHAR(inv.NAM) || '</NAM>' || NL ||
        CASE WHEN inv.ADS1 IS NULL THEN '' ELSE '   <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS1) || '</ADS>' || NL END ||
        CASE WHEN inv.ADS2 IS NULL THEN '' ELSE '   <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS2) || '</ADS>' || NL END ||
        '   <ADZ>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADZ) || '</ADZ>' || NL ||
        '   <NIP>' || inv.NIP || '</NIP>' || NL ||
        '   <REG>' || inv.REG || '</REG>' || NL ||
        '   <PES>' || inv.PES || '</PES>' || NL ||
        '   <BCY>' || inv.BCY || '</BCY>' || NL ||
        '   <TXT>' || ABCUTIL.CONVERT_POL_CHAR(inv.TXT) || '</TXT>' || NL ||
        '   <GRO>' || TO_CHAR(inv.GRO, 'FM999990.90') || '</GRO>' || NL ||
        '   <FBL>' || inv.FBL || '</FBL>' || NL;
      IF inv.STP > 0 THEN
        GEN_TEXT(inInvId, 1);
      END IF;
      vInvoice := vInvoice ||
        '  </HEADER>' || NL ||
        '  <ADDRESS>' || NL ||
        '   <ENV>' || inv.ENV || '</ENV>' || NL ||
        '   <TNA>' || ABCUTIL.CONVERT_POL_CHAR(inv.TNA) || '</TNA>' || NL ||
        CASE WHEN inv.TAS1 IS NULL THEN '' ELSE '   <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS1) || '</TAS>' || NL END ||
        CASE WHEN inv.TAS2 IS NULL THEN '' ELSE '   <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS2) || '</TAS>' || NL END ||
        '   <TAZ>' ||ABCUTIL.CONVERT_POL_CHAR(inv.TAZ) || '</TAZ>' || NL;
      GEN_TEXT(inInvId, 2);
      vInvoice := vInvoice ||
        CASE WHEN inv.MTX  IS NULL THEN '' ELSE '   <MTX>' || inv.MTX  || '</MTX>' || NL END ||
        '  </ADDRESS>' || NL;
      APPEND_INVOICE(0);
      IF inv.BCY <> '99' THEN
        GEN_INVOICE_BILLING(inInvId);
        GEN_BALANCE(inInvId);
        vPos1 := INSTR(inv.LEN, '|', 1, 2) + 1;
        vPos2 := INSTR(inv.LEN, '|', vPos1, 1);
        vPos1 := SUBSTR(inv.LEN, vPos1, vPos2 - vPos1);
        IF vPos1 > 1 THEN
          GEN_SUMMARY(inInvId);
        END IF;
      END IF;
      vInvoice := vInvoice || ' </INVOICE>' || NL;
      APPEND_INVOICE(0);
    END GEN_INVOICE;Edited by: BluShadow on 28-Aug-2012 09:46
    added {noformat}{noformat} tags for readability. Please read: {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Not quite sure what you want to know about it.
    If you want a code review of it, I can tell you it's very poor code, because that's not how to generate XML data in Oracle. Oracle has built in XML functionality for generating such data, and doesn't require hard-coding XML tags.
    Here's the Oracle documentation...
    http://tahiti.oracle.com/
    pick your database version and search for things like XDB, SQLX or more specifically XMLELEMENT, XMLAGG, XMLATTRIBUTES etc.

  • Xml transfornation help  dump help

    HI ,
    I have this string type xml and it coming from internal table and i want to parse it to abap internal table, i follow some example that in the forum  and i facing an dump ,do some one can help.
    Regards
    DATA: BEGIN OF wa,
             key TYPE string,
             val TYPE string,
           END OF wa.
    DATA it_data LIKE TABLE OF wa.
    START-OF-SELECTION.
    DATA:  xml_string TYPE string
          VALUE '<determination><deter key = "00009" value = "Johan"/><deter key = "1000" value = "GSS"/></determination>'.
      CALL TRANSFORMATION z_xml_to_itab
           SOURCE  XML xml_string
           RESULT  itab = it_data.
    This is what i write on TR. strans
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="ITAB"/>
      <tt:template>
        <determination>
          <tt:loop name="a" ref=".ITAB">
            <deter>
              <tt:attribute name="key" ref="$a.akey" name="val" ref="$a.aval" />
            </deter>
          </tt:loop>
        </determination>
      </tt:template>
    </tt:transform>
    When i check on the debugger the error is in line :
       <tt:attribute name="key" ref="$a.akey" name="val" ref="$a.aval" />
    the dump is :
      An exception occurred that is explained in detail below.
      The exception, which is assigned to class 'CX_ST_MATCH_ATTRIBUTE', was not
       caught and
      therefore caused a runtime error.
      The reason for the exception is:
      XML matching error
      Expected was attribute: "val" [ ] Read was element-start: "deter" [ ].
    What i miss here ?????,please help.
    Regards
    Joy
    Edited by: Joy Stpr on Aug 3, 2009 9:54 AM

    HI Siva,
    Thanks a lot,
    i change it like u tell and i facing other dump,
    do u have an idea.
    this is exactly the code that i write :
    DATA: BEGIN OF wa,
             key TYPE string,
             value TYPE string,
           END OF wa.
    DATA it_data LIKE TABLE OF wa.
    START-OF-SELECTION.
      DATA:  xml_string TYPE string
            VALUE '<determination><deter key = "00009" value = "Johan"/><deter key = "1000" value = "GSS"/></determination>'.
      CALL TRANSFORMATION ztest_xml_009
           SOURCE  XML xml_string
           RESULT  itab = it_data.
    This is  what i write in strans
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="ITAB"/>
      <tt:template>
        <determination>
          <tt:loop name="a" ref=".ITAB">
            <deter>
           <tt:attribute name="key" ref="$a.key" name="value" ref="$a.value" />
            </deter>
          </tt:loop>
        </determination>
      </tt:template>
    </tt:transform>
    And this is the dump
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_ST_MATCH_ATTRIBUTE', was not
         caught and
        therefore caused a runtime error.
        The reason for the exception is:
        XML matching error
        Expected was attribute-end: "determination" [ ] Read was text: "Johan" [ ].
    Can i help please :
    U can just copy and paste the code and u get the same dump that i am facing
    Thanks and best Regards
    jOy
    Edited by: Joy Stpr on Aug 4, 2009 8:57 AM

  • XML Gurus: help with cloning a node without using clone!

    Dear all,
    I have to copy one piece of XML from one part of the document to another. Unfortunately I cannot simply do a copy and paste:
    Node nodeLeaf = nodeChild.cloneNode(true);
    nodeAncestor.appendChild(nodeLeaf);
    because some fragments of the nodeLeaf mustn't be copied (depending on the node value)
    So I cannot make a deep clone of the leaf.
    I have to make a clone of nodeLeaf by myself. (Copying its child with a recursive function)
    I have built a recursive function but I cannot understand why it doesn't work correclty (text values are skipped and also some pieces of the xml aren't copied correclty)
    // Passing the full leaf and a leaf with only the first tag, under which I clone manually the nodes.
    Node copyNode = appendNodes(nodeLeaf, nodeLeaf.cloneNode(false));
    private Node appendNodes(Node node, Node copyNode) {
    NodeList kids = node.getChildNodes();
    int length = kids.getLength();
    if (kids != null) {
    for (int ii = 0; ii < length; ii++) {
    Node nodeKid = kids.item(ii);
    copyNode.appendChild(nodeKid.cloneNode(false));
    appendNodes(nodeKid,nodeKid);
    return copyNode;
    Anybody can give me a help ?
    thanks a lot
    Francesco

    Here are a couple of suggestions:
    1) General stuff.
    NodeList kids = node.getChildNodes(); will always generate a NodeList. It may have no entries, but there is no need to check for if (kids != null). Your for loop will do nothing if the length is zero.
    2) You need to change your code as follows:
    for (int ii = 0; ii < length; ii++)
       Node nodeKid = kids.item(ii);
       Node newOutputNode = nodeKid.cloneNode(false);
       copyNode.appendChild(newOutputNode);
       appendNodes(nodeKid,newOutputNode);
    }Dave Patterson

  • Flash XML file help

    I am trying to add multiple flash files to my website...the
    only way these seem to work is if the swf and corresponding xml
    file are all on the root of the website directory. I would have
    liked to organize them into files to sort.
    My problem is that many of these flash files (mainly
    purchased) have the same xml file, so I cannot use these together
    on the root. Thus, I need to either rename in the flash the xml
    file or figure out how to put into folders...please help!
    -Josh

    ANSWER: I figured it out myself. I am just replying to let
    everybody else know how I fixed it. I had the full URL in the load
    request and apparently some Flash players don't like this. I put a
    link to the file without the domain name and everybody is working
    fine. The load function, Flash, or something could not resolve the
    domian correctly and could not find the XML file. I was not getting
    a request for the file from the Flash movie so I knew it had to be
    soemthing in Flash.

  • XML Invoice - help with Tax Summary

    I've been tasked to modify an already modded XML Invoice using XMLP. I need to add a Tax Summary block at the bottom, showing the breakout of the tax codes and amounts charged on the invoice.
    I've played around with it, but so far I can only get the first tax line to show up. I can't get the others. I need to insert a conditional, but I don't know how or where.
    Has anyone run into anything like this before?
    This probably isn't the best problem summary... but if you could help I'd appreciate it!

    Hi,
    It sounds like you need to use a for-each to show each of your tax lines. If you do not have the for-each XMLP will only show the first tax line that is hits in the XML Output.
    Would suggest that you take a quick look at the XMLP User Guide documentation for more information on how to use for-each.
    Let me know if this does not solve your problem, or if you are still struggling.
    Regards,
    Cj

  • Filtering XML data Help!

    I have a sample xml file:
    <photos id = "images">
           <photo>
             <thumb type="jpg" thumbpath="pics/Thumbs/caddo_5-16-10-10_x.jpg"
       thumbwidth="133"
       thumbheight="200"
          path="pics/fullsize/caddo_5-16-10-10.jpg"
       width="425"
       height="640"
       place="Caddo Lake State Park"
       city="Uncertain, Texas"
       cat="Nature"
       date="May 2010"></thumb>
             <file>caddo 5-16-10-10</file>
       </photo>
    Trying to get only the cat Nature to display. Set up HTML file with one dataset please help!

    See the following samples:
    Filtering with XPath
    Multiple Non-Destructive Filters
    Multiple Non-Destructive Filters Mode
    Non-destructive Filter
    XPath filtering with URL Params

  • 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.

Maybe you are looking for

  • Printing in acrobat pro 9.1

    I'm attempting to print a pdf on my new imac out of acrobat 9.1 pro.  I've printed other files to my printer so I know that is not an issue.  This file prints from my old emac, Power PC G4, in acrobat 6 but crashes on the imac in 9.1.  The pdf was cr

  • IMessage on iPad after update

    Anyone elese having a problem with iMessage on iPad after update? Attempting to login says that my internet connection is bad but all other functions working on ipad

  • ATV 2 on a 480i Toshiba CRT TV (16:9 capable)?

    Will it work on my TV, which can only support 480i?

  • ITunes can't find calendars of Outlook.....

    Windows 7 Simplified Chinese iTunes 64bit Office 2007 Standard Simplified Chinese I can't find Outlook's calendar (in Chinese name) in iTunes. So i can't sync calendar between outlook and iPad/iPhone. I re-installed iTunes and Office for severel time

  • Creating a 4-4-5 Time Period table

    Hello: Very soon my company will be moving to a 4-4-5 reporting schedule.  Basically, what this means is that the first month of the quarter will have 4 weeks, the second will have 4 weeks, and the third will have 5 weeks.  Therefore, for the 2007 th