<?xml encoding="UTF-8" ?>

<!--
The contents of this file are subject to the terms of the Common Development
and Distribution License (the License). You may not use this file except in
compliance with the License.

You can obtain a copy of the License at http://www.netbeans.org/cddl.html
or http://www.netbeans.org/cddl.txt.

When distributing Covered Code, include this CDDL Header Notice in each file
and include the License file at http://www.netbeans.org/cddl.txt.
If applicable, add the following below the CDDL Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"

The Original Software is NetBeans. The Initial Developer of the Original
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
Microsystems, Inc. All Rights Reserved.
-->

<!---
  MIME component checking XML resource header, permitting matches against
  XML constructs: processing instructions, document type declarations, and root element (start tag).
  <p>
  <samp>PUBLIC "-//NetBeans//DTD MIME Resolver XML Rules 1.0//EN"</samp>
  </p>
  It should work well for:
  <dl>
  <dt>Well-formed document type detection</dt>
  <dd>Using: PIs, root element name and root element attributes.</dd>
  <dt>DTD-constrained document detection</dt>
  <dd>Using: PIs and DOCTYPE public IDs.</dd>
  <dt>NS-constrained documents</dt>
  <dd>Using: PIs and root element namespaces.</dd>
  </dl>
-->
<!ELEMENT xml-rule (pi*, doctype?, element?)>

<!---
  Processing instructions can be tested on target and pseudo-attributes.
  <p>
  It should be used for in-band tagging that is specified by some
  accepted specification. For NetBeans-specific tagging of third party standards it is
  recommended to use out-of-band tagging such as <code>FileObject</code> attributes.
  </p>
-->
<!ELEMENT pi (attr*) >
<!ATTLIST pi target CDATA #REQUIRED>

<!---
  Match one of the DOCTYPE's public IDs.
  Use of <code>public-id</code> subelements is mutually exclusive with the attribute.
-->
<!ELEMENT doctype (public-id*) >
<!ATTLIST doctype public-id CDATA #IMPLIED>

<!---
  A public ID is checked for an exact match.
-->
<!ELEMENT public-id EMPTY>
<!ATTLIST public-id id CDATA #REQUIRED>

<!---
  Matches a root element by specified name, attributes or namespace.
  <p>
  The namespace <code>ns</code> attribute or the presence of any <code>ns</code> subelements 
  implies that the <code>name</code> attribute represents a local element name,
  otherwise the <code>name</code> attribute represents a full element name ("QName").
  One of the namespaces must match.
  </p>
-->
<!ELEMENT element (ns*, attr*)>
<!ATTLIST element ns CDATA #IMPLIED>
<!ATTLIST element name CDATA #IMPLIED>

<!---
  Test namespace equality (exact match).
-->
<!ELEMENT ns EMPTY>
<!ATTLIST ns ns CDATA #REQUIRED>


<!---
  Element attribute template, also used for pseudo-attributes in processing instructions.
  <p>
  The <code>name</code> attribute contains the full attribute name (QName).
  This is inteded to be used for documents that cannot be indentified by public ID nor
  root element namespace.
  </p>
  If <code>text</code> is specified then the attribute's normalized text must
  exactly match the specified text, otherwise the attribute just needs to be present.
-->
<!ELEMENT attr EMPTY>
<!ATTLIST attr name CDATA #REQUIRED>
<!ATTLIST attr text CDATA #IMPLIED>
