xar namespaces

View: New views
1 Messages — Rating Filter:   Alert me  

xar namespaces

by Kevin Van Vechten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I propose that xar use xml namespaces[1] for its table of contents  
xml data.  This will help distinguish xar toc data from other xml  
that may reside in the same document, such as subdocs, etc.  It could  
also help with versioning down the road.

Nominally, this could be accomplished with only the following change  
to the root element, declaring a default namespace:
<xar xmlns="http://www.opendarwin.org/2006/xar/1.0">

Note, that the 1.0 in this namespace refers to the table of contents  
version (not the xar version) and should never be changed, unless a  
new table of contents is defined which is incompatible.  A simple  
string comparison of the namespace is all that's required for a xar  
implementation to determine whether this toc can be interpreted.


However, I think we could also take this a step further, and declare  
multiple namespaces, in order to group elements that are related to  
specific functionality.  This would visually group various elements  
together.  It could also be used by implementations as hints for  
which elements to interpret or to ignore based on their  
capabilities.  For example, we could define xar namespaces for "base"  
attributes, posix attributes, Mac OS X EAs, Linux EAs, FreeBSD EAs, etc.

This might look something like the following:

<xar xmlns="http://www.opendarwin.org/2006/xar/1.0"
                xmlns:posix="http://www.opendarwin.org/2006/xar/1.0/posix"
                xmlns:osxea="http://www.opendarwin.org/2006/xar/1.0/EA/macosx">
...
    <file id="76">
     <name>test</name>
     <type>file</type>
     <posix:mode>0775</posix:mode>
     <posix:uid>501</posix:uid>
     <user>bbraun</user>
     <posix:gid>0</posix:gid>
     <group>wheel</group>
     <posix:atime>2006-02-23T23:55:12Z</posix:atime>
     <posix:mtime>2006-02-23T23:42:08Z</posix:mtime>
     <posix:ctime>2006-02-23T23:42:38Z</posix:ctime>
    <osxea:ea>
     <osxea:com.apple.FinderInfo>
      <extracted-checksum  
style="md5">b723c401f9f3b5938dc0a0a1682081b2</extracted-checksum>
      <archived-checksum  
style="md5">9e129a07bfffd0d1abe4d0913f3def18</archived-checksum>
      <encoding style="application/x-gzip"/>
      <size>32</size>
      <offset>20</offset>
      <length>26</length>
     </osxea:com.apple.FinderInfo>
    </osxea:ea>
     <data>
      <extracted-checksum  
style="md5">02c432a9da4ddc514e3089344bc6caa1</extracted-checksum>
      <archived-checksum  
style="md5">689944ca69b36edc8e397674a280e257</archived-checksum>
      <encoding style="application/x-gzip"/>
      <size>2176</size>
      <offset>150359</offset>
      <length>956</length>
     </data>
    </file>

Thoughts, comments?

- Kevin

[1] http://www.w3.org/TR/1999/REC-xml-names-19990114/

_______________________________________________
xar mailing list
xar@...
http://www.opendarwin.org/mailman/listinfo/xar
LightInTheBox - Buy quality products at wholesale price!