AS3.0+XML+MP3  HELP!

I want to use AS3.0 to add to carry the MP3 in the XML, also
can show the song, see much data concerning this aspect, but can't
read the contents in the XML.Hope everyone gives some help.
My XML document is as follows:
<?xml version="1.0" encoding="GB2312"?>
<data>
<song>
<title>A DISTANCE THERE IS</title>
<name>MySound00.mp3</name>
</song>
<song>
<title>LOVE IN DECEMBER</title>
<name>MySound000.mp3</name>
</song>
<song>
<title>THANK YOU</title>
<name>MySound.mp3</name>
</song>
</data>
The result that wants to do is an address as follows:
Click
me!

http://www.aihuahot.cn/

Similar Messages

  • AS3 and XML, HELP!

    Hi
    I have no idea where to post this, so pls forgive me if im in the wrong place, but I have an Assessment due tomorrow, I'm only 4 weeks knew to AS3 and Flash, and confused as, so pls forgive me if i also look silly asking this question.
    The issue is loading data from an XML file and having it present in a Flash website. Its a book review thing (i've altered the XML and AS3 for posting here so please bare that in mind), so the XML looks a little like this
    <books>
        <book>
            <bookName>The Monsters</bookName>
            <genres>
                <genre>Thriller</genre>
                <genre>Crime</genre>
                <genre>Comedy</genre>
            </genres>
            <description>about the mummies.</description>
            <image>mummies.jpg</image>
            <reviews>
                <review>
                    <date>16/07/2011</date>
                    <name>unnamed</name>
                    <info>
                        <rating>5</rating>
                        <why>blah blah</why>
                        <theGood>it was good...</theGood>
                        <the Bad>it was bad…</theBad>
                    </info>
                </review>
            </reviews>
        </book>
    <books>
    but each Book has multiple reviews, i've just shown you one. Anyway, i need to present this information in 3 dynamic text fields when a book is selected in my ComboBox… after a lot of trouble i got the basics of it. So in the Genre box the genres will display, and in the Description box the description will display, and in the Review box i can get all the information, but only with all the tags. I need it to display without any tags, it would be wonderful if i could figure out how i could put date, name etc in front of that information as well, but I cant even begin to figure that one out.  For the life of me i cannot figure it out. below is the code I have so far:
    //Load XML
    var booksXML:XML = new XML();
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest("gigGuide.xml");
    loader.addEventListener(Event.COMPLETE,loaderOnComplete);
    loader.load(request);
    function loaderOnComplete(event:Event):void
       booksXML = new XML(event.target.data);
       var books:Array = new Array({label:"Select a Book"});
       for each (var book:XML in booksXML.band)
          books.push({label:book.bookName.toString(), data:book.description.toXMLString(),
                     infoLocal:book.genres.genre.toString(), infoDate:book.reviews.review.toString(),
                     infoImage:book.image});
       bandCB.dataProvider = new DataProvider(bands);
    //ComboBox changeable
    bookCB.addEventListener(Event.CHANGE, changeHandler2);
    function changeHandler2(event:Event):void
       genre_txt.text = ComboBox(event.target).selectedItem.infoLocal;
       description_txt.text = ComboBox(event.target).selectedItem.data;
       reviews_txt.text = ComboBox(event.target).selectedItem.infoDate;
       empty_mc.tex = ComboBox(event.target).selectedItem.infoImage; //doesn't work
    any help would be greatly appreciated, and the image doesn't work, i've already faced facts that im not going to get that one to work
    Thank you in advance

    From what I can see you have a few problems. In your loaderOnComplete you set the data provider with 'bands' but create a variable called 'books'.
    Also, you want to be using the XMLList object to parse your data out. It's much simpler.
    Have a look at the following:
    var booksXML:XML;
    function loaderOnComplete(e:Event):void
              booksXML = new XML(e.target.data);
              var books:XMLList = booksXML.book;
              trace(books[0].bookName);
              var bookReviews:XMLList = books[0].reviews.review;
              trace(bookReviews[0].name);
    trace(bookReviews[0].date);
    First we get all the book xml objects in an XML List - the trace traces book number 0's name - The Monsters.
    Next, you can get all the reviews for a book in another XML List. Here we use the first book - book[0] and trace out the review's name and date.
    You can iterate through an XMLList as it has a length() method - (not a length property)
    Also, loading an image for a book would be easy - you just grab the image property of the current book and then use a Loader to load it.
    trace(books[0].image);

  • Error With loading XML file.Help me

    Hi!
    I am trying to make an mp3 player for my web site but I am
    having a little problens and I hope you can help me out.
    It is a xml driven mp3player. I have a mp3player.as file and
    a songs.xml file. Inside my flash movie I only have #include
    "mp3player.as".
    Here is my mp3player.as code :
    [CODE]
    //Setup Sound Object
    var s :Sound = new Sound();
    s.onSoundComplete = playSong;
    s.setVolume(75);
    //Array of sounds
    var sa:Array = new Array();
    //Current Playing Song
    var cps : Number = -1;
    //Load the XML into a xml file
    var xml :XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
    var nodes : Array = this.firstChild.childNodes;
    for(var i=0;i<nodes.length;i++)
    sa.push(nodes
    .attributes.url);
    playSong();
    xml.load("mp3player.xml");
    // Play mp3 file
    function playSong() :Void
    if(cps == sa.length -1)
    cps = 0;
    s.loadSound(sa[cps],true);
    else
    s.loadSound(sa[++cps],true);
    [/CODE]
    And here is my songs.xml file :
    [CODE]
    <?xml version="1.0" encoding="UTF-8"?>
    <songs>
    <song url="music\setsite.mp3" />
    <song url="music\Soul Magic - Soul Magic.mp3" />
    <song url="music\Technotronic - NRG Flow.mp3" />
    </songs>
    [/CODE]
    Everytime I test my movie I have this msg :
    Error opening URL
    'file:///C|/Documents%20and%20Settings/Administrator/My%20Documents/Web%20Sites/site%20MA IO%202007/undefined'
    What is wrong with my code?
    When I comment this line xml.load("songs.xml") my movie runs
    fine.But I cant fix it..
    thank you

    Others here in the forums know more about the Sound class
    than I do... I haven't used it so much. You are using the
    'streaming' type of sound with the isStreaming flag set to true
    which means that it starts to play before its fully downloaded. So
    on a slow connection I presume it could play and stop in the same
    way that the timeline on a movie will pause playing if the rest of
    it has not downloaded yet.
    For a streaming sound, I guess you could get around this by
    implementing a partial preload by using s.stop() after issuing the
    s.loadSound command. Then do a "regular" preloader style checking
    s.getBytesLoaded vs. s.getBytesTotal ... to a percentage (you could
    even monitor the speed over 5-10 seconds to determine an
    appropriate level of buffering...maybe) and then use s.start()
    again.
    That's how I'd tackle it, but like I said others here know
    more about this, and perhaps they'll have better ideas. There
    appear to be some quirks with the Sound class based on comments in
    the flash 8 livedocs...

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

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

  • AS3/Flash Dev Teams: Help me fix Flash's Clipboard API on Linux!

    Hello!
    I am hoping to get in touch with the Adobe development team responsible for the ActionScript framework (for Flash Player, in particular).  I would really like to work with them to fix this bug (or, hell, attempt to fix it myself if they'd give me access to their source control):
       https://bugbase.adobe.com/index.cfm?event=bug&id=3482860
    Long-story-short:
    The "System Clipboard" API (plain text format only) from Flash 9 worked wonderfully cross-platform (Windows, MacOSX, Linux).
    However, the AS3 "Desktop Clipboard" API (plain text, HTML, RTF, and custom formats) introduced in Flash 10 has issues on Linux.  In particular, it only set contents into a particular 1 of Linux's (X's) 3 clipboard/selection buffers, which prevents Linux users from pasting the copied contents into a Terminal session. The "System Clipboard" API from Flash 9 does not suffer from this problem.  (More background details are available in the Adobe bug linked above as well as the GitHub bug linked below).
    This bug has downstream ramifications for a relatively popular open source library (e.g. used by GitHub.com and bit.ly) that I maintain called ZeroClipboard:
       https://github.com/jonrohan/ZeroClipboard/issues/78
    As such, I would very much like to see these issues resolved, and am willing to actively help if at all possible.
    If there is a better way to get in touch with the AS3/Flash Dev Teams than the bugbase or these forums (e.g. a team email address, particular dev's Twitter account, etc.), please let me know. Thank you in advance!
    P.S. Yes, I know that Linux is no longer officially supported by Flash Player but I also know that Linux users still manage to install the latest versions of Flash with a few workarounds.  It is also heavily used by GitHub.com users, and is therefore a high priority user base for ZeroClipboard.
    P.P.S. I also tried to get a contact via the various Adobe/Flash/Flex Twitter accounts without any success.
    Sincerely,
       James M. Greene

    Epic failure. Worked hard to contact Adobe devs and finally got through to the team via their OSS director.  End result: they'll only do for security patches for Linux, won't even consider other bug fixes.

  • 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

  • Precise bitrate of an mp3, Help required Please?

    Hello all
    i ve recently downloaded the trial of adobe audition on a firends reccomendation
    basically i have an mp3 here which is listed as a 192 now this is a podcast recording of a dj mix, but im certain the quality of this file isnt a 192 it sounds like a 96kbps to be honest
    i read somewhere a long time ago, that you can drop the mp3 into auditon and even though it is listed as a 192 in winamp/wmp etc audioin should give me the exact bitrare, regardless of what it listed as, (e.g was this a 96 and someone has conveted it to 192?)
    can anyone help me with this, how can i find/check this out in audition?
    regards
    thanks

    ceet12 wrote:
    basically i have an mp3 here which is listed as a 192 now this is a podcast recording of a dj mix, but im certain the quality of this file isnt a 192 it sounds like a 96kbps to be honest
    i read somewhere a long time ago, that you can drop the mp3 into auditon and even though it is listed as a 192 in winamp/wmp etc audioin should give me the exact bitrare, regardless of what it listed as, (e.g was this a 96 and someone has conveted it to 192?)
    If the quality of the source is lower than the quality that a particular format setting will support, then it won't sound as good as that, regardless. I don't know where you got the idea that Audition can, as if by magic, determine the previous bit rate of a re-encoded file but I can assure you that no software can do that, because that information simply isn't stored in the metadata.
    Not only that, but if you open an MP3 file in Audition, it's automatically converted to a wav file anyway. That's Audition's internal format, and the only way it's possible to open an MP3 in it. And if you resave it as an MP3, even at the same bitrate, it will be of lower quality - simply because it's been decoded and re-encoded and this isn't a lossless process. If you saved it as a higher bit rate file, then you'd still have the audio at the original decoded quality.
    Yet another problem is that you have no information at all about the original mix, or what its source files are, so even if it was recorded at a higher bit rate originally, it could still easily be flawed. For instance, if the mix was based on 128k MP3s to start with, and then podcast, re-recorded and re-opened, it would have been decoded enough times to have deteriorated significantly anyway.

Maybe you are looking for

  • Mail and Notes won't enable in Mavericks

    Ok so here's what happened. My "Send to iOS" in Maps wasn't showing up. So I followed the steps to get it to appear. I turned iCloud off and back on. After turning it back on I noticed my Mail and Notes were not activated. Mail tells me: "Your iCloud

  • FTP adapter pass file name to command

    I am executing a command after the reciever FTP adapter.  The filename that ftp-ed has a dynamic name and I need to execute the command against that file.  Is there a way I can pass that filename as a variable to the unix command.  I know how the UNI

  • Apple Preview: While moving/editing text boxes created by others in a PDF, font color of that text changes for some reason and I don't want it to!!

    I have a project where I've given about 10 people 50 PDF files each to mark up in red text, and send back to me.  When they send them back, I in turn need to move or edit some of the text boxes they have created in Apple Preview.  For about 8 of thes

  • ADVC-100 Capturing...

    Hello all, Yes, yes another question from Benny P. Now that I've finished my most recent project in the DV format, I am now swooped into my next project. This time using Analog footage (WHY?). I asked a question not too long ago and was told I needed

  • Problem about using JTextPane in JScrollPane

    I put a JTextPane in a JScrollPane. But when I reduce the window size of the JScrollPane with my mouse, the text line in the JTextPane is broken to newlines automatically due to the reduced window size. How to prevent the text lines breaking in this