---
title: "Strumenti innovativi per XPath/XQuery"
date: "2015-03-03"
categories: 
  - "xpath"
  - "xquery"
tags: 
  - "xmlspy"
  - "xpath"
  - "xquery"
description: Scoprite gli strumenti XPath e XQuery potenziati in XMLSpy 2015, che offrono il supporto per le versioni XPath 3.1 e XQuery 3.1, progettati per semplificare lo sviluppo e il test delle espressioni.
---
Status: #blog

Tags:  #xmlspy #xpath #xquery

Categories: [xpath+xquery](/blog/it/category/xpathxquery.md) | [xpath+xquery](/blog/it/category/xpathxquery.md)
# Strumenti innovativi per XPath/XQuery

Il supporto per XPath e XQuery in XMLSpy ha ricevuto un importante miglioramento con la versione 3 della release 2015. Oltre ad aggiungere il supporto per le ultime versioni degli standard – [XPath 3.1](http://www.w3.org/TR/xpath-31/) e [XQuery 3.1](http://www.w3.org/TR/xquery-31/) – abbiamo aggiunto nuovi e innovativi strumenti per lo sviluppo e il test di espressioni XPath e XQuery nella finestra XPath/XQuery.

Questi nuovi strumenti rendono molto più veloce lo sviluppo, la valutazione e la perfezionamento di espressioni e dichiarazioni prima di aggiungerle a documenti XSLT o XQuery più complessi. Questo vi farà **risparmiare tempo e ridurre la frustrazione**, perché potrete capire come funziona ogni operatore o funzione e assicurarvi che le vostre espressioni producano immediatamente i risultati desiderati. Ho trovato particolarmente utili le descrizioni delle funzioni e gli strumenti di supporto per capire come sono implementate le nuove funzionalità di mappe e array in XPath/XQuery 3.1.

![Strumenti per XPath e XQuery](/blog/images/C0019116_700x335.jpg)

<!--more-->

Come potete vedere di seguito, la finestra XPath/XQuery supporta tutte le versioni di XPath (1.0/2.0/3.1) e XQuery (1.0/3.1), nonché [la funzionalità di aggiornamento XQuery (1.0/3.0)](https://www.youtube.com/watch?v=pJ0380Y1JPg).

 

![immagine](https://lh3.ggpht.com/-eOZYDBDcIW4/VPcWBhFBAYI/AAAAAAAAAos/KJ3Ces2He5c/image_thumb.png?imgmax=800 "image")

La finestra XPath/XQuery offre due modalità: "Costruttore" e "Valutatore", tra cui è possibile alternare durante l'utilizzo.

**Modalità costruttore**

La modalità "Builder" offre l'accesso a numerosi strumenti che semplificano e velocizzano lo sviluppo di espressioni XPath e XQuery:

> **\- Point-and-click expression building**, via a comprehensive a list of operators, expressions, and built in functions, which you can insert in an expression by double clicking. Functions are inserted with their arguments indicated by “#” placeholders, making it easy to build expressions quickly and error-free.

> **\- Mouse-over hints** that describe each operator, expression, and function, so you can be sure to choose the correct one for the expression at hand.

> **\- Enhanced entry helpers** that display the description of built in functions, and then show helpful function and parameter details as you type, speeding development and ensuring accuracy.

> **\- Ready-to-use code snippets** for complex statements such as FLWOR and XQuery Update Facility expressions, found in the Operator/Expression pane. Here you can read a description of each and insert the expression at the cursor by double clicking.

[![Immagine allegata](https://lh3.ggpht.com/-ZesjtsKcCo0/VPSQUH4KTyI/AAAAAAAAAoA/LpXths2pcoI/clip_image004_thumb.png?imgmax=800 "clip_image004")](http://lh4.ggpht.com/-hP-444Vb3-c/VPSQTzlw1JI/AAAAAAAAAn8/SbJyEoO1YD8/s1600-h/clip_image004%25255B3%25255D.png)

**Modalità di valutazione**

La modalità "Valutatore" consente di testare i risultati delle proprie espressioni XPath/XQuery durante il lavoro, e questo offre diversi vantaggi:

> **\- Save time and avoid errors** by testing expressions before adding them to your document and adjusting as needed.

> \- **Evaluate an XPath or XQuery expression against one or more files**: the active document, all open files, a folder, or an entire XMLSpy project.

> \- **Utilize nine tabs** for developing and testing complex expressions. Once you have composed an expression on one tab, switching to a new tab lets you build and analyze the results of a new expression – but when you switch back to the previous tab, the expression and results are still there. This allows you develop multiple expressions side-by-side and incrementally make changes to each one of them, preserving both the expression and the result for each tab.

[![Immagine allegata](https://lh4.ggpht.com/-Tl2hLyVZPQo/VPSQU-gQAII/AAAAAAAAAoU/DsvmTqaQhn8/clip_image005_thumb.png?imgmax=800 "clip_image005")](http://lh5.ggpht.com/-v8KfzvQjCeY/VPSQUSkjZSI/AAAAAAAAAoI/Oq_z1a6XiKw/s1600-h/clip_image005%25255B3%25255D.png)

Provate subito questi nuovi strumenti XPath e XQuery scaricando una versione gratuita [Prova gratuita di XMLSpy per 30 giorni](https://www.altova.com/it/download-trial.html).

Un'ultima osservazione: ho menzionato che la finestra XPath/XQuery non solo fa risparmiare tempo ed evita errori, ma è anche utile quando si cerca di apprendere le nuove funzionalità presenti nelle ultime versioni degli standard. Inoltre, è possibile usufruire del nuovo strumento gratuito di Altova [Corso di formazione online su XPath 3.0](https://www.altova.com/it/training/xpath3/default.aspx) .
