A Python UPnP Media Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

348 lines
13 KiB

  1. UPnP Forum Technical Committee Yaron Y. Goland
  2. Document: draft-goland-fxpp-01.txt CrossGain
  3. Jeffrey C. Schlimmer
  4. Microsoft Corporation
  5. 19 June 2000
  6. Flexible XML Processing Profile (FXPP)
  7. Status of this Memo
  8. This document is under review by the UPnP Forum Technical Committee.
  9. It was previously submitted to the IETF as an Internet Draft and has
  10. expired. This document is formatted in a manner consistent with the
  11. IETF formatting guidelines to facilitate possible future
  12. consideration by the IETF.
  13. This document is available on http://www.upnp.org.
  14. Abstract
  15. This document provides an independent reference for the XML
  16. processing profile developed by the WebDAV WG in [RFC2518]. It does
  17. this by copying Section 14 and Appendix 4 as well as examples from
  18. Appendix 3 of [RFC2518] and editing out any WebDAV specific parts.
  19. This document also defines handling of unknown XML attributes.
  20. This information has been broken out into its own independent
  21. reference in order to make it easier for other standards to
  22. reference just the WebDAV XML processing profile without having to
  23. reference the entire WebDAV standard or require their readers to
  24. understand which parts of the profile are WebDAV specific and which
  25. parts are not.
  26. 1. Introduction
  27. This document provides an independent reference for the XML
  28. processing profile developed by the WebDAV WG in [RFC2518]. It does
  29. this by copying Section 14 and Appendix 4 as well as examples from
  30. Appendix 3 of [RFC2518] and editing out any WebDAV specific parts.
  31. This document also defines handling of unknown XML attributes.
  32. This information has been broken out into its own independent
  33. reference in order to make it easier for other standards to
  34. reference just the WebDAV XML processing profile without having to
  35. reference the entire WebDAV standard or require their readers to
  36. understand which parts of the profile are WebDAV specific and which
  37. parts are not.
  38. Goland, Schlimmer 1
  39. UPnP Forum FXPP 19 June 2000
  40. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  41. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in
  42. this document are to be interpreted as described in [RFC2119].
  43. 2. XML Support Requirement
  44. All FXPP compliant systems MUST support [XML].
  45. 3. XML Ignore Rule
  46. All FXPP compliant XML processors (a) MUST ignore any unknown XML
  47. element and all its children, and (b) MUST ignore any unknown XML
  48. attribute and its value. This rule may be overridden on an element-
  49. by-element or attribute-by-attribute basis, but implementers should
  50. be aware that systems unfamiliar with the element or attribute will
  51. follow the ignore rule.
  52. 4. XML Mime Type Support
  53. A FXPP compliant system MUST be able to both accept and send
  54. text/xml and application/xml.
  55. 5. Ordering of XML Elements
  56. Unless the definition of a XML element explicitly specifies
  57. otherwise the ordering of XML elements has no semantic significance
  58. to FXPP compliant systems.
  59. Note to Implementers - A generic FXPP compliant XML processor will
  60. not know which of the elements it is processing have meaningful
  61. ordering. As such, such processors need to maintain the order of
  62. the elements when presenting the parsed information so as not to
  63. loose any meaningful data.
  64. 6. XML Namespace Support
  65. All FXPP compliant systems MUST support the XML namespace extensions
  66. as specified in [REC-XML-NAMES].
  67. FXPP compliant XML processors MUST interpret a qualified name as a
  68. URI constructed by appending the LocalPart to the namespace name
  69. URI.
  70. Example
  71. <del:glider xmlns:del="http://www.del.jensen.org/">
  72. <del:glidername>
  73. Johnny Updraft
  74. </del:glidername>
  75. <del:glideraccidents/>
  76. </del:glider>
  77. Goland, Schlimmer 2
  78. UPnP Forum FXPP 19 June 2000
  79. In this example, the qualified element name "del:glider" is
  80. interpreted as the URL "http://www.del.jensen.org/glider".
  81. <bar:glider xmlns:bar="http://www.del.jensen.org/">
  82. <bar:glidername>
  83. Johnny Updraft
  84. </bar:glidername>
  85. <bar:glideraccidents/>
  86. </bar:glider>
  87. Even though this example is syntactically different from the
  88. previous example, it is semantically identical. Each instance of
  89. the namespace name "bar" is replaced with
  90. "http://www.del.jensen.org/" and then appended to the local name for
  91. each element tag. The resulting tag names in this example are
  92. exactly the same as for the previous example.
  93. <foo:r xmlns:foo="http://www.del.jensen.org/glide">
  94. <foo:rname>
  95. Johnny Updraft
  96. </foo:rname>
  97. <foo:raccidents/>
  98. </foo:r>
  99. This example is semantically identical to the two previous ones.
  100. Each instance of the namespace name "foo" is replaced with
  101. "http://www.del.jensen.org/glide" which is then appended to the
  102. local name for each element tag, the resulting tag names are
  103. identical to those in the previous examples.
  104. 7. XML Element Declaration Syntax
  105. The following format is recommended for FXPP compliant
  106. specifications as a means to provide uniform declaration of XML
  107. elements.
  108. Name:
  109. Namespace:
  110. Purpose:
  111. Value:
  112. DTD
  113. The name is the name of the XML element. The Namespace is the
  114. namespace the element belongs to. The purpose is a short
  115. description of the use of the XML element. As DTDs are not very
  116. good at expressing the format of characters inside of an XML element
  117. when an XML element needs to contain formatted pcdata the optional
  118. Value description will be used to provide a BNF for the character
  119. data. At the end of the template is the ELEMENT DTD declaration for
  120. the element.
  121. 8. Notes on Empty XML Elements
  122. Goland, Schlimmer 3
  123. UPnP Forum FXPP 19 June 2000
  124. XML supports two mechanisms for indicating that an XML element does
  125. not have any content. The first is to declare an XML element of the
  126. form <A></A>. The second is to declare an XML element of the form
  127. <A/>. The two XML elements are semantically identical.
  128. It is a violation of the XML specification to use the <A></A> form
  129. if the associated DTD declares the element to be EMPTY (e.g.,
  130. <!ELEMENT A EMPTY>). If such a statement is included, then the
  131. empty element format, <A/> must be used. If the element is not
  132. declared to be EMPTY, then either form <A></A> or <A/> may be used
  133. for empty elements.
  134. 9. Notes on Illegal XML Processing
  135. XML is a flexible data format that makes it easy to submit data that
  136. appears legal but in fact is not. The philosophy of "Be flexible in
  137. what you accept and strict in what you send" still applies, but it
  138. must not be applied inappropriately. XML is extremely flexible in
  139. dealing with issues of white space, element ordering, inserting new
  140. elements, etc. This flexibility does not require extension,
  141. especially not in the area of the meaning of elements.
  142. There is no kindness in accepting illegal combinations of XML
  143. elements. At best it will cause an unwanted result and at worst it
  144. can cause real damage.
  145. 9.1. Example - XML Syntax Error
  146. The following request body for a WebDAV PROPFIND method is illegal.
  147. <?xml version="1.0" encoding="utf-8" ?>
  148. <D:propfind xmlns:D="DAV:">
  149. <D:allprop/>
  150. <D:propname/>
  151. </D:propfind>
  152. The definition of the propfind element only allows for the allprop
  153. or the propname element, not both. Thus the above is an error and
  154. must be responded to with a 400 (Bad Request).
  155. Imagine, however, that a server wanted to be "kind" and decided to
  156. pick the allprop element as the true element and respond to it. A
  157. client running over a bandwidth limited line who intended to execute
  158. a propname would be in for a big surprise if the server treated the
  159. command as an allprop.
  160. Additionally, if a server were lenient and decided to reply to this
  161. request, the results would vary randomly from server to server, with
  162. some servers executing the allprop directive, and others executing
  163. the propname directive. This reduces interoperability rather than
  164. increasing it.
  165. Goland, Schlimmer 4
  166. UPnP Forum FXPP 19 June 2000
  167. 9.2. Example - Unknown XML Element
  168. The previous example was illegal because it contained two elements
  169. that were explicitly banned from appearing together in the propfind
  170. element. However, XML is an extensible language, so one can imagine
  171. new elements being defined for use with propfind. Below is the
  172. request body of a PROPFIND and, like the previous example, must be
  173. rejected with a 400 (Bad Request) by a server that does not
  174. understand the expired-props element.
  175. <?xml version="1.0" encoding="utf-8" ?>
  176. <D:propfind xmlns:D="DAV:"
  177. xmlns:E="http://www.foo.bar/standards/props/">
  178. <E:expired-props/>
  179. </D:propfind>
  180. To understand why a 400 (Bad Request) is returned let us look at the
  181. request body as the server unfamiliar with expired-props sees it.
  182. <?xml version="1.0" encoding="utf-8" ?>
  183. <D:propfind xmlns:D="DAV:"
  184. xmlns:E="http://www.foo.bar/standards/props/">
  185. </D:propfind>
  186. As the server does not understand the expired-props element,
  187. according to the WebDAV-specific XML processing rules specified in
  188. section 14 of [RFC 2518], it must ignore it. Thus the server sees
  189. an empty propfind, which by the definition of the propfind element
  190. is illegal.
  191. Please note that had the extension been additive it would not
  192. necessarily have resulted in a 400 (Bad Request). For example,
  193. imagine the following request body for a PROPFIND:
  194. <?xml version="1.0" encoding="utf-8" ?>
  195. <D:propfind xmlns:D="DAV:"
  196. xmlns:E="http://www.foo.bar/standards/props/">
  197. <D:propname/>
  198. <E:leave-out>*boss*</E:leave-out>
  199. </D:propfind>
  200. The previous example contains the fictitious element leave-out. Its
  201. purpose is to prevent the return of any property whose name matches
  202. the submitted pattern. If the previous example were submitted to a
  203. server unfamiliar with leave-out, the only result would be that the
  204. leave-out element would be ignored and a propname would be executed.
  205. 10. References
  206. [RFC2119] S. Bradner. Key words for use in RFCs to Indicate
  207. Requirement Levels. RFC 2119, March 1997.
  208. Goland, Schlimmer 5
  209. UPnP Forum FXPP 19 June 2000
  210. [RFC2068] R. Fielding, J. Gettys, J. Mogul, H. Frystyk, and T.
  211. Berners-Lee. Hypertext Transfer Protocol -- HTTP/1.1. RFC 2068,
  212. January 1997.
  213. [RFC2158] Y. Goland, E. Whitehead, A. Faizi, S. Carter, and D.
  214. Jensen. HTTP Extensions for Distributed Authoring WEBDAV. RFC 2518,
  215. February 1999.
  216. [XML] T. Bray, J. Paoli, C. M. Sperberg-McQueen, "Extensible Markup
  217. Language (XML)." World Wide Web Consortium Recommendation REC-xml-
  218. 19980210. http://www.w3.org/TR/1998/REC-xml-19980210.
  219. 11. Author's Addresses
  220. Yaron Y. Goland
  221. CrossGain
  222. 2039 152nd Avenue NE
  223. Redmond, WA 98052
  224. <mailto:yarongo@crossgain.com>
  225. Jeffrey C. Schlimmer
  226. Microsoft Corporation
  227. One Microsoft Way
  228. Redmond, WA 98052
  229. <mailto:jeffsch@Microsoft.com>
  230. Goland, Schlimmer 6