Editorial fixes (no functional change)
svn path=/trunk/; revision=475
diff --git a/spec/chapters/resources.tex b/spec/chapters/resources.tex
index a82d60a..e073dd1 100644
--- a/spec/chapters/resources.tex
+++ b/spec/chapters/resources.tex
@@ -391,11 +391,11 @@
\end{itemize}
\item Sort $M$ in descending order as follows:
\begin{itemize}
-\item The primary key is the media type of input data. Methods whose \Consumes\ value most closely match the media type of the request are sorted first.
-\item The secondary key is the \Produces\ value. Methods whose value of \Produces\ most closely match the value of the request accept header are sorted first.
+\item The primary key is the media type of input data. Methods whose \Consumes\ value is the best match for the media type of the request are sorted first.
+\item The secondary key is the \Produces\ value. Methods whose value of \Produces\ best matches the value of the request accept header are sorted first.
\end{itemize}
-Sorting of media types follows the general rule: $\mbox{n/m} > \mbox{n/*} > \mbox{*/*}$, i.e. a method that explicitly consumes the request media type or produces one of the requested media types is sorted before a method that consumes or produces */*. Quality parameter values in the accept header are also considered such that methods that produce media types with a higher acceptable q-value are sorted ahead of those with a lower acceptable q-value (i.e. n/m;q=1.0 $>$ n/m;q=0.7) - see section 14.1 of \cite{http11} for more details.
+Determining the best matching media types follows the general rule: $\mbox{n/m} > \mbox{n/*} > \mbox{*/*}$, i.e. a method that explicitly consumes the request media type or produces one of the requested media types is sorted before a method that consumes or produces */*. Quality parameter values in the accept header are also considered such that methods that produce media types with a higher acceptable q-value are sorted ahead of those with a lower acceptable q-value (i.e. n/m;q=1.0 $>$ n/m;q=0.7) - see section 14.1 of \cite{http11} for more details.
\item \label{dispatch_method} The request is dispatched to the first Java method in the set\footnote{Step \ref{filter_methods} ensures the set contains at least one member.}.
\end{enumerate}
@@ -433,19 +433,18 @@
\item Obtain the acceptable media types $A$. If $A = \{\}$, set $A = \{\mbox{\lq*/*\rq}\}$
-\item Sort $A$ in descending order, with a primary key of q-value and secondary key of specificity ($\mbox{n/m} > \mbox{n/*} > \mbox{*/*}$).
-\item Sort $P$ in descending order, using specificity as the key ($\mbox{n/m} > \mbox{n/*} > \mbox{*/*}$).
-
\item Set $M=\{\}$. For each member of $A, a$:
\begin{itemize}
\item For each member of $P, p$:
\begin{itemize}
-\item If $a$ is compatible with $p$, add $S(a,p)$ to $M$, where the function $S$ returns the most specific media type of the supplied list.
+\item If $a$ is compatible with $p$, add $S(a,p)$ to $M$, where the function $S$ returns the most specific media type of the pair with the q-value of $a$.
\end{itemize}
\end{itemize}
\item If $M = \{\}$ then generate a \WebAppExc\ with a not acceptable response (HTTP 406 status) and no entity. The exception MUST be processed as described in section \ref{method_exc}. Finish.
+\item Sort $M$ in descending order, with a primary key of specificity ($\mbox{n/m} > \mbox{n/*} > \mbox{*/*}$) and secondary key of q-value.
+
\item For each member of $M, m$:
\begin{itemize}
\item If $m$ is a concrete type, set $M_{\mbox{selected}} = m$, finish.