Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Jdom

  1. #1

    Jdom

    Ciao a tutti

    ho un banale quesito:

    ho un tag xml di questo tipo:

    <xqueryfunction xsi:type="compositionLanguage:isEndpoint_inBlackLi st" logicalOperator="or"/>


    Con Jdom vorrei ottenere il valore del campo "xsi:type". Come faccio???

    ho provato con Element.getAttributeValue("xsi:type") ma la risposta è null.
    Questo perchè quello non è un normale attributo....

    sapete aiutermi??? grazie...

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

    Re: Jdom

    Originariamente inviato da mestablesta
    ho provato con Element.getAttributeValue("xsi:type") ma la risposta è null.
    Questo perchè quello non è un normale attributo....
    Vedi l'altro getAttributeValue(), quello che riceve un Namespace.
    Andrea, andbin.devSenior Java developerSCJP 5 (91%) • SCWCD 5 (94%)
    java.util.function Interfaces Cheat SheetJava Versions Cheat Sheet

  3. #3
    ho provato senza risultati:

    ecco cosa ho fatto:

    mi son fatto dare il namespace:
    Namespace ns= currentXqueryFunctionElement.getNamespace();

    poi ho chiamato

    System.out.println(currentXqueryFunctionElement.ge tAttributeValue("xsi", ns));

    ha stampato null... è corretto quello che ho fatto?

    forse nel metodo devo specificare altro rispetto a "xsi" ??

  4. #4
    Utente di HTML.it L'avatar di andbin
    Registrato dal
    Jan 2006
    residenza
    Italy
    Messaggi
    18,284
    Namespace ns = Namespace.getNamespace("xsi", "....uri di xsi.....");

    Poi .... getAttributeValue("type", ns)
    Andrea, andbin.devSenior Java developerSCJP 5 (91%) • SCWCD 5 (94%)
    java.util.function Interfaces Cheat SheetJava Versions Cheat Sheet

  5. #5
    si funziona come hai detto tu!!

    grazie 1000

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.