Utilities for traversing XML - Factor Documentation (original) (raw)
The xml.traversal vocabulary provides utilities for traversing an XML DOM tree and viewing the contents of a single tag. The following words are defined:
tag-named ( tag name/string -- matching-tag )
tags-named ( tag name/string -- tags-seq )
deep-tag-named ( tag name/string -- matching-tag )
deep-tags-named ( tag name/string -- tags-seq )
get-id ( tag id -- elem )
To get at the contents of a single tag, use
children>string ( tag -- string )
children-tags ( tag -- sequence )
first-child-tag ( tag -- child )
assert-tag ( name name -- )