Results 1 to 7 of 7

Thread: XML e XSD

  1. #1
    Lieutenant Commander Warbarbie's Avatar
    Join Date
    Nov 2004
    Location
    Rome
    Posts
    16.296

    Default XML e XSD

    Qualcuno che ne sa qualcosa?
    Ho generato un xml, all'inizio dell' XML c'è un dataroot penso da parametrizzare per fargli prendere in qualche modo l'xsd.
    qualcuno ne sa qualcosa così al massimo spiego meglio?


  2. #2
    Lieutenant
    Join Date
    Jan 2007
    Location
    Roma
    Posts
    4.723

    Default

    si ma non ho capito la domanda

    Last Exile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unknowns
    Nuida FollettoInLutto Bard Tiarna . . . . . . . . . . . . . . . . Deo The Undaunted Rune Priest
    Amiag Blademaster Silver Hand. . . . . . . . . . . . . . Viol The Sacrificed Shadow Warrior
    Viola Vampiir Grove Protector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Nero Incubus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DarkBane
    Naida Cabalist Phoenix Knight. . . . . . . . . . . . . . . . . . . . . . . . . . . . Viole No-Stealth Scout

  3. #3
    Lieutenant Commander Warbarbie's Avatar
    Join Date
    Nov 2004
    Location
    Rome
    Posts
    16.296

    Default

    Ok ora la butto giu meglio, mi scappa il cagotto ora


  4. #4
    Lieutenant Commander Warbarbie's Avatar
    Join Date
    Nov 2004
    Location
    Rome
    Posts
    16.296

    Default

    Allora, ho creato il mio XML.
    All'inizio del suddetto ci sta :

    - <dataroot>
    - <REGIONE cod_reg="120">
    - <AS cod_as="120921">
    - <OPERAZIONE tipo_op="I">
    - <CONTRATTO num_contr="PROT. 11715/2010" tipo_contr="CA" durata_contr="12" forma_neg="AE" amb_val="4" anno="2010" mese="12" giorno="24">

    eccetera eccetera


    Sul dataroot immagino ci vada in qualche maniera il path dell'xsd(su altri xml gia fatto ho letto che ci sta l'xmlns, che non so cosa cazzo sia)


  5. #5
    Lieutenant
    Join Date
    Jan 2007
    Location
    Roma
    Posts
    4.723

    Default

    xmlns sta per xml NameSpace ed è il namespace, lo schema lo indichi con l'attributo schemaLocation. Nello schemaLocation ci va <namespace> <pathdelXSD>

    tipo

    <dataroot xmlns="http://www.springframework.org/schema/beans"

    schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd"

    >
    o se non hai un namespace solo l'xsd

    <dataroot

    schemaLocation=" http://www.springframework.org/schema/beans/spring-beans.xsd"

    >

    Last Exile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unknowns
    Nuida FollettoInLutto Bard Tiarna . . . . . . . . . . . . . . . . Deo The Undaunted Rune Priest
    Amiag Blademaster Silver Hand. . . . . . . . . . . . . . Viol The Sacrificed Shadow Warrior
    Viola Vampiir Grove Protector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Nero Incubus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DarkBane
    Naida Cabalist Phoenix Knight. . . . . . . . . . . . . . . . . . . . . . . . . . . . Viole No-Stealth Scout

  6. #6
    Lieutenant Commander Warbarbie's Avatar
    Join Date
    Nov 2004
    Location
    Rome
    Posts
    16.296

    Default

    Ok sono riuscito a parametrizzarlo.
    Ora manca solo xmlns:xsi

    Che è sto xsi?


  7. #7
    Lieutenant
    Join Date
    Jan 2007
    Location
    Roma
    Posts
    4.723

    Default

    dovrebbe essere il namespace che contiene la roba per la definizione degli xsd ma non so sicuro ...
    comunque fai prima a cercarti na guida che ad andare a tentativi

    o a copia incollare da un altro xml


    tipo cosi :

    <dataroot
    xmlns="tuo namespace"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="namespaceXSD locazioneXSD">
    Last edited by Amiag; 10th February 2011 at 21:24.

    Last Exile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unknowns
    Nuida FollettoInLutto Bard Tiarna . . . . . . . . . . . . . . . . Deo The Undaunted Rune Priest
    Amiag Blademaster Silver Hand. . . . . . . . . . . . . . Viol The Sacrificed Shadow Warrior
    Viola Vampiir Grove Protector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Nero Incubus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DarkBane
    Naida Cabalist Phoenix Knight. . . . . . . . . . . . . . . . . . . . . . . . . . . . Viole No-Stealth Scout

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[Output: 63.07 Kb. compressed to 53.43 Kb. by saving 9.64 Kb. (15.28%)]