Check XML and XHTML documents for Well-Formedness and Validity while editing them in TextMate with support for DTD, W3C XML Schema, RELAX NG, Schematron, XInclude, XML Catalog, and XPath 2.0 Visualizer.



XMLMate screenshot Universal Binary

XMLMate is now an open source project (BSD license) on Google Code!

To install, just download XMLMate Plug-In, unzip, and double-click. Then launch TextMate and select Show XMLMate Palette from the Window menu.

The XMLMate Plug-In adds an XML parsing palette to the popular TextMate text editor for Mac OS X. While editing an XML (or XHTML) document in TextMate, you can open the XMLMate palette to conveniently check your document for well-formedness or validity against a DTD, W3C XML Schema, RELAX NG schema, or Schematron schema. Here's how:

  1. Install XMLMate Plug-In.
  2. Begin editing an XML document in TextMate (XMLMate will always try to parse your frontmost TextMate document).
  3. From the Window menu, select Show XMLMate palette.
  4. In the XMLMate palette, you can select your Validation options. Select None to just parse your XML document and check it for well-formedness. If you would like to validate your document, first select your preferred schema language.
  5. Then, select your schema document by clicking Browse and selecting from the filesystem. Alternatively, if you'd just like to validate your document against a DTD referenced from your source document's doctype, select DTD and leave the text field blank.
  6. Select other XML parser options by expanding the Settings disclosure triangle.
  7. Click the Parse button.
  8. The top half of the split view will show the results the parsing/validation. Selecting the Verbose checkbox will show more detailed information here.
  9. The bottom half of the split view will show the text representation of the XML parser's output (including defaulted DTD attributes, entity expansions, CDATA merges, etc. according to your parse settings -- this is sometimes helpful for debugging as you can see what the XML parser 'sees'.)
  10. XML Error messages appear in red and warnings appear in yellow. Clicking on either of this will open the offending document (source or schema) in TextMate with the problematic text selected.

11/01/07 - Version 1.4.2: works with TextMate 1.5.7. If you are using TextMate version 1.5.7 or later, you will need XMLMate 1.4.2 or later. Earlier versions of XMLMate will not work with TextMate 1.5.7 or later. I've also added a user default for making the XMLMate panel a non-floating window:

defaults write com.macromates.TextMate XMLMateFloatingPanel -bool NO

1/10/07 - New in Version 1.4: XPath Visualization. In the new 'XPath' tab, execute XPath 2.0 expressions against your front most TextMate document and view the matched nodes.

01/03/07 New in Version 1.3: XML Catalog Support

There's a new Catalog tab in the XMLMate palette that allows you to construct and edit an XML Catalogs for use when parsing XML with XMLMate.

XML Catalogs is an Oasis standard that allows you to map (usually remote) URIs used in XML documents to alternate (usually local) resources. XML Catalogs are themselves expressed in XML.

In a nutshell, the new XML Catalog features allow you to easily configure XMLMate to substitute local resources (like DTDs and other schemas) for remote resources referenced by URLs. This allows, for example, convenient validation of XHTML documents against a local (possibly customized) copy of an XHTML DTD without having to change the URLs used in the XHTML doctype to local file paths. Parsing/validation with local schemas is much faster and allows offline validation.

12/30/06 - New in Version 1.2:

12/28/06 - Version 1.1 now supports Schematron!

XMLMate is powered by libxml. Many more features are planned for the future.

Powered by libxml2

Powered by libxslt

Implementation Details

XMLMate is written in Objective-C and C, and is based on:

XMLMate requires Mac OS X 10.4 Tiger or later.

XMLMate is developed by Todd Ditchendorf. Have feedback? Email me.

Valid XHTML 1.0! Valid CSS!