Jackrabbit Content Repository
  1. Jackrabbit Content Repository
  2. JCR-62

import must not ignore xml prefixed attributes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: xml
    • Labels:
      None

      Description

      XML import currently ignores attributes that are in the xml namespace.
      e.g., DocViewImportHandler's startElement():

      if (atts.getQName.startsWith("xml:"))

      { // skipping xml:space, xml:lang, etc. log.debug("skipping reserved/system attribute " + atts.getQName(i)); continue; }

      That is a significant loss of information, since xml:base, xml:lang, and xml:id attributes are critical to the content. We should register the xml prefix as a reserved namespace (not needing an xmlns declaration) and then treat it like any other attribute.

      Here are some useful XML examples:

      http://xformsinstitute.com/essentials/browse/ch03s02.php
      http://www.zvon.org/HowTo/Output/
      http://www.w3.org/Math/testsuite/testsuite/TortureTests/Complexity/complex1.xml
      http://intertwingly.net/wiki/pie/EchoExample
      http://support.sas.com/onlinedoc/913/getDoc/en/engxml.hlp/a002973381.htm

        Activity

        Hide
        Stefan Guggisberg added a comment -

        > That is a significant loss of information, since xml:base, xml:lang,
        > and xml:id attributes are critical to the content. We should register
        > the xml prefix as a reserved namespace (not needing an xmlns declaration)
        > and then treat it like any other attribute.

        i agree that those attributes need to be handled,
        however registering the xml prefix as a reserved
        namespace alone would IMO not solve the issue but
        introduce further problems.

        if e.g. "xml:lang" would be a legal property name
        and therefore "xml" a legal prefix in JCR, users
        could be e.g. tempted to use names such as "xml:data",
        "xml:foo" etc. those in turn would be illegal in
        the Document View XML representation
        (http://www.w3.org/TR/xml-names11/#xmlReserved).

        i think that this is a specification issue.
        the specification should be clear about how
        the reserved attributes xml:base, xml:lang etc
        are handled on Document View XML import.
        also, the handling of the "xml" namespace
        should be clearly defined.

        reassigning to peeter

        Show
        Stefan Guggisberg added a comment - > That is a significant loss of information, since xml:base, xml:lang, > and xml:id attributes are critical to the content. We should register > the xml prefix as a reserved namespace (not needing an xmlns declaration) > and then treat it like any other attribute. i agree that those attributes need to be handled, however registering the xml prefix as a reserved namespace alone would IMO not solve the issue but introduce further problems. if e.g. "xml:lang" would be a legal property name and therefore "xml" a legal prefix in JCR, users could be e.g. tempted to use names such as "xml:data", "xml:foo" etc. those in turn would be illegal in the Document View XML representation ( http://www.w3.org/TR/xml-names11/#xmlReserved ). i think that this is a specification issue. the specification should be clear about how the reserved attributes xml:base, xml:lang etc are handled on Document View XML import. also, the handling of the "xml" namespace should be clearly defined. reassigning to peeter
        Hide
        Peeter Piegaze added a comment -

        fixed in spec.

        Show
        Peeter Piegaze added a comment - fixed in spec.
        Hide
        Stefan Guggisberg added a comment -

        fixed in rev. 158098, anticipating related spec change in 0.16.4

        Show
        Stefan Guggisberg added a comment - fixed in rev. 158098, anticipating related spec change in 0.16.4
        Hide
        Stefan Guggisberg added a comment -

        closing resolved issue

        Show
        Stefan Guggisberg added a comment - closing resolved issue

          People

          • Assignee:
            Peeter Piegaze
            Reporter:
            Roy T. Fielding
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development