uspTukubaiコマンドに関する様々な資料がここにあります。

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

xmlpath(USP)

Name

xmlpath : Prints paths of XML

Synposis

Usage   : xmlpath [<xmlfile>]

Version : Tue Jan  9 09:02:34 JST 2024

Edition : 1

Description

Prints paths of XML specified by <xmlfile>. Output is formatted like:

  /tag-name

  /tag-name/tag-name

  /tag-name/tag-name/tag-name

  ...

  /tag-name/tag-name..../tag-name

Empty lines, comments and DTD declaration will be removed.

Elements containg attributes will result in:

  tag-name@attribute                 having an attribute

  tag-name@{attribute,attribute,...} having over two atttributes

Example 1

$ cat xml

<?xml aaa="aaa" bbb="bbb" ?>

<top/>

<!-- comment -->

<dir1 id1="0" id2="1">

<!-- comment -->

<dir2 id="a">

<!-- comment -->

<file attr="001">xxx</file>

<!-- comment -->

<file attr="002">yyy</file>

<file attr="003">zzz</file>

</dir2>

<dir2 id="b">

<file attr="004">XXX</file>

<file attr="005">YYY</file>

</dir2>

</dir1>

<last/>

$ xmlpath xml

/top

/dir1@{id1,id2}/dir2@id/file@attr

/dir1@{id1,id2}/dir2@id/file@attr

/dir1@{id1,id2}/dir2@id/file@attr

/dir1@{id1,id2}/dir2@id/file@attr

/dir1@{id1,id2}/dir2@id/file@attr

/last

Note

A given XML document must hold a line for each start and end tag.