Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    simulare struttura XML in sqlite

    ciao, mi trovo nella neccessità di simulare una struttura gerarchica di un file XML in un DB di sqlite, questo è un file di esmepio,utile solo per capirne la struttura :
    codice:
    <?xml version="1.0" encoding="utf-8"?>
    <type>
        <input type="number_digit">
            <portrait>
                <touch_mask touch="1">
                    <comment>PORTRAIT configuration 1 touch - SMALL  SCREEN [4in] - NUMBER</comment>
                </touch_mask>
                ... to 10 element
            </portrait>
            <landscape>
                <touch_mask touch="1">
                    <comment>LANDSCAPE configuration 1 touch - SMALL  SCREEN [4in] - NUMBER</comment>
                </touch_mask>
                ... to 10 element
            </landscape>
        </input>
        <input type="text">
            <portrait>
                <touch_mask touch="1">
                    <comment>PORTRAIT configuration 1 touch - SMALL  SCREEN [4in] - TEXT</comment>
                </touch_mask>
                ... to 10 element
            </portrait>
            <landscape>
                <touch_mask touch="1">
                    <comment>LANDSCAPE configuration 1 touch - SMALL  SCREEN [4in] - TEXT</comment>
                </touch_mask>
                ... to 10 element
            </landscape>
        </input>
        <input type="phone">
            <portrait>
                <touch_mask touch="1">
                    <comment>PORTRAIT configuration 1 touch - SMALL  SCREEN [4in] - </comment>
                </touch_mask>
                ... to 10 element
            </portrait>
            <landscape>
                <touch_mask touch="1">
                    <comment>LANDSCAPE configuration 1 touch - SMALL  SCREEN [4in] - </comment>
                </touch_mask>
                ... to 10 element
            </landscape>
        </input>
        <input type="password">
            <portrait>
                <touch_mask touch="1">
                    <comment>PORTRAIT configuration 1 touch - SMALL  SCREEN [4in] - PASSWORD</comment>
                </touch_mask>
                ... to 10 element
            </portrait>
            <landscape>
                <touch_mask touch="1">
                    <comment>LANDSCAPE configuration 1 touch - SMALL  SCREEN [4in] - PASSWORD</comment>
                </touch_mask>
                ... to 10 element
            </landscape>
        </input>
        <input type="andress">
            <portrait>
                <touch_mask touch="1">
                    <comment>PORTRAIT configuration 1 touch - SMALL  SCREEN [4in] - ANDRESS</comment>
                </touch_mask>
                ... to 10 element
            </portrait>
            <landscape>
                <touch_mask touch="1">
                    <comment>LANDSCAPE configuration 1 touch - SMALL  SCREEN [4in] - ANDRESS</comment>
                </touch_mask>
                ... to 10 element
            </landscape>
        </input>
    </type>
    il problema è che non so esattamente come mi conviene organizzare il DB, creo una tabella per ogni tipo di oggetto e poi includo degli indici per i vari figli?
    creo una tabella touch_mask, oggetto che desidero estrarre dal DB tramite query, con specificati al suo interno dei campi che mi determinano le carrateristiche descritte dai genitori(input type,landscape/portrait,touch number)?
    voi come affrontereste questo problema? thx

  2. #2
    Poison,

    se il contenuto del file XML lo devi solo memorizzare e restituire, io lo salverei in un BLOB/CLOB. Per quanto mi riguarda lo schema del db e` perfettamente normalizzato

    Altrimenti, dipende dallo schema del file XML. Per esempio se hai una struttura rigida, puoi pensare di fare una conversione dall' XML ad uno schema relazionale. A

    lcuni DBMS supportano XML come tipo nativo, e.g. IBM DB2, SQL server.

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 © 2024 vBulletin Solutions, Inc. All rights reserved.