---
title: "Element <compareto>"
source: https://dev.pageseeder.com/psml/elements/element-compareto.html
description: "PSML Element reference for <compareto>"
last_updated: 2026-08-07T17:09:54+10:00
tokens: ~1166
---

# \<compareto\>

## Summary

The [version](../../reference/glossary/version.md) this [document](../../reference/glossary/document.md) is being compared to. Only appears when comparing documents, for example, using the [Ant task](../../reference/glossary/ant_task.md):

```lang-xml
<ps:export ... compareto="1.0"/>
```

Contains the [title](../../reference/glossary/document_title.md), description and [labels](../../reference/glossary/labels.md) of the document for this version.

*INFORMATIONAL - ignored by upload.*

## Usage context

| Element category |  |
| --- | --- |
| PSML level | processed |
| Permitted content | `<title> <description> <labels> <metadata> <structure>` |
| Permitted parent | `<documentinfo>` |
| HTML equivalent | no equivalent |
| OpenXML equivalent | no equivalent |

## Attributes

This element includes the following attributes:

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| date | [xs:dateTime](../datatypes/xml_schema_datatypes.md) | no | The creation date of the version |
| decodedpath | `xs:string` | no | The decoded path of the version (for example, /ps/acme/specs/the product.xml) |
| host | `xs:string` | no | The host of the version (for example, mycompany.com) |
| path | `xs:string` | no | The path of the version (for example, /ps/acme/specs/the%20product.xml) |
| port | `xs:integer` | no | The port number of the version (for example, 80, 443) |
| scheme | `xs:string` | no | The scheme (for example, http, https) |
| version | [xs:string](../datatypes/xml_schema_datatypes.md) | no | The name of the version or `Original` |
| versionid | xs:long | no | The ID of the version when not  `Original` |
| docid | [document-id](../datatypes/pageseeder_datatypes.md) | no | The document ID of the version |

### `@date`

The creation date of the version in ISO 8601 date time format.

### `@decodedpath`

The path of the document URI in its URL-decoded form (external URI only)*.*

For example: `/specs/my product.html`

*This attribute was introduced in PSML v1.3 in PageSeeder 5.99.*

### `@host`

The document URI host (external URI only).

*This attribute was introduced in PSML v1.3 in PageSeeder 5.99.*

### `@path`

The URL-encoded path of the document URI (external URI only).

*For example: /specs/my%20product.html*

*This attribute was introduced in PSML v1.3 in PageSeeder 5.99.*

### `@port`

The port for the document URI (external URI only).

*This attribute was introduced in PSML v1.3 in PageSeeder 5.99.*

### `@scheme`

The scheme for the document URI (external URI only).

*This attribute was introduced in PSML v1.3 in PageSeeder 5.99.*

### `@version`

The name of the version. If that version corresponds to the original document, then this value is `Original`

### `@versionid`

The ID of the version. Not included if`@version="Original"`.

*This attribute was introduced in PSML v1.3 in PageSeeder 5.99.*

### `@docid`

The document ID of the version.

## Examples

```lang-xml

<compareto version="1.0" date="2013-04-23T11:18:10+10:00">
  <title>Old title</title>
  <description>Old description</description>
  <labels>oldlabel1,oldlabel2</labels>
</compareto>
```

## Schema

### XML Schema

```lang-xml

<xs:element name="compareto">
  <xs:complexType>
    <xs:all>
      <xs:element  name="title" type="xs:string" minOccurs="0"/>
      <xs:element name="description"
                  type="xs:string"
                  minOccurs="0"/>
      <xs:element  ref="labels" minOccurs="0"/>
      <xs:element ref="metadata" minOccurs="0"/>
      <xs:element ref="structure" minOccurs="0"/> 
    </xs:all>
    <xs:attribute name="version"     type="xs:string"/>
    <xs:attribute  name="date"       type="xs:dateTime"/>
    <xs:attribute name="scheme"      type="xs:string"/>
    <xs:attribute name="host"        type="xs:string"/>
    <xs:attribute name="port"        type="xs:integer"/>
    <xs:attribute name="path"        type="xs:string"/>
    <xs:attribute name="decodedpath" type="xs:string"/>
  </xs:complexType>
</xs:element>
```

### Relax Schema

```lang-relax

element compareto {
   attribute version { text}?,
   attribute date { xs:dateTime }?,
   attribute scheme { text },
   attribute host { text },
   attribute port { xs:integer },
   attribute path { text },
   attribute decodedpath { text },
   element title { text }?,
   element description { text }?,
   element labels?,
   element metadata?,
   element structure?
}
```

## Compatibility

This element was introduced in PSML Beta 7 and is only supported from PageSeeder 5.6.

The following attributes were introduced in PSML v1.3 in PageSeeder 5.99:

- decodedpath
- host
- path
- scheme
- versionid

