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

# \<compare\>

## Summary

Details of previous [fragment](../../reference/glossary/fragment.md) content if different from current. Only appears when comparing [documents](../../reference/glossary/document.md), for example, using the [Ant task](../../reference/glossary/ant_task.md):

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

*INFORMATIONAL - ignored by upload.*

Related element [\<compareto\>](element-compareto.md)

## Usage context

| Element category | metadata |
| --- | --- |
| PSML level | processed |
| Permitted content | `<labels> <content> <diff>` |
| Permitted parent | `<locator>` |
| HTML equivalent | no equivalent |
| OpenXML equivalent | no equivalent |

## Attributes

This element includes the following attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| editid | [xs:long](../datatypes/xml_schema_datatypes.md) | no | The XLink ID for the compare edit. |



### `@editid`

The ID of the compare content’s edit. An XLink ID is unique within a PageSeeder instance.

*This attribute was introduced in PSML v1.4 in PageSeeder 6.00.*

> **Note:** This attribute value is specific to a PageSeeder server as it refers to the XLink representing the last edit.

## Examples

```lang-xml

<locator id="363"
         fragment="4"
         editid="8324" 
         modified="2014-01-10T15:30:54+11:00">
  <compare>
    <labels>oldlabel1,oldlabel2
    </labels>

    <content>
      <fragment  id="4">
        <para>Old content</para>
      </fragment>
    </content>
  </compare>
</locator>
```

## Schema

### XML Schema

```lang-xml
<xs:element name="compare">

  <xs:complexType mixed="true">

    <xs:sequence>
      <xs:element ref="labels" minOccurs="0"/>
      <xs:element ref="content"/>
      <xs:element ref="diff" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="editid" type="xs:long" use="optional"/>
  </xs:complexType>
</xs:element>
```

### Relax Schema

```lang-relax
element compare {
   attribute editid { xs:long }?,
   element labels?,
   element content,
   element diff?
}
```

## Compatibility

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

