@JSONSETNAME[[xpath,]name] : Définit un nouveau nom pour l'élément spécifié par XPath. Le fichier doit avoir été ouvert avec un @JSONOPEN précédent.
Si xpath n'est pas spécifié, @JSONSETNAME prend par défaut le xpath actuel.
Retourne 0 en cas de succès, ou un code d'erreur JSON en cas d'échec.
Exemple :
Avec ce fichier JSON :
{
"store": {
"books": [
{
"tags": ["trilogy", "war"],
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
},
{
"tags": ["classic", "whales"],
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
}
]
}
}
Renommer "tags" en meta :
%@jsonsetname[/json/store/books/[1]/tags,meta]
%@jsonsetname[/json/store/books/[2]/tags,meta]
10231 Balise d'élément déséquilibrée |
10232 Balisage JSON non valide |
10233 XPath invalide |
10234 Arbre DOM indisponible |
101 Index d'attribut invalide |
102 Aucun attribut disponible |
103 Index d'espace de noms incorrect |
104 Aucun espace de noms disponible |
105 Index d'élément non valide |
106 Aucun élément disponible |
107 L'attribut n'existe pas |
201 Balise d'élément déséquilibrée |
202 Préfixe d'élément inconnu (espace de noms introuvable) |
203 Préfixe d'attribut inconnu (espace de noms introuvable) |
204 Balisage XML non valide |
205 État final invalide pour l'analyseur |
206 Le document contient un élément déséquilibré |
207 XPath invalide |
208 Aucun enfant de ce type |
209 L'élément supérieur ne correspond pas au début du chemin |
210 L'arbre DOM n'est pas disponible |
302 Impossible d'ouvrir le fichier. |