Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

XQUERY/SGBD XML Discussion :

xquery collection


Sujet :

XQUERY/SGBD XML

  1. #1
    Membre du Club
    xquery collection
    Bonjour à tous,

    Je fais mon premier projet en Xquery et je peine à trouver de la documentation…
    J'utilise la nouvelle version 2.0 de exist et la version 3.0 de xquery…

    Mon problème est le suivant:
    Si je mets les "" ma requête ne fonctionne pas alors que la fonction collection prend une String…?

    De plus si quelqu'un à un tutoriel je suis preneur

    Merci beaucoup à tous.
    Très bonne journée et meilleures salutations.

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
     
    xquery version "3.0";
     
    <XQueryResults>
    {
     
        let $myCollection := collection(/db/hebdo2005/contents.xml)
        for $titre at $pos in $myCollection/article/titraille/titreCible
        return
        <titre n="{$pos}">
    {
        data($titre)
    }
        </titre>
    }
    </XQueryResults>

  2. #2
    Membre émérite
    Si je mets les "" ma requête ne fonctionne pas alors que la fonction collection prend une String…?
    Soit. Mais faut-il d'abord clarifier c'est quoi contents.xml? Si ce n'est pas une sous-collection et est plutôt un fichier, ça ne macherait pas comme ça.

  3. #3
    Membre du Club
    contenut content.xml
    Merci pour ta réponse… le fichier content.xml contient une collection xml selon moi (je suis débutant en xml).

    Si tu as une idée c'est avec plaisir

    Très bonne journée et meilleures salutations.
    Merci encore à tous

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
     
    <?xml version="1.0" encoding="UTF-8"?>
    <collection xmlns="http://exist.sourceforge.net/NS/exist" name="/db/data/hebdo2005" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:19+01:00" version="1">
        <resource type="XMLResource" name="HBv0501_NF2005011000054_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:19+01:00" modified="2008-01-30T10:12:19+01:00" filename="HBv0501_NF2005011000054_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_NF2005011000055_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_NF2005011000055_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_NF2005011000060_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_NF2005011000060_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_NF2005011100042_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_NF2005011100042_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_NF2005011100043_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_NF2005011100043_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602820_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_OI2005010602820_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602821_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_OI2005010602821_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602822_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_OI2005010602822_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602823_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:20+01:00" modified="2008-01-30T10:12:20+01:00" filename="HBv0501_OI2005010602823_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602824_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:21+01:00" modified="2008-01-30T10:12:21+01:00" filename="HBv0501_OI2005010602824_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602825_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:21+01:00" modified="2008-01-30T10:12:21+01:00" filename="HBv0501_OI2005010602825_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602826_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:21+01:00" modified="2008-01-30T10:12:21+01:00" filename="HBv0501_OI2005010602826_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602827_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:22+01:00" modified="2008-01-30T10:12:22+01:00" filename="HBv0501_OI2005010602827_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602828_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:22+01:00" modified="2008-01-30T10:12:22+01:00" filename="HBv0501_OI2005010602828_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602829_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:22+01:00" modified="2008-01-30T10:12:22+01:00" filename="HBv0501_OI2005010602829_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602830_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:22+01:00" modified="2008-01-30T10:12:22+01:00" filename="HBv0501_OI2005010602830_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602832_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:22+01:00" modified="2008-01-30T10:12:22+01:00" filename="HBv0501_OI2005010602832_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602833_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:22+01:00" modified="2008-01-30T10:12:22+01:00" filename="HBv0501_OI2005010602833_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602834_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:23+01:00" modified="2008-01-30T10:12:23+01:00" filename="HBv0501_OI2005010602834_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602870_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:23+01:00" modified="2008-01-30T10:12:23+01:00" filename="HBv0501_OI2005010602870_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602871_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:24+01:00" modified="2008-01-30T10:12:24+01:00" filename="HBv0501_OI2005010602871_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602872_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:24+01:00" modified="2008-01-30T10:12:24+01:00" filename="HBv0501_OI2005010602872_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602873_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:24+01:00" modified="2008-01-30T10:12:24+01:00" filename="HBv0501_OI2005010602873_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602874_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:24+01:00" modified="2008-01-30T10:12:24+01:00" filename="HBv0501_OI2005010602874_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602875_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:25+01:00" modified="2008-01-30T10:12:25+01:00" filename="HBv0501_OI2005010602875_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602876_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:25+01:00" modified="2008-01-30T10:12:25+01:00" filename="HBv0501_OI2005010602876_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602877_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:25+01:00" modified="2008-01-30T10:12:25+01:00" filename="HBv0501_OI2005010602877_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602879_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:26+01:00" modified="2008-01-30T10:12:26+01:00" filename="HBv0501_OI2005010602879_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602880_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:26+01:00" modified="2008-01-30T10:12:26+01:00" filename="HBv0501_OI2005010602880_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602881_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:26+01:00" modified="2008-01-30T10:12:26+01:00" filename="HBv0501_OI2005010602881_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602882_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:27+01:00" modified="2008-01-30T10:12:27+01:00" filename="HBv0501_OI2005010602882_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602883_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:27+01:00" modified="2008-01-30T10:12:27+01:00" filename="HBv0501_OI2005010602883_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602884_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:27+01:00" modified="2008-01-30T10:12:27+01:00" filename="HBv0501_OI2005010602884_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602885_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:27+01:00" modified="2008-01-30T10:12:27+01:00" filename="HBv0501_OI2005010602885_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602886_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:27+01:00" modified="2008-01-30T10:12:27+01:00" filename="HBv0501_OI2005010602886_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010602887_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:27+01:00" modified="2008-01-30T10:12:27+01:00" filename="HBv0501_OI2005010602887_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603026_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:28+01:00" modified="2008-01-30T10:12:28+01:00" filename="HBv0501_OI2005010603026_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603027_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:28+01:00" modified="2008-01-30T10:12:28+01:00" filename="HBv0501_OI2005010603027_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603028_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:28+01:00" modified="2008-01-30T10:12:28+01:00" filename="HBv0501_OI2005010603028_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603029_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:28+01:00" modified="2008-01-30T10:12:28+01:00" filename="HBv0501_OI2005010603029_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603030_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:28+01:00" modified="2008-01-30T10:12:28+01:00" filename="HBv0501_OI2005010603030_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603031_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:28+01:00" modified="2008-01-30T10:12:28+01:00" filename="HBv0501_OI2005010603031_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603032_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:28+01:00" modified="2008-01-30T10:12:28+01:00" filename="HBv0501_OI2005010603032_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603033_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:29+01:00" modified="2008-01-30T10:12:29+01:00" filename="HBv0501_OI2005010603033_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603034_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:29+01:00" modified="2008-01-30T10:12:29+01:00" filename="HBv0501_OI2005010603034_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603035_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:29+01:00" modified="2008-01-30T10:12:29+01:00" filename="HBv0501_OI2005010603035_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603036_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:29+01:00" modified="2008-01-30T10:12:29+01:00" filename="HBv0501_OI2005010603036_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603037_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:29+01:00" modified="2008-01-30T10:12:29+01:00" filename="HBv0501_OI2005010603037_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0501_OI2005010603038_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:29+01:00" modified="2008-01-30T10:12:29+01:00" filename="HBv0501_OI2005010603038_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304294_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:29+01:00" modified="2008-01-30T10:12:29+01:00" filename="HBv0502_OI2005011304294_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304295_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:30+01:00" modified="2008-01-30T10:12:30+01:00" filename="HBv0502_OI2005011304295_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304296_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:30+01:00" modified="2008-01-30T10:12:30+01:00" filename="HBv0502_OI2005011304296_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304297_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:30+01:00" modified="2008-01-30T10:12:30+01:00" filename="HBv0502_OI2005011304297_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304298_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:30+01:00" modified="2008-01-30T10:12:30+01:00" filename="HBv0502_OI2005011304298_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304299_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:30+01:00" modified="2008-01-30T10:12:30+01:00" filename="HBv0502_OI2005011304299_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304300_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:30+01:00" modified="2008-01-30T10:12:30+01:00" filename="HBv0502_OI2005011304300_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304301_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:30+01:00" modified="2008-01-30T10:12:30+01:00" filename="HBv0502_OI2005011304301_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304302_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:31+01:00" modified="2008-01-30T10:12:31+01:00" filename="HBv0502_OI2005011304302_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304303_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:31+01:00" modified="2008-01-30T10:12:31+01:00" filename="HBv0502_OI2005011304303_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304304_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:31+01:00" modified="2008-01-30T10:12:31+01:00" filename="HBv0502_OI2005011304304_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304305_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:31+01:00" modified="2008-01-30T10:12:31+01:00" filename="HBv0502_OI2005011304305_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304306_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:31+01:00" modified="2008-01-30T10:12:31+01:00" filename="HBv0502_OI2005011304306_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304307_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:31+01:00" modified="2008-01-30T10:12:31+01:00" filename="HBv0502_OI2005011304307_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304308_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:31+01:00" modified="2008-01-30T10:12:31+01:00" filename="HBv0502_OI2005011304308_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304309_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:32+01:00" modified="2008-01-30T10:12:32+01:00" filename="HBv0502_OI2005011304309_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304310_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:32+01:00" modified="2008-01-30T10:12:32+01:00" filename="HBv0502_OI2005011304310_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304311_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:32+01:00" modified="2008-01-30T10:12:32+01:00" filename="HBv0502_OI2005011304311_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304312_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:32+01:00" modified="2008-01-30T10:12:32+01:00" filename="HBv0502_OI2005011304312_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304313_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:32+01:00" modified="2008-01-30T10:12:32+01:00" filename="HBv0502_OI2005011304313_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304314_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:32+01:00" modified="2008-01-30T10:12:32+01:00" filename="HBv0502_OI2005011304314_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304422_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:32+01:00" modified="2008-01-30T10:12:32+01:00" filename="HBv0502_OI2005011304422_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304423_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:33+01:00" modified="2008-01-30T10:12:33+01:00" filename="HBv0502_OI2005011304423_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304424_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:33+01:00" modified="2008-01-30T10:12:33+01:00" filename="HBv0502_OI2005011304424_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304425_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:33+01:00" modified="2008-01-30T10:12:33+01:00" filename="HBv0502_OI2005011304425_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304426_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:33+01:00" modified="2008-01-30T10:12:33+01:00" filename="HBv0502_OI2005011304426_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304427_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:33+01:00" modified="2008-01-30T10:12:33+01:00" filename="HBv0502_OI2005011304427_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304428_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:33+01:00" modified="2008-01-30T10:12:33+01:00" filename="HBv0502_OI2005011304428_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304429_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:33+01:00" modified="2008-01-30T10:12:33+01:00" filename="HBv0502_OI2005011304429_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304430_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0502_OI2005011304430_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304431_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0502_OI2005011304431_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304432_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0502_OI2005011304432_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304433_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0502_OI2005011304433_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304434_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0502_OI2005011304434_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304435_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0502_OI2005011304435_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0502_OI2005011304436_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0502_OI2005011304436_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0503_NF2005012000023_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:34+01:00" modified="2008-01-30T10:12:34+01:00" filename="HBv0503_NF2005012000023_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0503_NF2005012000030_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:35+01:00" modified="2008-01-30T10:12:35+01:00" filename="HBv0503_NF2005012000030_fr.xml" mimetype="text/xml"/>
        <resource type="XMLResource" name="HBv0503_OI2005012003290_fr.xml" owner="admin" group="dba" mode="755" created="2008-01-30T10:12:35+01:00" modified="2008-01-30T10:12:35+01:00" filename="HBv0503_OI2005012003290_fr.xml" mimetype="text/xml"/> 
    </collection>

  4. #4
    Membre émérite
    le fichier content.xml contient une collection xml selon moi...
    Selon vous vaut rien, selon le logiciel il faut penser.

    fn:collection() est une fonction qui est laissé grande liberté à chaque implémentation. Le format du contents.xml - qui est en effet un fichier, donc, il ne marche pas pour le logiciel eXist-db, voyez-vous?, a un format plus proche, mais pas tout à fait tout de même, de celui qui marcherait avec Saxon.

    Vous pouvez faire d'une façon plus génerique dans ce cas.
    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    declare namespace exist="http://exist.sourceforge.net/NS/exist";
     
    (: etc etc s'il y a d'autres choses <img src="images/smilies/icon_smile.gif" border="0" alt="" title=":)" class="inlineimg" />
     
    let $myCollection :=
    (
        let $doc:=doc('/db/hebdo2005/contents.xml')
        let $base := $doc/exist:collection/@name
        for $name in $doc/exist:collection/exist:resource/@name
        let $p:=concat($base,'/',$name)
        return doc($p)
    )
     
    (: etc etc... <img src="images/smilies/icon_smile.gif" border="0" alt="" title=":)" class="inlineimg" />

    Je ne peux pas commenter si l'usage de
    for $titre at $pos in $myCollection/article/titraille/titreCible
    est correct ou non: les documents contenant 'article/titraille/titreCible' ne sont pas montrés. Il se peut que les article, titraille et titreCible soient dans un espace de nom non-null. Dans ce cas hypothétique, vous devrez declarer l'espace approprié et mettez un préfix devant eux si ce n'est pas déclaré comme un espace défaut... J'ai grand suspect que ce soit nécessaire mais je vous laisse de débrouiller vous-même à cet égard.

  5. #5
    Membre du Club
    merci
    Hello,

    Merci beaucoup pour ton message… J'ai réussi à résoudre mon problème grâce à toi… J'avais fondamentalement pas compris le concept de collection.

    Désolé du retard.
    bonne soirée