I'm working on example code for service document and stuck with the getting
workspace and collection titles. I appears there is a discrepancy in
specification support. E.g. javadoc for Workspace interfaces says:

 * <pre>
 *  The "app:workspace" element contains information elements about the
 *  collections of resources available for editing.  The app:workspace
 *  element MUST contain one or more app:collection elements.
 *
 *  appWorkspace =
 *     element app:workspace {
 *        appCommonAttributes,
 *        attribute title { text },
 *        ( appCollection+
 *          &amp; extensionElement* )
 *     }
 *

But if you look at the APP draft it is supposed to be:

   appWorkspace =
      element app:workspace {
         appCommonAttributes,
         ( atomTitle
           & appCollection*
           & extensionElement* )
      }

   atomTitle = element atom:title { atomTextConstruct }

The difference is that title is not an attribute but child node.
Implementation assumes that it is attribute and when I try to parse
following example from the draft:

8.1  Example

   <?xml version="1.0" encoding='utf-8'?>
   <service xmlns="http://purl.org/atom/app#";
            xmlns:atom="http://www.w3.org/2005/Atom";>
     <workspace>
       <atom:title>Main Site</atom:title>
       <collection
           href="http://example.org/reilly/main"; >
         <atom:title>My Blog Entries</atom:title>
         <categories
            href="http://example.com/cats/forMain.cats"; />
       </collection>
       <collection
           href="http://example.org/reilly/pic"; >
         <atom:title>Pictures</atom:title>
         <accept>image/*</accept>
       </collection>
     </workspace>
     <workspace>
       <atom:title>Side Bar Blog</atom:title>
       <collection
           href="http://example.org/reilly/list"; >
         <atom:title>Remaindered Links</atom:title>
         <accept>entry</accept>
         <categories fixed="yes">
           <atom:category
             scheme="http://example.org/extra-cats/";
             term="joke" />
           <atom:category
             scheme="http://example.org/extra-cats/";
             term="serious" />
         </categories>
       </collection>
     </workspace>
   </service>

I get nulls for workspace title. The same problem is with collection titles
as well. If I change FOMWorkspace implementation to:

  public String getTitle() {
    //return getAttributeValue(ATITLE);
          return getText(TITLE);
  }

everything works as expected.

Andrei



-- 
View this message in context: 
http://www.nabble.com/Specification-support-clarification-tf2596643.html#a7242948
Sent from the abdera-dev mailing list archive at Nabble.com.

Reply via email to