13 Replies Latest reply on May 27, 2011 4:41 AM by Melas1976

    CDATA not appear

    melas076 Level 1

      Dear all,

       

      My xml file:

       

      <?xml version="1.0" encoding="utf-8"?>

       

      <home>
      <body>Integrated Systems Ltd., is a corporation organized under the Investment laws of Egypt with its registered number 38531, and having its registered office at 50, El-Hegaz Street, Heliopolis Square, Cairo –11351, Egypt.
      Since 1999, Commtech Integrated Systems Ltd. has started its activities in the Egyptian market through providing consultations for communication systems to highly ranked Egyptian governmental authorities.</body>
      </home>

       

      <Submenu Name="Company Profile" >
      <links name="Our Strategy">COMMTECH strategy aims at providing the Egyptian market with the State-of-The-Art technology solutions through the most trustful and reputable vendors and technology providers around the world.
      Our role is to provide new innovative communications and information technology solutions to enhance and develop Small and Medium Enterprises IT infrastructure network capabilities.
      We accomplish our strategy through delivering high quality, high reliable, effective and innovative solutions to our customers, while providing full technical support to our customers to control and manage their IT resources through integrating and standardizing several key components to enhance SME IT business processes.<![CDATA[<a href="pdf/Cartoon-Drawing-Secrets.pdf" target="_blank">Download PDF</a>]]></links>
      <links name="Our Vision">Our Vision</links>
      <links name="Our Mission">Our Mission</links>
      <links name="Our Commitment">Our Commitment</links>
      </Submenu>

       

      My AS :

       

      var newsXML:XML = new XML();
      newsXML.ignoreWhite = true;
      var output:String = "";

       

      newsXML.onLoad = function(success) {
          if (success) {
          for(var i:Number=0;i<newsXML.childNodes[1].childNodes.length;i++){
      var tlink:String = newsXML.childNodes[1].attributes.Name;
      var linkS:String = newsXML.childNodes[1].childNodes[i].attributes.name;
      var textS = newsXML.childNodes[1].childNodes[i].firstChild.nodeValue;

       

      _root.bg.txt.html = true;
      _root.sub_bg.subTXT.html = true;
      _root.sub_bg.subTXT.htmlText += "<a href='asfunction:linkF,"+textS+"'>"+linkS+"</a><br>";
      _root.sub_bg.linktitle.htmlText = tlink;
      trace(textS);
      }
          }
      }

       

      newsXML.load("XML/profile.xml");

       

      My problem is:

       

      when i load text it does'nt appear the "<![CDATA[<a href="pdf/Cartoon-Drawing-Secrets.pdf" target="_blank">Download PDF</a>]]>" in textfield.

       

      i appreciate your help.

       

      MELAS

        • 1. Re: CDATA not appear
          deepakflash

           

          var newsXML:XML = new XML();
          newsXML.ignoreWhite = true;
          var output:String = "";

          newsXML.onLoad = function(success) {
               if (success) {         

                    var tlink =  this.childNodes[1].attributes.Name;

                    trace(tlink); // Output: Company Profile
                    var nwsxml = this.childNodes[1].childNodes;
                    for (var i:Number = 0; i<nwsxml.length; i++) {
                         var linkS = nwsxml[i].attributes.name;
                         var textS = nwsxml[i].childNodes[1].nodeValue;
                         // Note: if you are not using CDATA for the remaining child nodes, then use:
                         // var textS = nwsxml[1].childNodes[1].nodeValue;
                         _root.bg.txt.html = true;
                         _root.sub_bg.subTXT.html = true;
                         _root.sub_bg.subTXT.htmlText += "<a href='asfunction:linkF,"+textS+"'>"+linkS+"</a><br>";
                         _root.sub_bg.linktitle.htmlText = tlink;
                         trace(textS);
                    }

               }
          };

          newsXML.load("XML/profile.xml");

           

          Trace Output for textS:

          <a href="pdf/Cartoon-Drawing-Secrets.pdf" target="_blank">Download PDF</a>

          • 2. Re: CDATA not appear
            melas076 Level 1

            i don't understand why did you change?

             

            i put my xml in the top of post......

             

            i tried your code it is not work .....

            when i click on submenu it doesnt change the text on the right mc with download pdf file which is in CDATA!!! doesn't appear!!!!

             

            i did the first cdata with <A href > just to test it but it will be in other "vision, mission,etc...."

             

            i hope you understand me!!!!

             

            regards,

            MELAS

            • 3. Re: CDATA not appear
              relaxatraja Level 5

              Your xml is not getting parsed, root should be one tag, change according to this.

               

              <?xml version="1.0" encoding="utf-8"?>

               

              <home>
              <body>Integrated Systems Ltd., is a corporation organized under the Investment laws of Egypt with its registered number 38531, and having its registered office at 50, El-Hegaz Street, Heliopolis Square, Cairo-11351, Egypt. Since 1999, Commtech Integrated Systems Ltd. has started its activities in the Egyptian market through providing consultations for communication systems to highly ranked Egyptian governmental authorities.
              </body>
              <Submenu Name="Company Profile" >
              <links name="Our Strategy">COMMTECH strategy aims at providing the Egyptian market with the State-of-The-Art technology solutions through the most trustful and reputable vendors and technology providers around the world. Our role is to provide new innovative communications and information technology solutions to enhance and develop Small and Medium Enterprises IT infrastructure network capabilities. We accomplish our strategy through delivering high quality, high reliable, effective and innovative solutions to our customers, while providing full technical support to our customers to control and manage their IT resources through integrating and standardizing several key components to enhance SME IT business processes.<![CDATA[<a href="pdf/Cartoon-Drawing-Secrets.pdf" target="_blank"><b>Download PDF</b></a>]]></links>
              <links name="Our Vision">Our Vision</links>
              <links name="Our Mission">Our Mission</links>
              <links name="Our Commitment">Our Commitment</links>
              </Submenu>
              </home>

               

              To test your xml, open it in the IE or firefox.

              1 person found this helpful
              • 4. Re: CDATA not appear
                melas076 Level 1

                i did but it is the same problem!!!!!

                 

                I can't see in flash the URL that i putted

                 

                regards,

                MELAS

                • 5. Re: CDATA not appear
                  melas076 Level 1

                  i tried to do this but unfortunatly the sublink doesn't appear at all.

                  when i trace, all things appear in ouput windows.....

                   

                  also it is online, kindly check it : www.it4net.net/test/

                   

                  let me know why?

                   

                  i appreciate your help,
                  MELAS

                   

                  this is my as code in the first frame :

                   

                  var newsXML:XML = new XML();
                  newsXML.ignoreWhite = true;
                  var output:String= "";

                   

                  newsXML.onLoad = function(success) {
                          if (success) {
                      for(var i:Number=0;i<newsXML.firstChild.childNodes[1].childNodes[0].childNodes.length;i++){
                  var tlink:String = newsXML.firstChild.childNodes[1].childNodes[0].attributes.Name;
                  var linkS:String = newsXML.firstChild.childNodes[1].childNodes[0].childNodes[i].attributes.Lname;
                  var textS1 = newsXML.childNodes[0].childNodes[1].childNodes[0].childNodes[i].firstChild.nodeValue;
                  var pdfS = newsXML.firstChild.childNodes[1].childNodes[0].childNodes[i].attributes.pdfs;
                  output += textS1;
                  output += "<a href='"+pdfS+"'>Download PDF</a>";
                  output += "\n";
                  var textS = output;
                  trace(textS);
                  _root.sub_bg.subTXT.htmlText = "<a href='asfunction:linkF,"+textS+"'>"+linkS+"</a><br>";
                  _root.sub_bg.linktitle.htmlText = tlink;

                   

                  }
                      }
                  }

                   

                  newsXML.load("xml/Profile.xml");

                   

                  also this is my xml changed:

                   

                  <?xml version="1.0" encoding="utf-8"?>
                  <content>
                  <Home>
                      <Body>Integrated Systems Ltd., is a corporation organized under the Investment laws of Egypt with its registered number 38531, and having its registered office at 50, El-Hegaz Street, Heliopolis Square, Cairo –11351, Egypt.
                  Since 1999, Commtech Integrated Systems Ltd. has started its activities in the Egyptian market through providing consultations for communication systems to highly ranked Egyptian governmental authorities.</Body>
                  </Home>
                  <Home2>
                  <Submenu Name="Company Profile">
                      <links Lname="Our Strategy" pdfs="pdf/pdf1.pdf">COMMTECH strategy aims at providing the Egyptian market with the State-of-The-Art technology solutions through the most trustful and reputable vendors and technology providers around the world.
                  Our role is to provide new innovative communications and information technology solutions to enhance and develop Small and Medium Enterprises IT infrastructure network capabilities.
                  We accomplish our strategy through delivering high quality, high reliable, effective and innovative solutions to our customers, while providing full technical support to our customers to control and manage their IT resources through integrating and standardizing several key components to enhance SME IT business processes.
                  </links>
                      <links Lname="Our Vision" pdfs="pdf/pdf2.pdf">Our Vision TEXT
                      </links>
                      <links Lname="Our Mission" pdfs="pdf/pdf3.pdf">Our Mission TEXT
                      </links>
                      <links Lname="Our Commitment" pdfs="pdf/pdf4.pdf">Our Commitment TEXT
                      </links>
                  </Submenu>
                  </Home2>
                  </content>

                  • 6. Re: CDATA not appear
                    relaxatraja Level 5

                    Is it possible to provide the link of your file?

                    • 7. Re: CDATA not appear
                      melas076 Level 1

                      which file? do you mean xml file?

                       

                      the path is www.it4net.net/test/xml/profile.xml

                       

                      regards,

                      MELAS

                      • 8. Re: CDATA not appear
                        relaxatraja Level 5

                        I meant your source file

                        • 9. Re: CDATA not appear
                          melas076 Level 1

                          of course, i uploaded for you.

                           

                          This is the url :www.it4net.net/test/test.rar

                           

                          thanks,

                          MELAS

                          • 10. Re: CDATA not appear
                            relaxatraja Level 5

                            The problem is over your formed output string. Dont use the tag inside the attribute. I changed the below code and its now listing the items.

                             

                            Comment this line 13:

                             

                            //output += "<a href='"+pdfS+"'>Download PDF</a>";

                             

                            Change the line according to this line 17:

                             

                            _root.sub_bg.subTXT.htmlText += "<a href='asfunction:linkF,"+textS+"'>"+linkS+"</a><br>";

                            1 person found this helpful
                            • 11. Re: CDATA not appear
                              Melas1976

                              i got a prblem with my account.

                               

                              so i tried to it but it doesn't work at all.....

                               

                              it appears just 1 sublink and where is others?

                               

                              also where is the link which i created for download pdf of each sublink clicked?

                               

                              I restored the code like before and doesn't appears just 1 toooo.... :@

                               

                               

                               

                              regards,

                              MELAS

                              • 12. Re: CDATA not appear
                                relaxatraja Level 5

                                The above solution will give 4 links on the screen, look into the following screenshot taken from mine

                                 

                                screenshot.JPG

                                • 13. Re: CDATA not appear
                                  Melas1976 Level 1

                                  ok i solved but i put <CDATA> in XMl File

                                   

                                  But i want to know how to do Css for this download pdf.

                                   

                                  i put the script and css unfortunatly it doesn't work

                                   

                                  many thank and regards,

                                  MELAS