2009-11-15 Carsten Dominik <carsten.dominik@gmail.com>
* org-latex.el (org-export-as-latex): Add the :drawers property.
2009-11-15 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-speed-commands-user): Allow documentation headlines.
(org-speed-commands-default): Organize the value of this constant
with descriptive headlines.
(org-print-speed-command): Output the headlines.
2009-11-15 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-show-outline-path): New option.
(org-agenda-do-context-action): New function.
(org-agenda-next-line, org-agenda-previous-line): Use
`org-agenda-do-context-action'.
* org.el (org-use-speed-commands): Allow function value.
(org-speed-commands-default): Make headline motion safe, so that
these commands always end on a headline.
(org-speed-commands-default): New key `v' for `org-agenda'.
(org-speed-move-safe): New function.
(org-self-insert-command): Use the function value of
`org-use-speed-commands'.
(org-get-outline-path): Improve docstring.
(org-format-outline-path): New function.
(org-display-outline-path): New function.
2009-11-15 John Wiegley <jwiegley@gmail.com>
* org-clock.el (org-clock-resolve): If `org-clock-into-string' is
a string, use that to find the LOGBOOK drawer.
\input texinfo @c -*- texinfo -*-@c %**start of header@setfilename ../../info/nxml-mode@settitle nXML Mode@c %**end of header@copyingThis manual documents nxml-mode, an Emacs major mode for editingXML with RELAX NG support.Copyright @copyright{} 2007, 2008, 2009 Free Software Foundation, Inc.@quotationPermission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.3 orany later version published by the Free Software Foundation; with noInvariant Sections, with the Front-Cover texts being ``A GNUManual,'' and with the Back-Cover Texts as in (a) below. A copy of thelicense is included in the section entitled ``GNU Free DocumentationLicense'' in the Emacs manual.(a) The FSF's Back-Cover Text is: ``You have the freedom to copy andmodify this GNU manual. Buying copies from the FSF supports it indeveloping GNU and promoting software freedom.''This document is part of a collection distributed under the GNU FreeDocumentation License. If you want to distribute this documentseparately from the collection, you can do so by adding a copy of thelicense to the document, as described in section 6 of the license.@end quotation@end copying@dircategory Emacs@direntry* nXML Mode: (nxml-mode). XML editing mode with RELAX NG support.@end direntry@node Top@top nXML Mode@insertcopyingThis manual is not yet complete.@menu* Completion::* Inserting end-tags::* Paragraphs::* Outlining::* Locating a schema::* DTDs::* Limitations::@end menu@node Completion@chapter CompletionApart from real-time validation, the most important feature thatnxml-mode provides for assisting in document creation is "completion".Completion assists the user in inserting characters at point, based onknowledge of the schema and on the contents of the buffer beforepoint.The traditional GNU Emacs key combination for completion in abuffer is @kbd{M-@key{TAB}}. However, many window systemsand window managers use this key combination themselves (typically forswitching between windows) and do not pass it to applications. It'shard to find key combinations in GNU Emacs that are both easy to typeand not taken by something else. @kbd{C-@key{RET}} (i.e.pressing the Enter or Return key, while the Ctrl key is held down) isavailable. It won't be available on a traditional terminal (becauseit is indistinguishable from Return), but it will work with a windowsystem. Therefore we adopt the following solution by default: use@kbd{C-@key{RET}} when there's a window system and@kbd{M-@key{TAB}} when there's not. In the following, Iwill assume that a window system is being used and will thereforerefer to @kbd{C-@key{RET}}.Completion works by examining the symbol preceding point. Thisis the symbol to be completed. The symbol to be completed may be theempty. Completion considers what symbols starting with the symbol tobe completed would be valid replacements for the symbol to becompleted, given the schema and the contents of the buffer beforepoint. These symbols are the possible completions. An example maymake this clearer. Suppose the buffer looks like this (where @point{}indicates point):@example<html xmlns="http://www.w3.org/1999/xhtml"><h@point{}@end example@noindentand the schema is XHTML. In this context, the symbol to be completedis @samp{h}. The possible completions consist of just@samp{head}. Another example, is@example<html xmlns="http://www.w3.org/1999/xhtml"><head><@point{}@end example@noindentIn this case, the symbol to be completed is empty, and the possiblecompletions are @samp{base}, @samp{isindex},@samp{link}, @samp{meta}, @samp{script},@samp{style}, @samp{title}. Another example is:@example<html xmlns="@point{}@end example@noindentIn this case, the symbol to be completed is empty, and the possiblecompletions are just @samp{http://www.w3.org/1999/xhtml}.When you type @kbd{C-@key{RET}}, what happens dependson what the set of possible completions are.@itemize @bullet@itemIf the set of completions is empty, nothinghappens.@itemIf there is one possible completion, then that completion isinserted, together with any following characters that arerequired. For example, in this case:@example<html xmlns="http://www.w3.org/1999/xhtml"><@point{}@end example@noindent@kbd{C-@key{RET}} will yield@example<html xmlns="http://www.w3.org/1999/xhtml"><head@point{}@end example@itemIf there is more than one possible completion, but allpossible completions share a common non-empty prefix, then that prefixis inserted. For example, suppose the buffer is:@example<html x@point{}@end example@noindentThe symbol to be completed is @samp{x}. The possible completionsare @samp{xmlns} and @samp{xml:lang}. These share acommon prefix of @samp{xml}. Thus, @kbd{C-@key{RET}}will yield:@example<html xml@point{}@end example@noindentTypically, you would do @kbd{C-@key{RET}} again, which wouldhave the result described in the next item.@itemIf there is more than one possible completion, but thepossible completions do not share a non-empty prefix, then Emacs willprompt you to input the symbol in the minibuffer, initializing theminibuffer with the symbol to be completed, and popping up a buffershowing the possible completions. You can now input the symbol to beinserted. The symbol you input will be inserted in the buffer insteadof the symbol to be completed. Emacs will then insert any requiredcharacters after the symbol. For example, if it contains:@example<html xml@point{}@end example@noindentEmacs will prompt you in the minibuffer with@exampleAttribute: xml@point{}@end example@noindentand the buffer showing possible completions will contain@examplePossible completions are:xml:lang xmlns@end example@noindentIf you input @kbd{xmlns}, the result will be:@example<html xmlns="@point{}@end example@noindent(If you do @kbd{C-@key{RET}} again, the namespace URI willbe inserted. Should that happen automatically?)@end itemize@node Inserting end-tags@chapter Inserting end-tagsThe main redundancy in XML syntax is end-tags. nxml-mode providesseveral ways to make it easier to enter end-tags. You can use all ofthese without a schema.You can use @kbd{C-@key{RET}} after @samp{</}to complete the rest of the end-tag.@kbd{C-c C-f} inserts an end-tag for the element containingpoint. This command is useful when you want to input the start-tag,then input the content and finally input the end-tag. The @samp{f}is mnemonic for finish.If you want to keep tags balanced and input the end-tag at thesame time as the start-tag, before inputting the content, then you canuse @kbd{C-c C-i}. This inserts a @samp{>}, then insertsthe end-tag and leaves point before the end-tag. @kbd{C-c C-b}is similar but more convenient for block-level elements: it puts thestart-tag, point and the end-tag on successive lines, appropriatelyindented. The @samp{i} is mnemonic for inline and the@samp{b} is mnemonic for block.Finally, you can customize nxml-mode so that @kbd{/}automatically inserts the rest of the end-tag when it occurs after@samp{<}, by doing@display@kbd{M-x customize-variable @key{RET} nxml-slash-auto-complete-flag @key{RET}}@end display@noindentand then following the instructions in the displayed buffer.@node Paragraphs@chapter ParagraphsEmacs has several commands that operate on paragraphs, mostnotably @kbd{M-q}. nXML mode redefines these to work in a waythat is useful for XML. The exact rules that are used to find thebeginning and end of a paragraph are complicated; they are designedmainly to ensure that @kbd{M-q} does the right thing.A paragraph consists of one or more complete, consecutive lines.A group of lines is not considered a paragraph unless it contains somenon-whitespace characters between tags or inside comments. A blankline separates paragraphs. A single tag on a line by itself alsoseparates paragraphs. More precisely, if one tag together with anyleading and trailing whitespace completely occupy one or more lines,then those lines will not be included in any paragraph.A start-tag at the beginning of the line (possibly indented) maybe treated as starting a paragraph. Similarly, an end-tag at the endof the line may be treated as ending a paragraph. The following rulesare used to determine whether such a tag is in fact treated as aparagraph boundary:@itemize @bullet@itemIf the schema does not allow text at that point, then itis a paragraph boundary.@itemIf the end-tag corresponding to the start-tag is not atthe end of its line, or the start-tag corresponding to the end-tag isnot at the beginning of its line, then it is not a paragraphboundary. For example, in@example<p>This is a paragraph with an<emph>emphasized</emph> phrase.@end example@noindentthe @samp{<emph>} start-tag would not be considered asstarting a paragraph, because its corresponding end-tag is not at theend of the line.@itemIf there is text that is a sibling in element tree, thenit is not a paragraph boundary. For example, in@example<p>This is a paragraph with an<emph>emphasized phrase that takes one source line</emph>@end example@noindentthe @samp{<emph>} start-tag would not be considered asstarting a paragraph, even though its end-tag is at the end of itsline, because there the text @samp{This is a paragraph with an}is a sibling of the @samp{emph} element.@itemOtherwise, it is a paragraph boundary.@end itemize@node Outlining@chapter OutliningnXML mode allows you to display all or part of a buffer as anoutline, in a similar way to Emacs' outline mode. An outline in nXMLmode is based on recognizing two kinds of element: sections andheadings. There is one heading for every section and one section forevery heading. A section contains its heading as or within its firstchild element. A section also contains its subordinate sections (itssubsections). The text content of a section consists of anything in asection that is neither a subsection nor a heading.Note that this is a different model from that used by XHTML.nXML mode's outline support will not be useful for XHTML unless youadopt a convention of adding a @code{div} to enclose eachsection, rather than having sections implicitly delimited by different@code{h@var{n}} elements. This limitation may be removedin a future version.The variable @code{nxml-section-element-name-regexp} givesa regexp for the local names (i.e. the part of the name following anyprefix) of section elements. The variable@code{nxml-heading-element-name-regexp} gives a regexp for thelocal names of heading elements. For an element to be recognizedas a section@itemize @bullet@itemits start-tag must occur at the beginning of a line(possibly indented);@itemits local name must match@code{nxml-section-element-name-regexp};@itemeither its first child element or a descendant of thatfirst child element must have a local name that matches@code{nxml-heading-element-name-regexp}; the first such elementis treated as the section's heading.@end itemize@noindentYou can customize these variables using @kbd{M-xcustomize-variable}.There are three possible outline states for a section:@itemize @bullet@itemnormal, showing everything, including its heading, textcontent and subsections; each subsection is displayed according to thestate of that subsection;@itemshowing just its heading, with both its text content andits subsections hidden; all subsections are hidden regardless of theirstate;@itemshowing its heading and its subsections, with its textcontent hidden; each subsection is displayed according to the state ofthat subsection.@end itemizeIn the last two states, where the text content is hidden, theheading is displayed specially, in an abbreviated form. An elementlike this:@example<section><title>Food</title><para>There are many kinds of food.</para></section>@end example@noindentwould be displayed on a single line like this:@example<-section>Food...</>@end example@noindentIf there are hidden subsections, then a @code{+} will be usedinstead of a @code{-} like this:@example<+section>Food...</>@end example@noindentIf there are non-hidden subsections, then the section will instead bedisplayed like this:@example<-section>Food... <-section>Delicious Food...</> <-section>Distasteful Food...</></-section>@end example@noindentThe heading is always displayed with an indent that corresponds to itsdepth in the outline, even it is not actually indented in the buffer.The variable @code{nxml-outline-child-indent} controls how mucha subheading is indented with respect to its parent heading when theheading is being displayed specially.Commands to change the outline state of sections are bound tokey sequences that start with @kbd{C-c C-o} (@kbd{o} ismnemonic for outline). The third and final key has been chosen to beconsistent with outline mode. In the following descriptionscurrent section means the section containing point, or, more precisely,the innermost section containing the character immediately followingpoint.@itemize @bullet@item@kbd{C-c C-o C-a} shows all sections in the buffernormally.@item@kbd{C-c C-o C-t} hides the text contentof all sections in the buffer.@item@kbd{C-c C-o C-c} hides the text contentof the current section.@item@kbd{C-c C-o C-e} shows the text contentof the current section.@item@kbd{C-c C-o C-d} hides the text contentand subsections of the current section.@item@kbd{C-c C-o C-s} shows the current sectionand all its direct and indirect subsections normally.@item@kbd{C-c C-o C-k} shows the headings of thedirect and indirect subsections of the current section.@item@kbd{C-c C-o C-l} hides the text content of thecurrent section and of its direct and indirectsubsections.@item@kbd{C-c C-o C-i} shows the headings of thedirect subsections of the current section.@item@kbd{C-c C-o C-o} hides as much as possible withouthiding the current section's text content; the headings of ancestorsections of the current section and their child section sections willnot be hidden.@end itemizeWhen a heading is displayed specially, you can use@key{RET} in that heading to show the text content of the sectionin the same way as @kbd{C-c C-o C-e}.You can also use the mouse to change the outline state:@kbd{S-mouse-2} hides the text content of a section in the sameway as@kbd{C-c C-o C-c}; @kbd{mouse-2} on a speciallydisplayed heading shows the text content of the section in the sameway as @kbd{C-c C-o C-e}; @kbd{mouse-1} on a speciallydisplayed start-tag toggles the display of subheadings on andoff.The outline state for each section is stored with the firstcharacter of the section (as a text property). Every command thatchanges the outline state of any section updates the display of thebuffer so that each section is displayed correctly according to itsoutline state. If the section structure is subsequently changed, thenit is possible for the display to no longer correctly reflect thestored outline state. @kbd{C-c C-o C-r} can be used to refreshthe display so it is correct again.@node Locating a schema@chapter Locating a schemanXML mode has a configurable set of rules to locate a schema forthe file being edited. The rules are contained in one or more schemalocating files, which are XML documents.The variable @samp{rng-schema-locating-files} specifiesthe list of the file-names of schema locating files that nXML modeshould use. The order of the list is significant: when file@var{x} occurs in the list before file @var{y} then rulesfrom file @var{x} have precedence over rules from file@var{y}. A filename specified in@samp{rng-schema-locating-files} may be relative. If so, it willbe resolved relative to the document for which a schema is beinglocated. It is not an error if relative file-names in@samp{rng-schema-locating-files} do not exist. You can use@kbd{M-x customize-variable @key{RET} rng-schema-locating-files@key{RET}} to customize the list of schema locatingfiles.By default, @samp{rng-schema-locating-files} list has twomembers: @samp{schemas.xml}, and@samp{@var{dist-dir}/schema/schemas.xml} where@samp{@var{dist-dir}} is the directory containing the nXMLdistribution. The first member will cause nXML mode to use a file@samp{schemas.xml} in the same directory as the document beingedited if such a file exist. The second member contains rules for theschemas that are included with the nXML distribution.@menu* Commands for locating a schema::* Schema locating files::@end menu@node Commands for locating a schema@section Commands for locating a schemaThe command @kbd{C-c C-s C-w} will tell you what schemais currently being used.The rules for locating a schema are applied automatically whenyou visit a file in nXML mode. However, if you have just created a newfile and the schema cannot be inferred from the file-name, then thiswill not locate the right schema. In this case, you should insert thestart-tag of the root element and then use the command @kbd{C-cC-a}, which reapplies the rules based on the current content ofthe document. It is usually not necessary to insert the completestart-tag; often just @samp{<@var{name}} isenough.If you want to use a schema that has not yet been added to theschema locating files, you can use the command @kbd{C-c C-s C-f}to manually select the file contaiing the schema for the document incurrent buffer. Emacs will read the file-name of the schema from theminibuffer. After reading the file-name, Emacs will ask whether youwish to add a rule to a schema locating file that persistentlyassociates the document with the selected schema. The rule will beadded to the first file in the list specified@samp{rng-schema-locating-files}; it will create the file ifnecessary, but will not create a directory. If the variable@samp{rng-schema-locating-files} has not been customized, thismeans that the rule will be added to the file @samp{schemas.xml}in the same directory as the document being edited.The command @kbd{C-c C-s C-t} allows you to select a schema byspecifying an identifier for the type of the document. The schemalocating files determine the available type identifiers and whatschema is used for each type identifier. This is useful when it isimpossible to infer the right schema from either the file-name or thecontent of the document, even though the schema is already in theschema locating file. A situation in which this can occur is whenthere are multiple variants of a schema where all valid documents havethe same document element. For example, XHTML has Strict andTransitional variants. In a situation like this, a schema locating filecan define a type identifier for each variant. As with @kbd{C-cC-s C-f}, Emacs will ask whether you wish to add a rule to a schemalocating file that persistently associates the document with thespecified type identifier.The command @kbd{C-c C-s C-l} adds a rule to a schemalocating file that persistently associates the document withthe schema that is currently being used.@node Schema locating files@section Schema locating filesEach schema locating file specifies a list of rules. The rulesfrom each file are appended in order. To locate a schema each rule isapplied in turn until a rule matches. The first matching rule is thenused to determine the schema.Schema locating files are designed to be useful for otherapplications that need to locate a schema for a document. In fact,there is nothing specific to locating schemas in the design; it couldequally well be used for locating a stylesheet.@menu* Schema locating file syntax basics::* Using the document's URI to locate a schema::* Using the document element to locate a schema::* Using type identifiers in schema locating files::* Using multiple schema locating files::@end menu@node Schema locating file syntax basics@subsection Schema locating file syntax basicsThere is a schema for schema locating files in the file@samp{locate.rnc} in the schema directory. Schema locatingfiles must be valid with respect to this schema.The document element of a schema locating file must be@samp{locatingRules} and the namespace URI must be@samp{http://thaiopensource.com/ns/locating-rules/1.0}. Thechildren of the document element specify rules. The order of thechildren is the same as the order of the rules. Here's a completeexample of a schema locating file:@example<?xml version="1.0"?><locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/> <documentElement localName="book" uri="docbook.rnc"/></locatingRules>@end example@noindentThis says to use the schema @samp{xhtml.rnc} for a document withnamespace @samp{http://www.w3.org/1999/xhtml}, and to use theschema @samp{docbook.rnc} for a document whose local name is@samp{book}. If the document element had both a namespace URIof @samp{http://www.w3.org/1999/xhtml} and a local name of@samp{book}, then the matching rule that comes first will beused and so the schema @samp{xhtml.rnc} would be used. There isno precedence between different types of rule; the first matching ruleof any type is used.As usual with XML-related technologies, resources are identifiedby URIs. The @samp{uri} attribute identifies the schema byspecifying the URI. The URI may be relative. If so, it is resolvedrelative to the URI of the schema locating file that containsattribute. This means that if the value of @samp{uri} attributedoes not contain a @samp{/}, then it will refer to a filename inthe same directory as the schema locating file.@node Using the document's URI to locate a schema@subsection Using the document's URI to locate a schemaA @samp{uri} rule locates a schema based on the URI of thedocument. The @samp{uri} attribute specifies the URI of theschema. The @samp{resource} attribute can be used to specifythe schema for a particular document. For example,@example<uri resource="spec.xml" uri="docbook.rnc"/>@end example@noindentspecifies that the schema for @samp{spec.xml} is@samp{docbook.rnc}.The @samp{pattern} attribute can be used instead of the@samp{resource} attribute to specify the schema for any documentwhose URI matches a pattern. The pattern has the same syntax as anabsolute or relative URI except that the path component of the URI canuse a @samp{*} character to stand for zero or more characterswithin a path segment (i.e. any character other @samp{/}).Typically, the URI pattern looks like a relative URI, but, whereas arelative URI in the @samp{resource} attribute is resolved into aparticular absolute URI using the base URI of the schema locatingfile, a relative URI pattern matches if it matches some number ofcomplete path segments of the document's URI ending with the last pathsegment of the document's URI. For example,@example<uri pattern="*.xsl" uri="xslt.rnc"/>@end example@noindentspecifies that the schema for documents with a URI whose path endswith @samp{.xsl} is @samp{xslt.rnc}.A @samp{transformURI} rule locates a schema bytransforming the URI of the document. The @samp{fromPattern}attribute specifies a URI pattern with the same meaning as the@samp{pattern} attribute of the @samp{uri} element. The@samp{toPattern} attribute is a URI pattern that is used togenerate the URI of the schema. Each @samp{*} in the@samp{toPattern} is replaced by the string that matched thecorresponding @samp{*} in the @samp{fromPattern}. Theresulting string is appended to the initial part of the document's URIthat was not explicitly matched by the @samp{fromPattern}. Therule matches only if the transformed URI identifies an existingresource. For example, the rule@example<transformURI fromPattern="*.xml" toPattern="*.rnc"/>@end example@noindentwould transform the URI @samp{file:///home/jjc/docs/spec.xml}into the URI @samp{file:///home/jjc/docs/spec.rnc}. Thus, thisrule specifies that to locate a schema for a document@samp{@var{foo}.xml}, Emacs should test whether a file@samp{@var{foo}.rnc} exists in the same directory as@samp{@var{foo}.xml}, and, if so, should use it as theschema.@node Using the document element to locate a schema@subsection Using the document element to locate a schemaA @samp{documentElement} rule locates a schema based onthe local name and prefix of the document element. For example, a rule@example<documentElement prefix="xsl" localName="stylesheet" uri="xslt.rnc"/>@end example@noindentspecifies that when the name of the document element is@samp{xsl:stylesheet}, then @samp{xslt.rnc} should be usedas the schema. Either the @samp{prefix} or@samp{localName} attribute may be omitted to allow any prefix orlocal name.A @samp{namespace} rule locates a schema based on thenamespace URI of the document element. For example, a rule@example<namespace ns="http://www.w3.org/1999/XSL/Transform" uri="xslt.rnc"/>@end example@noindentspecifies that when the namespace URI of the document is@samp{http://www.w3.org/1999/XSL/Transform}, then@samp{xslt.rnc} should be used as the schema.@node Using type identifiers in schema locating files@subsection Using type identifiers in schema locating filesType identifiers allow a level of indirection in locating theschema for a document. Instead of associating the document directlywith a schema URI, the document is associated with a type identifier,which is in turn associated with a schema URI. nXML mode does notconstrain the format of type identifiers. They can be simply stringswithout any formal structure or they can be public identifiers orURIs. Note that these type identifiers have nothing to do with theDOCTYPE declaration. When comparing type identifiers, whitespace isnormalized in the same way as with the @samp{xsd:token}datatype: leading and trailing whitespace is stripped; other sequencesof whitespace are normalized to a single space character.Each of the rules described in previous sections that uses a@samp{uri} attribute to specify a schema, can instead use a@samp{typeId} attribute to specify a type identifier. The typeidentifier can be associated with a URI using a @samp{typeId}element. For example,@example<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> <namespace ns="http://www.w3.org/1999/xhtml" typeId="XHTML"/> <typeId id="XHTML" typeId="XHTML Strict"/> <typeId id="XHTML Strict" uri="xhtml-strict.rnc"/> <typeId id="XHTML Transitional" uri="xhtml-transitional.rnc"/></locatingRules>@end example@noindentdeclares three type identifiers @samp{XHTML} (representing thedefault variant of XHTML to be used), @samp{XHTML Strict} and@samp{XHTML Transitional}. Such a schema locating file woulduse @samp{xhtml-strict.rnc} for a document whose namespace is@samp{http://www.w3.org/1999/xhtml}. But it is considerablymore flexible than a schema locating file that simply specified@example<namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml-strict.rnc"/>@end example@noindentA user can easily use @kbd{C-c C-s C-t} to select between XHTMLStrict and XHTML Transitional. Also, a user can easily add a catalog@example<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> <typeId id="XHTML" typeId="XHTML Transitional"/></locatingRules>@end example@noindentthat makes the default variant of XHTML be XHTML Transitional.@node Using multiple schema locating files@subsection Using multiple schema locating filesThe @samp{include} element includes rules from anotherschema locating file. The behavior is exactly as if the rules fromthat file were included in place of the @samp{include} element.Relative URIs are resolved into absolute URIs before the inclusion isperformed. For example,@example<include rules="../rules.xml"/>@end example@noindentincludes the rules from @samp{rules.xml}.The process of locating a schema takes as input a list of schemalocating files. The rules in all these files and in the files theyinclude are resolved into a single list of rules, which are appliedstrictly in order. Sometimes this order is not what is needed.For example, suppose you have two schema locating files, a privatefile@example<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/></locatingRules>@end example@noindentfollowed by a public file@example<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> <transformURI pathSuffix=".xml" replacePathSuffix=".rnc"/> <namespace ns="http://www.w3.org/1999/XSL/Transform" typeId="XSLT"/></locatingRules>@end example@noindentThe effect of these two files is that the XHTML @samp{namespace}rule takes precedence over the @samp{transformURI} rule, whichis almost certainly not what is needed. This can be solved by addingan @samp{applyFollowingRules} to the private file.@example<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> <applyFollowingRules ruleType="transformURI"/> <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/></locatingRules>@end example@node DTDs@chapter DTDsnxml-mode is designed to support the creation of standalone XMLdocuments that do not depend on a DTD. Although it is common practiceto insert a DOCTYPE declaration referencing an external DTD, this hasundesirable side-effects. It means that the document is no longerself-contained. It also means that different XML parsers may interpretthe document in different ways, since the XML Recommendation does notrequire XML parsers to read the DTD. With DTDs, it was impractical toget validation without using an external DTD or reference to anparameter entity. With RELAX NG and other schema languages, you cansimulataneously get the benefits of validation and standalone XMLdocuments. Therefore, I recommend that you do not reference anexternal DOCTYPE in your XML documents.One problem is entities for characters. Typically, as well asproviding validation, DTDs also provide a set of character entitiesfor documents to use. Schemas cannot provide this functionality,because schema validation happens after XML parsing. The recommendedsolution is to either use the Unicode characters directly, or, if thisis impractical, use character references. nXML mode supports this byproviding commands for entering characters and character referencesusing the Unicode names, and can display the glyph corresponding to acharacter reference.@node Limitations@chapter LimitationsnXML mode has some limitations:@itemize @bullet@itemDTD support is limited. Internal parsed general entities declaredin the internal subset are supported provided they do not containelements. Other usage of DTDs is ignored.@itemThe restrictions on RELAX NG schemas in section 7 of the RELAX NGspecification are not enforced.@itemUnicode support has problems. This stems mostly from the fact thatthe XML (and RELAX NG) character model is based squarely on Unicode,whereas the Emacs character model is not. Emacs 22 is slated to havefull Unicode support, which should improve the situation here.@end itemize@bye@ignore arch-tag: 3b6e8ac2-ae8d-4f38-bd43-ce9f80be04d6@end ignore