<s>
XMLStarlet	B-Application
is	O
a	O
set	O
of	O
command	O
line	O
utilities	O
(	O
toolkit	O
)	O
to	O
query	O
,	O
transform	O
,	O
validate	O
,	O
and	O
edit	O
XML	B-Protocol
documents	I-Protocol
and	O
files	O
using	O
a	O
simple	O
set	O
of	O
shell	O
commands	O
in	O
a	O
way	O
similar	O
to	O
how	O
it	O
is	O
done	O
with	O
UNIX	O
grep	O
,	O
sed	O
,	O
awk	O
,	O
diff	O
,	O
patch	O
,	O
join	O
,	O
etc	O
commands	O
.	O
</s>
<s>
This	O
set	O
of	O
command	O
line	O
utilities	O
can	O
be	O
used	O
by	O
those	O
who	O
want	O
to	O
test	O
XPath	B-Language
query	O
or	O
execute	O
commands	O
on	O
the	O
fly	O
as	O
well	O
as	O
deal	O
with	O
many	O
XML	B-Protocol
documents	I-Protocol
or	O
for	O
automated	O
XML	B-Protocol
processing	O
with	O
shell	O
scripts	O
.	O
</s>
<s>
To	O
run	O
XMLStarlet	B-Application
utility	O
you	O
can	O
download	O
it	O
from	O
the	O
official	O
site	O
,	O
then	O
simply	O
type	O
''	O
on	O
the	O
command	O
line	O
with	O
the	O
corresponding	O
commands	O
or	O
queries	O
to	O
execute	O
(	O
see	O
#Examples	O
below	O
)	O
.	O
</s>
<s>
Query	O
XML	B-Protocol
documents	I-Protocol
(	O
ex	O
.	O
</s>
<s>
Modify	O
or	O
edit	O
XML	B-Protocol
documents	I-Protocol
(	O
ex	O
.	O
</s>
<s>
Convert	O
XML	B-Protocol
into	O
PYX	O
format	O
(	O
based	O
on	O
ESIS	O
-	O
ISO	B-Language
8879	I-Language
)	O
,	O
and	O
vice	O
versa	O
.	O
</s>
<s>
The	O
XMLStarlet	B-Application
command	O
line	O
utility	O
is	O
written	O
in	O
C	B-Language
and	O
uses	O
libxml2	B-Application
and	O
libxslt	B-Language
.	O
</s>
<s>
Implementation	O
of	O
extensive	O
choice	O
of	O
options	O
for	O
XMLStarlet	B-Application
utility	O
was	O
only	O
possible	O
because	O
of	O
rich	O
feature	O
set	O
of	O
both	O
libraries	O
:	O
libxml2	B-Application
and	O
libxslt	B-Language
.	O
</s>
<s>
XMLStarlet	B-Application
is	O
linked	O
statically	O
to	O
both	O
libxml2	B-Application
and	O
libxslt	B-Language
,	O
so	O
generally	O
all	O
you	O
need	O
to	O
process	O
XML	B-Protocol
documents	I-Protocol
is	O
one	O
executable	O
file	O
.	O
</s>
<s>
XMLStarlet	B-Application
is	O
open	O
source	O
free	O
software	O
released	O
under	O
an	O
MIT	B-License
License	I-License
which	O
allows	O
free	O
use	O
and	O
distribution	O
for	O
both	O
commercial	O
and	O
non-commercial	O
projects	O
.	O
</s>
<s>
Consider	O
the	O
following	O
XML	B-Protocol
document	I-Protocol
'	O
xmlfile1.xml	O
'	O
example	O
:	O
</s>
<s>
On	O
a	O
command	O
prompt	O
the	O
following	O
five	O
XPath	B-Language
queries	O
are	O
executed	O
on	O
the	O
above	O
XML	B-Protocol
file	O
'	O
xmlfile1.xml	O
'	O
.	O
</s>
<s>
Example	O
1	O
:	O
The	O
XPath	B-Language
expression	O
to	O
select	O
all	O
name	O
attributes	O
for	O
all	O
projects	O
.	O
</s>
<s>
Example	O
2	O
:	O
The	O
XPath	B-Language
expression	O
to	O
select	O
all	O
attributes	O
of	O
the	O
last	O
Wikimedia	O
project	O
.	O
</s>
<s>
Example	O
3	O
:	O
The	O
XPath	B-Language
expression	O
to	O
select	O
addresses	O
of	O
all	O
Wiktionary	O
editions	O
(	O
text	O
of	O
all	O
edition	O
elements	O
that	O
exist	O
under	O
project	O
element	O
with	O
a	O
name	O
attribute	O
of	O
Wiktionary	O
)	O
.	O
</s>
<s>
Example4	O
:	O
The	O
XPath	B-Language
expression	O
to	O
select	O
addresses	O
of	O
all	O
Wikimedia	O
Wiktionary	O
editions	O
that	O
have	O
languages	O
different	O
from	O
Turkish	O
and	O
Spanish	O
(	O
all	O
those	O
NOT	O
Turkish	O
and	O
Not	O
Spanish	O
)	O
.	O
</s>
<s>
Example	O
5	O
:	O
The	O
XPath	B-Language
expression	O
to	O
select	O
all	O
attributes	O
of	O
editions	O
whose	O
position	O
is	O
greater	O
or	O
equal	O
to	O
3	O
in	O
the	O
list	O
of	O
editions	O
.	O
</s>
<s>
An	O
XML	B-Protocol
document	I-Protocol
can	O
be	O
validated	O
against	O
an	O
XSD	O
schema	O
saved	O
in	O
file	O
'	O
xsdfile.xsd	O
'	O
as	O
follows	O
:	O
</s>
