Schema
- Last UpdatedSep 27, 2025
- 2 minute read
- PI System
- PI Server
When you export Audit Database records to XML, the file includes a schema reference.
Important: The default schema URL (http://xml.osisoft.com/Schemas/PIAudit) in the exported XML is obsolete. It will always fail if you try to validate against it. The export keeps this reference so older tools don’t break. To validate, you must supply a working schema location.
Default schema reference
The export still includes the legacy namespace and schema URL:
<PIAudit xmlns="xml.osisoft.com-schemas-piaudit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xml.osisoft.com-schemas-piaudit
http://xml.osisoft.com/Schemas/PIAudit">
The namespace remains for compatibility with older tools. The URL no longer resolves, and you cannot use it for validation.
Override the schema location
To validate the export, replace the schema location with a reachable URL or file path. Use the -xh option with pidiag -xa to supply a new opening tag.
Example: internal web server
pidiag -xa ..\temp\pibasessAudit.dat ^
-xh "xmlns=\"xml.osisoft.com-schemas-piaudit\" \
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \
xsi:schemaLocation=\"xml.osisoft.com-schemas-piaudit
http://intranet.example.com/pi-schemas/PIAudit\""
Example: local file
pidiag -xa ..\temp\pibasessAudit.dat ^
-xh "xmlns=\"xml.osisoft.com-schemas-piaudit\" \
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \
xsi:schemaLocation=\"xml.osisoft.com-schemas-piaudit C:\schemas\PIAudit.xsd\""
Note: Precede embedded double quotes with a backslash (\) in Windows command-line parameters..
Use a local copy or internal copy
If your environment can’t reach external hosts or your security policy blocks external URLs, keep a copy of the schema inside your network.
-
Host the XSD on an internal web server or file share that the validation machine can reach, and reference that location in xsi:schemaLocation with the -xh option.
-
If your validation tool supports local files, you can store the schema alongside the exported XML and reference the file path directly.
-
Keep the schema in a centrally managed location so you can update it without changing client scripts. For example:
http://intranet.example.com/pi-schemas/PIAudit
Validate your setup
Before you validate, confirm the namespace and schema reference match and that the schema is accessible:
-
The first token in xsi:schemaLocation must equal the namespace in xmlns.
-
The schema URL or file path must resolve to a valid XSD.
-
The header string must be passed correctly, including quotes.
-
The schema version should match what your environment expects.