How to validate a CNXML document

There are three ways to validate a CNXML document: against the DTD, against the Relax NG Schema or against the XML Schema. XMLBlueprint XML Editor supports all three.

How to validate a CNXML document against the DTD

To validate a CNXML document against the DTD, you must include the CNXML DTD in your document:

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE book SYSTEM "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">

<document

      xmlns="http://cnx.rice.edu/cnxml">

</document>

XMLBlueprint XML Editor will automatically support XML Completion for your CNXML document based on the DTD. To validate your CNXML document, open it in XMLBlueprint XML Editor and click XML > Validate.

How to validate a CNXML document against the Relax NG Schema

To validate a CNXML document against the Relax NG Schema, you must include the CNXML Relax NG Schema in the your document:

<?xml version="1.0" encoding="utf-8"?>

<?blueprint

      namespace="http://cnx.rice.edu/cnxml"

      schema="http://cnx.org/technology/cnxml/schema/rng/0.5/cnxml.rng"?>

<document

      xmlns="http://cnx.rice.edu/cnxml">

</document>

XMLBlueprint XML Editor will automaticallty support XML Completion for your CNXML document based on the Relax NG Schema. To validate your CNXML document, open it in XMLBlueprint XML Editor and click XML > Validate.

How to validate a CNXML document against the XML Schema

To validate a CNXML document against the XML Schema, you must include the CNXML XML Schema in your document:

<?xml version="1.0" encoding="utf-8"?>

<document

      xmlns="http://cnx.rice.edu/cnxml"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="

            http://cnx.rice.edu/cnxml

            http://cnx.org/technology/cnxml/schema/xsd/0.5/cnxml.xsd">

</document>

XMLBlueprint XML Editor will automatically support XML Completion for your CNXML document based on the XML Schema. To validate your CNXML document, open it in XMLBlueprint XML Editor and click XML > Validate.