---
title: "Ferramentas inovadoras para XPath/XQuery"
date: "2015-03-03"
categories: 
  - "xpath"
  - "xquery"
tags: 
  - "xmlspy"
  - "xpath"
  - "xquery"
description: Explore as ferramentas XPath e XQuery aprimoradas no XMLSpy 2015, que incluem suporte para XPath 3.1 e XQuery 3.1, e que foram concebidas para simplificar o desenvolvimento e o teste de expressões.
---
Status: #blog

Tags:  #xmlspy #xpath #xquery

Categories: [xpath+xquery](/blog/pt/category/xpathxquery.md) | [xpath+xquery](/blog/pt/category/xpathxquery.md)
# Ferramentas inovadoras para XPath/XQuery

O suporte para XPath e XQuery no XMLSpy recebeu um grande impulso com a versão 3 da edição de 2015. Além de adicionar suporte para as versões mais recentes dos padrões – [XPath 3.1](http://www.w3.org/TR/xpath-31/) e [XQuery 3.1](http://www.w3.org/TR/xquery-31/) – introduzimos novas ferramentas inovadoras para o desenvolvimento e teste de expressões XPath e XQuery na janela XPath/XQuery.

Estas novas ferramentas tornam muito mais rápido o desenvolvimento, a avaliação e o aperfeiçoamento de expressões e declarações, antes de as adicionar a documentos XSLT ou XQuery maiores. Isto irá **economizar tempo e evitar frustrações** – porque permite compreender como cada operador ou função funciona e garantir que as suas expressões produzem os resultados desejados imediatamente. Achei que as descrições das funções e as ferramentas de auxílio à introdução foram especialmente úteis para aprender como as novas funcionalidades de mapas e arrays no XPath/XQuery 3.1 são implementadas.

![Ferramentas para XPath e XQuery](/blog/images/C0019116_700x335.jpg)

<!--more-->

Como podem ver abaixo, a janela XPath/XQuery suporta todas as versões do XPath (1.0/2.0/3.1) e do XQuery (1.0/3.1), bem como a [funcionalidade de atualização do XQuery (1.0/3.0)](https://www.youtube.com/watch?v=pJ0380Y1JPg).

 

![imagem](https://lh3.ggpht.com/-eOZYDBDcIW4/VPcWBhFBAYI/AAAAAAAAAos/KJ3Ces2He5c/image_thumb.png?imgmax=800 "image")

A janela XPath/XQuery tem dois modos: "Construtor" e "Avaliador", entre os quais pode alternar durante o trabalho.

**Modo de construção**

O modo "Construtor" oferece acesso a diversas ferramentas que tornam a criação de expressões XPath e XQuery rápida e fácil:

> **\- 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.

[![clip_image004](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)

**Modo de avaliação**

O modo de avaliação permite testar os resultados das suas expressões XPath/XQuery à medida que trabalha, e isso oferece várias vantagens:

> **\- 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.

[![clip_image005](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)

Experimente estas novas ferramentas XPath e XQuery agora mesmo, fazendo o download de uma versão gratuita [Período de teste de 30 dias do XMLSpy](https://www.altova.com/pt/download-trial.html).

Uma última observação: mencionei que a janela XPath/XQuery não só poupa tempo e evita erros, como também ajuda quando se está a tentar aprender sobre as novas funcionalidades nas versões mais recentes dos padrões. Também pode obter ajuda com a nova ferramenta gratuita da Altova [Curso de formação online em XPath 3.0](https://www.altova.com/pt/training/xpath3/default.aspx) .
