---
title: "Task ps-download-xrefs (obsolete)"
source: https://dev.pageseeder.com/reference/version_5/ant_tasks/task_ps-download-xrefs.html
description: "This simple task allows the ANT Script to download a single file along with its cross-references from the PageSeeder Server."
last_updated: 2026-08-11T16:37:02+10:00
tokens: ~1986
---

# Task ps-download-xrefs

> **Obsolete:** This task has been removed as of PageSeeder v6. Use [Task export](../../../guide/publishing/ant_api/tasks/task_export.md) instead.

This task allows the Ant script to download a single file, plus files linked to it by [cross references](../../glossary/cross_reference.md) from a PageSeeder server.

## Definition

```xml

   <ps:ps-download-xrefs          
      destination="[destination]"
              uriHost="[uriHost]"            
              uriPort="[uriPort]"            
                    path="[path]" or 
                 uriID="[uri id]"            
        jsessionid="[jsessionid]"            
                    port="[port]"            
                    host="[host]"            
        siteprefix="[siteprefix]"            
  servletprefix="[servletprefix]"            
                output="[output]"            
                  depth="[depth]"            
           existing="overwrite|
                        ignore|
                            fail"            
         loadReverse="true|false"            
           includeTypes="[types]"            
            includes="[includes]"            
            excludes="[excludes]"            
includeFormats="[includeFormats]"            
excludeFormats="[excludeFormats]">
   <parameter 
              name="[param name]"
            value="[param value]"/>
</ps:ps-download-xrefs>
```

## Attributes

| **Attribute** | Description | Required |
| --- | --- | --- |
| **jsessionid** | The `@jsessionid` attribute (optional) is used for authentication. It is not required but it will always be used if specified. | Yes, unless `username/password` or `propertiesfile` are specified |
| **username** | If `@jsessionid` attribute is not specified this can be used for authentication. | Yes, unless `jsessionid` or `propertiesfile` are specified |
| **password** | If jsessionid is not specified this can be used for authentication. | Yes, unless `jsessionid` or `propertiesfile` are specified |
| **propertiesfile** | The `@propertiesfile` attribute (optional) describes the location of the properties file to use to connect to the PageSeeder Server. The value of the attribute can be the full path of the file, the relative path (the base directory is the location of the Ant script) or simply its name, in which case it MUST be located on the classpath. | Yes, unless (`jsessionid` or `username/password`) and `host` are specified |
| **port** | The port address of the PageSeeder Server - default: 80 *(used when no properties file is specified)* | No |
| **host** | The host name of the PageSeeder Server *(used when no properties file is specified)* | Yes, unless `propertiesfile` is specified |
| **siteprefix** | The PageSeeder site prefix defined - default: /ps *(used when no properties file is specified)* | No |
| **servletprefix** | The PageSeeder servlet prefix defined - default: /servlet *(used when no properties file is specified)* | No |
| **destination** | The `@destination` attribute is the full path of the folder where the file(s) will be downloaded, if it does not exist, it will be created. If creation fails, an error will be raised. | Yes |
| **output** | Location of the output file, it is an XML file that contains the list of URIs downloaded along with their cross-references. | Yes |
| **path** | The `@path` attribute is the full path of the file to download (not URLencoded). The full path includes any prefix used for the PageSeeder server and the group name (i.e.: /ps/gen/jbtest/file.xml). The full path can be seen in PageSeeder in the Document Properties. If the file is not found, a 404 error will be raised. | Yes, unless `uriID` is specified |
| **uriID** | The [URI ID / uriid](../../glossary/uri_id.md)of the document to download. | Yes, unless `path` is specified |
| **uriHost** | Required when the host of the uri to download is different from webSiteAddress in WEB-INF/config/template.properties | No |
| **uriPort** | Required when the port of the uri to download is different from webSitePort in WEB-INF/config/template.properties. | No |
| **depth** | The cross-references depth of the files to download. The value must be a positive integer, default value is 1. | No |
| **existing** | The behavior to follow when there is already an existing local file with the same name as a file to download. Possible values are the following: **ignore**–the remote file will not be downloaded,**fail**–the process will throw an error,and**overwrite**– the remote file will overwrite the local file. Default is `overwrite`**.** | No |
| **loadReverse** | A flag that can be used to download the documents that point to this one. Possible values are **true** or **false** - default is **false**. | No |
| **includeTypes** | A comma-separated list of cross-references types. All files targeted by cross-references with types matching these will be downloaded. Usual XRef types are **Replace**, **Transclude, Embed** and **None**. If not specified, all types are matched. | No |
| **includes** | A comma-separated list of patterns matching files to include. If not specified, all files are matched. | No |
| **excludes** | A comma-separated list of patterns matching files to exclude. If not specified, no files are excluded. | No |
| **includeFormats** | A comma-separated list of formats matching files to include. If not specified, all formats are matched. | No |
| **excludeFormats** | A comma-separated list of formats matching files to exclude. If not specified, no formats are excluded. | No |

## Parameters

Zero or more `<parameter>` elements may be nested inside the `<ps-download-xrefs>` element. They add modifying parameters to the PageSeeder download URL used to request the files. The following parameters are supported:

| Parameter Name | Description |
| --- | --- |
| **ps-release** | decimal number or non-number version used to download a version equal to (or if a number less than) this version |
| **ps-releaseStatus** | status string used to download the latest version with this status |
| **ps-compare** | decimal number or non-number version used to compare a version equal to (or if a number less than) this version  with the downloaded version (must be used with ps-fragmentinfo=true) |
| **ps-compareStatus** | status string used to compare a version with the latest version that has this status (must be used with ps-fragmentinfo=true) |
| **xsl-documentInfo** | if "true" includes \<ps:documentInfo\> metadata in document. **Deprecated: Use ps-documentinfo instead.** |
| **xsl-discussion** | if "true" includes comments in document under \<ps:discussion\> (must be used with ps-documentinfo=true or ps-fragmentinfo=true or xsl-documentInfo=true) |
| **ps-documentinfo** | if "true" includes \<ps:documentinfo\> metadata in document, see Document Metadata Schema 1.3 |
| **ps-fragmentinfo** | if "true" includes \<ps:fragmentinfo\> metadata in document |
| **ps-reversexrefs** | if "true" includes \<ps:reversexrefs\> metadata in document (must be used with ps-documentinfo=true or ps-fragmentinfo=true) |

For example `<parameter name="ps-release" value="4.1"/>` would download the latest versions of the documents with version less than or equal to 4.1

## Examples

Stand alone script example:

```xml

<ps:ps-download-xrefs
    destination="c:\download"
           path="/ps/acme/demo/mydoc.xml"
          depth="2"
         output="c:\results\download.xml"
           host="mycompany.com"
       username="jsmith"
       password="xyz" />
```

 Publish script example:

```xml

<ps:ps-download-xrefs
  destination="${ps-working}"
        depth="2"
       output="${ps-working}/download.xml"
         path="${ps-uriPath}"
      uriHost="${ps-uriHost}"
      uriPort="${ps-uriPort}"
   jsessionid="${ps-jsessionid}"
         host="${ps-host}"
         port="${ps-port}"
servletPrefix="${ps-servletPrefix}"
   sitePrefix="${ps-sitePrefix}" />
```

