Visualizzazione dei risultati da 1 a 9 su 9
  1. #1
    Utente di HTML.it L'avatar di arn
    Registrato dal
    Jun 2002
    Messaggi
    420

    XML attivare i tag html

    Problema : abilitare i tag per i link !!!
    Visualizzo solo :24/10/2004 Questo è un
    ... e le successive news.
    ..Ma come inserisco i link ???


    //file XML:
    <?xml version='1.0'?>
    <newsblock>
    <news date='24/10/2004'>Questo è un <u>collegamento</u> e quello qui sotto è altro bla bla bla...Nuovo sistema di news tramite l'uso di file XML esterno.Il tutto è realizzato tramite un components realizzato con FlashMX, che permette la gestione di news in maniera semplice e facilmente gestibile.
    </news>
    </newsblock>
    //-----------------------------------
    // codice su MC:
    function newsBlock() {
    _global.ref = this;
    this.init();
    }
    newsBlock.prototype = new MovieClip();
    Object.registerClass("newsBlock", newsBlock);
    // init
    newsBlock.prototype.init = function() {
    ref._x = Math.round(ref._x);
    ref._y = Math.round(ref._y);
    ref.componentWidth = ref._width;
    ref.componentHeight = ref._height;
    ref._xscale = ref._yscale=100;
    ref.boundingBox_mc._visible = false;
    ref.add_borders();
    ref.attachMovie("textBlock_mc", "textBlock_mc", 5);
    ref.textBlock_mc.news_txt.html = true;//<------è settato !!!
    ref.textBlock_mc.news_txt.selectable = ref.t_select;
    ref.textBlock_mc.news_txt.textColor = this.t_color.toString(16);
    ref.textBlock_mc.news_txt.text = "loading XML data";
    ref.setSize(ref.componentWidth, ref.componentHeight);
    //
    // ----------
    var newsXML = new XML(this);
    newsXML.ignoreWhite = true;
    newsXML.onLoad = function(success) {
    if (success) {
    if (this.loaded && this.hasChildNodes) {
    ref.news_content = new Array();
    ref.news_date = new Array();
    if (this.firstChild.nodeName.toLowerCase() == "newsblock") {
    var nm = this.firstChild.childNodes;
    for (var i = 0; i<=nm.length; i++) {
    if (nm[i].nodeName == "news") {
    ref.news_date.push(nm[i].attributes.date);
    ref.news_content.push(nm[i].firstChild.nodeValue);
    }
    }
    }
    }
    ref.show_news2();
    }
    };
    newsXML.load("mio_file.xml");
    };
    newsBlock.prototype.add_borders = function() {
    this.attachMovie("border_up", "border_up", 1);
    this.attachMovie("border_down", "border_down", 2);
    this.attachMovie("border_left", "border_left", 3);
    this.attachMovie("border_right", "border_right", 4);
    };
    newsBlock.prototype.show_news = function(n) {
    ref.textBlock_mc.news_txt.htmlText = "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_d ate[n]+"</FONT>"+"
    "+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_c ontent[n]+"</FONT>"+"
    <A HREF=\"asfunction:ref.show_news2,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'><u>Torna alle news >>></u></FONT></A>

    ";
    };
    newsBlock.prototype.show_news2 = function() {
    var cnt = ref.news_content.length;
    ref.textBlock_mc.news_txt.text = "";
    if (!ref.sf_news) {
    for (var i = 0; i<cnt; i++) {
    ref.textBlock_mc.news_txt.htmlText += "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_d ate[i]+"</FONT>"+"
    "+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_c ontent[i].substring(0, ref.n_symbol)+"</FONT>"+"...
    <A HREF=\"asfunction:ref.show_news,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'>"+"<u>contin ua >>></u></FONT></A>

    ";
    }
    } else {
    for (var i = 0; i<cnt; i++) {
    ref.textBlock_mc.news_txt.htmlText += "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_d ate[i]+"</FONT>"+"
    "+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_c ontent[i]+"<FONT COLOR='#"+ref.l_color.toString(16)+"'></FONT>

    ";
    }
    }
    };

    La rapidità che è una virtù, genera un vizio che è la fretta !
    -------------------------
    Browser: Opera & Firefox

  2. #2
    non puoi usare il < e > in un file xml se non per i tag. Quindi usa i rispettivi codici html, ossia &lt; &gt;

    regalami un oggi da favola...e il domani bhe!?non mi importa se tu 6 con me! ©Ily

  3. #3
    Utente di HTML.it L'avatar di arn
    Registrato dal
    Jun 2002
    Messaggi
    420
    :master:
    potresti essere chiaro..non ho capito come devo impostarli?
    La rapidità che è una virtù, genera un vizio che è la fretta !
    -------------------------
    Browser: Opera & Firefox

  4. #4
    Utente di HTML.it L'avatar di arn
    Registrato dal
    Jun 2002
    Messaggi
    420
    miii è proprio vero...la notte porta consiglio !
    adesso ho capito cosa intendevi...
    sorry

    adesso provo , grazie...poi vi faccio sapere se funzia !
    La rapidità che è una virtù, genera un vizio che è la fretta !
    -------------------------
    Browser: Opera & Firefox

  5. #5
    Utente di HTML.it L'avatar di arn
    Registrato dal
    Jun 2002
    Messaggi
    420

    non va ! nemmeno cosi :

    &lt , &lg vengono letti = &lt , &lg .

    mentre se metto < , il testo viene interrotto ! e non legge quello messo dopo !

    non riesco a capire perchè non considera il testo come HTML !!!
    La rapidità che è una virtù, genera un vizio che è la fretta !
    -------------------------
    Browser: Opera & Firefox

  6. #6
    magari fatti un giro nel forum di xml (purtroppo la ricerca non funziona)

    regalami un oggi da favola...e il domani bhe!?non mi importa se tu 6 con me! ©Ily

  7. #7
    Bisogna che tu costruisca bene la stringa contenente l'url. Ed eventualmente usare delle entity (link utile: Traduzione di tutte le entity).

    Cmq prova a dare uno sguardo all'esempio relativo all'Inclusione di più documenti XML presente sul sito di HTML.it forse riuscirari da solo a trovare la soluzione!




    PS: x una maggiore leggibilità del codice usa il tasto CODE quando scrivi un post!
    My space! Voglio Arthur!!!
    Ho fatto strike!!!
    dotty78

    Prima di postare in “XML, XSL, Smil” dai uno sguardo ai Link utili!

  8. #8
    Utente di HTML.it L'avatar di arn
    Registrato dal
    Jun 2002
    Messaggi
    420
    grazie raga ...vado a leggere,
    vediamo come va...
    PS-tenete le dita incrociate !
    La rapidità che è una virtù, genera un vizio che è la fretta !
    -------------------------
    Browser: Opera & Firefox

  9. #9
    Utente di HTML.it L'avatar di arn
    Registrato dal
    Jun 2002
    Messaggi
    420
    Ho provato anche con CDATA , ma nisba !

    La rapidità che è una virtù, genera un vizio che è la fretta !
    -------------------------
    Browser: Opera & Firefox

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.