Visualizzazione dei risultati da 1 a 5 su 5

Discussione: OMElement da leggere

  1. #1

    OMElement da leggere

    ho un eggetto OMElement

    se faccio il toString() ottengo una stringa che contiene tra l'altro un
    nodo così:
    <t: DS>blah blah blah</t: DS>

    come recupero il valore "blah blah blah"?
    io ho usato dei metodi sulle stringhe (substring ecc.) ma non c'è una
    maniera per scansionare l'OMElement direttamente?

    grazie

  2. #2
    Utente di HTML.it L'avatar di andbin
    Registrato dal
    Jan 2006
    residenza
    Italy
    Messaggi
    18,284

    Re: OMElement da leggere

    Originariamente inviato da MyBloodyV.
    maniera per scansionare l'OMElement direttamente?
    Non ho la minima idea di cosa sia questo tipo OMElement ..... non è di certo del framework standard. Precisa quale framework/libreria stai usando .... e si può vedere (e forse avresti potuto vederlo già tu guardando sul javadoc, se disponibile).

    E comunque "estrarre" qualcosa da una stringa fornita da toString() è "brutto".
    Andrea, andbin.devSenior Java developerSCJP 5 (91%) • SCWCD 5 (94%)
    java.util.function Interfaces Cheat SheetJava Versions Cheat Sheet

  3. #3

  4. #4
    Utente di HTML.it L'avatar di andbin
    Registrato dal
    Jan 2006
    residenza
    Italy
    Messaggi
    18,284
    Originariamente inviato da MyBloodyV.
    http://ws.apache.org/commons/axiom/a...OMElement.html

    <t: DS>blah blah blah</t: DS>

    come recupero il valore "blah blah blah"?
    Perfetto ... pur non conoscendo quella libreria .... sparo? Vedo che quella classe ha un getText().
    Andrea, andbin.devSenior Java developerSCJP 5 (91%) • SCWCD 5 (94%)
    java.util.function Interfaces Cheat SheetJava Versions Cheat Sheet

  5. #5
    This method iterates over all the text children of the element and concatenates them to a single string. Only direct children will be considered, i.e. the text is not extracted recursively. For example the return value for <element>A<child>B</child>C</element> will be AC.

    siam sempre lì

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.