blob: e8feab4868a1a1d5faab824a1b6c19329a738002 [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!---
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>