jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roy T. Fielding <field...@gbiv.com>
Subject xml:attribute names
Date Fri, 15 Oct 2004 18:13:09 GMT
> if it were possible to use use e.g. the prefix 'xml' in a jcr name 
> (i.e. name of node/property/node type), it wouldn't be possible to 
> export that content in xml format as the resulting xml would be 
> illegal.

Out of curiosity, how would a JCR repository map the elements and
attributes of a typical XML file if it were configured to break
the content into a tree structure?  I would think that we would
have a content tree that matched the document tree, such as the
following example

=====
<svg xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xml:lang="en"
      viewBox="0 0 640 480" preserveAspectRatio="xMidYMid meet">
<style type="text/css">...
=====
    svg
     |
     +--- xmlns                  "http://www.w3.org/2000/svg"
     +--- xmlns:xlink            "http://www.w3.org/1999/xlink"
     +--- xml:lang               "en"
     +--- viewBox                "0 0 640 480"
     +--- preserveAspectRatio    "xMidYMid meet"
     +--- nt:content
            |
            +---  style
                    |
                    +--- type    "text/css"
                    +--- nt:content
                           ...
=====

But that raises a number of questions:

   1) does jcr have a notion of an inherited namespace like xmlns,
      or does it require explicit typing of each node?

   2) do we need to hardcode namespace values for xml and xmlns?

   3) is the above a reasonable way to map XML elements and attributes?

An alternate mapping would be something like

    x:document
       x:element
           x:name       "svg"
           x:attrib
               x:name   "xmlns"
               x:value  "http://www.w3.org/2000/svg"
           x:attrib
               x:name   "xmlns:xlink"
               x:value  "http://www.w3.org/1999/xlink"
           x:attrib
               x:name   "xml:lang"
               x:value  "en"
           x:attrib
               x:name   "viewBox"
               x:value  "0 0 640 480"
           x:attrib
               x:name   "preserveAspectRatio"
               x:value  "xMidYMid meet"
           x:content
              x:element
                  x:name   "style"
                  x:attrib
                      x:name   "type"
                      x:value  "text/css"
                  x:content
                     ...

That places the namespace names in our content, which is much
less appealing for folks who want to use jcr as a front-end for
XML object stores.  News organizations like to store their content
as XML that is amenable to structured queries.

Is there "one true way" to do this, or does jackrabbit need to support
both ways (and possibly more)?

....Roy


Mime
View raw message