Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   Общие вопросы о Flash (не затрагивающие ActionScript) (http://www.flasher.ru/forum/forumdisplay.php?f=60)
-   -   Откуда после тэга появляется запятая? [xml] (http://www.flasher.ru/forum/showthread.php?t=69388)

mixey_lv 20.09.2005 21:55

Откуда после тэга появляется запятая? [xml]
 
Вложений: 1
Есть xml файл:
Код:

<gal_element name="button_name" button="gallery_pictures/buttons/2_but.jpg">
        <sub_element big_pic="gallery_pictures/pictures/cookinlet.jpg" thumbnail="gallery_pictures/thumbnails/cookinletpreview.jpg"><b> Welcome to Macromedia Flash MX 2004 and Macromedia Flash MX </b> Professional 2004. Flash provides everything you need to create and deliver rich web content and powerful applications. Whether you're designing motion graphics or building data-driven applications, Flash has the tools necessary to produce great results and deliver the best user experience across multiple platforms and devices.</sub_element>

Парсю:
Код:

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.load("gallery_pictures/r4.xml");
xmlData.onLoad = obrabotka_xml;
function obrabotka_xml(success) {
        if (success) {
                xmlNode = xmlData;
                total = xmlNode.childNodes.length;
                trace(xmlNode.childNodes[0].childNodes[0].childNodes.toString());
        } else {
                trace("File not found!");
        }
}

А trace мне выдаёт:
Цитата:

<b> Welcome to Macromedia Flash MX 2004 and Macromedia Flash MX </b>, Professional 2004. Flash provides everything you need to create and deliver rich web content and powerful applications. Whether you&apos;re designing motion graphics or building data-driven applications, Flash has the tools necessary to produce great results and deliver the best user experience across multiple platforms and devices.
Откуда эта запятая??? Как её убрать? Чудеса какие-то :)

iNils 21.09.2005 02:02

В данном случаи у тебя идет перечисление нодов, а перечисляются они через запятую.

mixey_lv 21.09.2005 02:31

А как тогда достучаться именно до того нода? Чтобы получить его значение со всеми внутренними тэгами? Вообщем также, но без этих запятых после закрытия тэга
*help*

7thsky™ 21.09.2005 02:42

<sub_element big_pic="gallery_pictures/pictures/cookinlet.jpg" thumbnail="gallery_pictures/thumbnails/cookinletpreview.jpg"><![CDATA[<b> Welcome to Macromedia Flash MX 2004 and Macromedia Flash MX </b> Professional 2004. Flash provides everything you need to create and deliver rich web content and powerful applications. Whether you're designing motion graphics or building data-driven applications, Flash has the tools necessary to produce great results and deliver the best user experience across multiple platforms and devices.]]></sub_element>

iNils 21.09.2005 02:53

// мой пример
xmlData = new XML ('<sub_element><![CDATA[<b>1</b>2<b>3</b>]]></sub_element>');
xmlData.ignoreWhite = true;
xmlNode = xmlData;
total = xmlNode.childNodes.length;
_root.createTextField ("txt", 0, 0, 0, 200, 50);
txt.html = true;
txt.htmlText = xmlNode.childNodes[0].childNodes[0].nodeValue;
// твой пример
xmlData2 = new XML ('<sub_element><b>1</b>2<b>3</b></sub_element>');
xmlData2.ignoreWhite = true;
xmlNode2 = xmlData2;
total = xmlNode2.childNodes.length;
_root.createTextField ("txt2", 1, 0, 100, 200, 50);
txt2.html = true;
txt2.htmlText = xmlNode2.childNodes[0].childNodes;

mixey_lv 21.09.2005 13:15

Спасибо ребята! С вашей помощью всё получилось!
пасиб!


Часовой пояс GMT +4, время: 21:17.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.