-
1. Re: CDATA not appear
deepakflash May 24, 2011 9:49 AM (in response to melas076)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 May 24, 2011 11:49 AM (in response to deepakflash)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 May 25, 2011 12:18 AM (in response to melas076)1 person found this helpfulYour 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.
-
4. Re: CDATA not appear
melas076 May 25, 2011 1:24 AM (in response to relaxatraja)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 May 25, 2011 5:02 AM (in response to melas076)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,
MELASthis 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 May 25, 2011 11:26 PM (in response to melas076)Is it possible to provide the link of your file?
-
7. Re: CDATA not appear
melas076 May 26, 2011 12:47 AM (in response to relaxatraja)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 May 26, 2011 2:22 AM (in response to melas076)I meant your source file
-
9. Re: CDATA not appear
melas076 May 26, 2011 4:05 AM (in response to relaxatraja)of course, i uploaded for you.
This is the url :www.it4net.net/test/test.rar
thanks,
MELAS
-
10. Re: CDATA not appear
relaxatraja May 26, 2011 6:34 AM (in response to melas076)1 person found this helpfulThe 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>";
-
11. Re: CDATA not appear
Melas1976 May 27, 2011 4:07 AM (in response to relaxatraja)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
-
-
13. Re: CDATA not appear
Melas1976 May 27, 2011 4:41 AM (in response to relaxatraja)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