exslt:node-set(($[-wd]+))
; note that with the regexp engine of some editors, the leading $ sign also needs to be escaped to be effectively interpreted as a literal : exslt:node-set(($[-wd]+))
1
xsltproc
on Windows by installing Cygwin, a Unix-likecompatibility layer. Simply select the package called libxslt
in the Cygwin installer../configure
script to set up the build scripts. Then, run make install
to build the package and install it. If you aren’t the super user, you should use sudo make install
so the commands are installed in the system directories.xml
command on its own (see Listing 1).xml <command>
followed by some options. Getting help for each of the options is as easy as xml <command> --help
. For example, Listing 2 shows the help for the edit (ed
) command.xml ls
, which gives a listing of the current directory in XML. Listing 3 shows an example.ed
) to remove the d
nodes from the XML. The ls
command outputs the directory to the standard output. The pipe (|
) then redirects the standard output to the standard input of the edit command, which removes the d
nodes from the listing. You specify the d
nodes using the XPath expression //d
, which matches a d
node at any level in the tree. You can make this command more specific by using /xml/d
.a
and m
attributes (see Listing 5).rename
edit function to change the f
tag to file
(see Listing 6). s
and n
, you can change them to size
and name
, respectively (see Listing 7).element
tag defines the name xml
as the base tag. Then, the oneOrMore
tags inside the xml
tags are named file
and size
.someAttribute
to one of the file items in a file called ls3.xml, and run it again (see Listing 11)./xml/file
specification. Second, the output specification using the -v
option concatenates the name
attribute on the file
tag with a carriage return.-s
option to sort the files by the size
attribute (see Listing 13). The A:N:-
syntax tells XMLStarlet to use an ascending numerical sort. (This code adds the size
parameter to the concat
statement to make sure it's working.)xml
command, you can use it to parse a traffic report. Yahoo!® Maps provides a traffic service. You can use the curl
command with the -g
option (for GET) to download the latest traffic information through RSS. Acrobat distiller free download mac. For example, in Listing 14, I specify my zip code by adding the ?csz=94101
argument, and the result is the latest San Francisco traffic report.curl
command through the XMLStarlet command to get just the descriptions (see Listing 15).-m
option picks out the description of each item. Then, using the -v
option, you can output only the text of the node by specifying a period (.
).