• Stars
    star
    4
  • Rank 3,206,073 (Top 65 %)
  • Language
    Ada
  • License
    Other
  • Created about 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Ada implementation of XPath 1.0.

XIA (XPath In Ada) is a native Ada implementation of the XPath 1.0 specification. XIA is built using the DOM component of AdaCore's XML/Ada implementation and AdaGOOP.

Submitting XPath queries is done via the XPath_Query function in package XIA. The function returns a Node_List, as defined in DOM.Core, whose contents can be accessed with the Item function in DOM.Core.Nodes.

Example

The test program test_xpath opens an XML file into the DOM.Readers.Tree_Reader (XML_Source_Reader) and then executes queries, producing results in a DOM.Core.Node_List (Queried_Nodes):

Queried_Nodes :=
  Xpath_Query (Dom.Readers.Get_Tree (XML_Source_Reader), Query);

For each query, it prints out the number of matching nodes and an image of the contents of each.

For this XML file, modelled loosely on a Wikipedia example,

<a name="a1">
  <b name="b1">
    <c name="c1"/>
    <d name="d1"/>
  </b>
  <b name="b2">
    <e name="e1"/>
  </b>
  <x name="x1">
    <b name="b3">
      <f name="f1"/>
    </b>
  </x>
</a>

the query

a//b/*[1]/@name

finds 3 nodes, the first child of each <b/> node in the document:

Number of nodes: 3
name="c1"
name="e1"
name="f1"

whereas the query

(a//b/*)[1]/@name

finds one node, the child node of the first <b/> node:

Number of nodes: 1
name="c1"

Testing

A BASH script, txia, and an input file of XPath queries, txia_tests.txt, are provided in the test/ directory to jam a bunch of queries through the test program (if more test queries are added, be sure to leave an empty line after all the queries - text after an empty line is ignored). txia_tests.txt also exhibits a wide variety of XPath queries, although the majority of these are nonsense queries as far as realistic usage is concerned, they're tailored to exercise and test various aspects of XIA's implementation.

To generate the test program, cd to the test directory and say alr build.

Version history up to 1.00 is here.

Please report issues at Github.

More Repositories

1

cortex-gnat-rts

This project contains various GNAT Ada Run Time Systems (RTSs) targeted at Cortex boards: so far, the Arduino Due, the STM32F4-series evaluation boards from STMicroelectronics, and the BBC micro:bit (v1)
Ada
60
star
2

distributing-gcc

Binary releases of GCC (native and cross) on macOS; also, the scripts/Makefiles used for producing them.
Makefile
29
star
3

building-gcc-macos-native

Scripts for building GCC on macOS
Shell
11
star
4

ews

The Embedded Web Server is designed for use in embedded systems with limited resources (eg, no disk). It supports both static (converted from a standard web tree, including graphics and Java class files) and dynamic pages. It is written in GCC Ada.
Ada
11
star
5

stack_usage

Calculates the maximum stack depth required by GCC-compiled code
Python
10
star
6

analytical-engine

An Ada 2012 emulation of Charles Babbage’s Analytical Engine
Ada
9
star
7

ACATS

The Ada Conformity Assessment Test Suite, customised for GCC.
Ada
9
star
8

ASIS

Supports building the Ada Semantic Interface Specification library and tools for FSF GCC variants. Tracks AdaCore CE releases.
Ada
8
star
9

tcladashell

Ada binding to Tcl/Tk. Note, the copyright is GPL 2.0 + GMGPL
Ada
8
star
10

coldframe

ColdFrame generates Ada framework code and documentation from UML models.
Ada
7
star
11

nuweb.py

Literate programming in LaTeX; programming languages of your choice
Python
5
star
12

dhondt

Ada implementation of D’Hondt electoral result calculator
Ada
4
star
13

building-gcc-macos-arm-eabi

Scripts for building GCC on macOS as a cross-compiler to arm-eabi
Shell
3
star
14

adagoop

Generator of object-oriented parsers in Ada
Ada
3
star
15

libadalang2xml

Generates an XML representation of Ada source using libadalang.
Ada
2
star
16

asis2xml

Converts Ada sources’ ASIS representation to XML, so as to make it easier to develop reporting and transformational tools using (for example) XSLT.
Ada
2
star
17

leak_detector

Reports memory leaks in Ada programs.
Ada
2
star
18

alire-index.mac

Index of Alire crate versions catering for macOS idiosyncrasies
2
star
19

Quaternions

An Ada library to support using quaternions.
Ada
2
star
20

macos-sdks-vs-gcc

Provides GCC 'specs' files to cope with macOS SDK policy changes
Ada
1
star
21

synchronized_output

Supports text logging from multiple tasks
Ada
1
star
22

gnat_util

Provides access to GNAT compiler internals for AdaCore utilities
Makefile
1
star
23

scripted_testing

Supports functional testing using Tcl scripts.
Ada
1
star
24

xcode_15_fix

Xcode/CLT version 15 introduced problems for Ada programming on macOS.
Ada
1
star
25

ACATS-grading

Tools for grading ACATS results, modified for Unix-like systems
Shell
1
star
26

minimal_containers

Just enough containers for ColdFrame.
Ada
1
star
27

trace_utilities

Support for presenting traceback information.
Ada
1
star
28

parallelize

Reads commands and executes them in parallel.
Ada
1
star