Files/Documents

XSH is intended to query and manipulate XML and HTML documents. Use one of the open/open-*/create commands to load an XML or HTML document from a local file, external URL (such as http:// or ftp://), string or pipe. While loading, XSH parses and optionally validates (see validation and load-ext-dtd) the document. Parsed documents are stored in memory as DOM trees, that can be navigated and manipulated quite similarly to a local filesystem.

Every opened document is associated with an identifier (id), that is a symbolic name for the document in XSH and can be used for example as a prefix of xpath.

In the current version, XSH is only able to save documents locally. To store a document on any other location, use ls command and pipe redirection to feed the XML representation of the document to any external program that is able to store it on a remote location.

Example 3. Store XSH document DOC on a remote machine using Secure Shell

xsh> ls DOC:/ | ssh my.remote.org 'cat > test.xml'

Related Argument Types and Commands

backups

turn on backup file creation

catalog

use a catalog file during all parsing processes

clone

clone a given document

close

close document (do not save it, though)

create

make a new document from a given XML fragment

documents

display a list of open files

filename

file name

id

identifier

nobackups

turn off backup file creation

open

load an XML, HTML, or Docbook SGML document from a file, pipe or URI

process-xinclude

load and insert XInclude sections

save

save a document as XML or HTML

select

make a given document the current one

stream

process selected elements from an XML stream (EXPERIMENTAL)

switch-to-new-documents

set on/off changing current document to newly open/created files