Loading ...
Sorry, an error occurred while loading the content.

XML:ID And Ethnicity - Multiple Attributes

Expand Messages
  • jamesd
    I am trying to make sense out of the xml:id tag and its usage as an attribute definer. Reading the web doesn t offer anything but contradictions. It seems that
    Message 1 of 5 , Oct 22, 2012
    • 0 Attachment
      I am trying to make sense out of the xml:id tag and its usage as an attribute definer. Reading the web doesn't offer anything but contradictions. It seems that some want it to go away, leaving no way to specify a common attributes, and just have a unique id be used.

      This leaves a non-politically correct person, like myself perplexed. If several SVG or CSS components have a common attribute, how do I group these elements by attribute? It would appear that the HTML name is being deprecated, I assumed that xml:id would be its replacement.

      I like to think of ethnicity in this regard. When I am asked my ID, I have a name. I also check the ethnicity of white. So, I have two distinct identifying characteristics.

      In my example for utilizing a singular display canvas for tablets and HDTV screens, I have grouped several <g> elements with unique ids, but with the same common denominator xml:id. This allows the display of the elements to be controlled by id and a common xml:id attribute at the same time. Makes sense to me, but others disagree, such as Opera.

      If xml:id is not meant to be used in this way, could someone try to explain how to keep the two identifiers, without using xml:id and without a complex javascript routine? Simplicity is best for me.

      Example file works with Firefox, Chrome and IE, not with Opera.

      http://sites.google.com/site/jcdsvg/use.svg

      Thanks;

      James
    • Jeff Schiller
      Use the class attribute? ... [Non-text portions of this message have been removed]
      Message 2 of 5 , Oct 22, 2012
      • 0 Attachment
        Use the class attribute?

        On Mon, Oct 22, 2012 at 3:48 PM, jamesd <jcdeering1@...> wrote:

        > **
        >
        >
        > I am trying to make sense out of the xml:id tag and its usage as an
        > attribute definer. Reading the web doesn't offer anything but
        > contradictions. It seems that some want it to go away, leaving no way to
        > specify a common attributes, and just have a unique id be used.
        >
        > This leaves a non-politically correct person, like myself perplexed. If
        > several SVG or CSS components have a common attribute, how do I group these
        > elements by attribute? It would appear that the HTML name is being
        > deprecated, I assumed that xml:id would be its replacement.
        >
        > I like to think of ethnicity in this regard. When I am asked my ID, I have
        > a name. I also check the ethnicity of white. So, I have two distinct
        > identifying characteristics.
        >
        > In my example for utilizing a singular display canvas for tablets and HDTV
        > screens, I have grouped several <g> elements with unique ids, but with the
        > same common denominator xml:id. This allows the display of the elements to
        > be controlled by id and a common xml:id attribute at the same time. Makes
        > sense to me, but others disagree, such as Opera.
        >
        > If xml:id is not meant to be used in this way, could someone try to
        > explain how to keep the two identifiers, without using xml:id and without a
        > complex javascript routine? Simplicity is best for me.
        >
        > Example file works with Firefox, Chrome and IE, not with Opera.
        >
        > http://sites.google.com/site/jcdsvg/use.svg
        >
        > Thanks;
        >
        > James
        >
        >
        >


        [Non-text portions of this message have been removed]
      • Erik Dahlstrom
        ... name and xml:id are not the same and were never meant to be the same, xml:id is essentially the id attribute but for any xml markup language. ...
        Message 3 of 5 , Oct 23, 2012
        • 0 Attachment
          On Tue, 23 Oct 2012 00:48:11 +0200, jamesd <jcdeering1@...> wrote:

          > I am trying to make sense out of the xml:id tag and its usage as an
          > attribute definer. Reading the web doesn't offer anything but
          > contradictions. It seems that some want it to go away, leaving no way to
          > specify a common attributes, and just have a unique id be used.
          >
          > This leaves a non-politically correct person, like myself perplexed. If
          > several SVG or CSS components have a common attribute, how do I group
          > these elements by attribute? It would appear that the HTML name is being
          > deprecated, I assumed that xml:id would be its replacement.

          'name' and 'xml:id' are not the same and were never meant to be the same,
          'xml:id' is essentially the 'id' attribute but for any xml markup language.

          > I like to think of ethnicity in this regard. When I am asked my ID, I
          > have a name. I also check the ethnicity of white. So, I have two
          > distinct identifying characteristics.
          >
          > In my example for utilizing a singular display canvas for tablets and
          > HDTV screens, I have grouped several <g> elements with unique ids, but
          > with the same common denominator xml:id. This allows the display of the
          > elements to be controlled by id and a common xml:id attribute at the
          > same time. Makes sense to me, but others disagree, such as Opera.
          >
          > If xml:id is not meant to be used in this way, could someone try to
          > explain how to keep the two identifiers, without using xml:id and
          > without a complex javascript routine? Simplicity is best for me.

          From SVG Tiny 1.2 (http://www.w3.org/TR/SVGTiny12/struct.html#idAttrs):
          [[ Because they are intended for different environments, the 'id' and
          'xml:id' attributes must not be used together on SVG elements in the same
          document. Such documents are not conforming SVG 1.2 Tiny content, and the
          behavior is not specified. ]]

          > Example file works with Firefox, Chrome and IE, not with Opera.

          Only Opera supports xml:id AFAIK- all the other browsers don't treat
          xml:id as an id attribute.

          I think xml:id is a historical mistake, so I'd strongly recommend you to
          avoid using that.

          Also see e.g https://bugs.webkit.org/show_bug.cgi?id=16505.

          --
          Erik Dahlstrom, Core Technology Developer, Opera Software
          Co-Chair, W3C SVG Working Group
          Personal blog: http://my.opera.com/macdev_ed
        • jamesd
          Thanks Jeff! I forgot entirely about the class attribute! I haven t used CSS in that manner in a very long time. Chrome, Firefox and now Opera work (haven t
          Message 4 of 5 , Oct 23, 2012
          • 0 Attachment
            Thanks Jeff! I forgot entirely about the class attribute! I haven't used CSS in that manner in a very long time. Chrome, Firefox and now Opera work (haven't checked IE) using this solution with a pure SVG file. Chrome and Firefox accept it in a HTML/SVG file, but Opera has so many problems displaying my HTML/SVG file that I don't know if it works or not.

            Seems odd that I can give an element class, even if it doesn't have any, no style definition needed, just the attribute itself.

            Don't know if this is the perfect solution, seems like a hack. Hope the writers of the specs are aware of this need. Otherwise we'll be stuck with an internet that is reliant only on separate pages for displaying content. Great for advertisers, not so for developers.

            Anyone else have a better solution?

            James

            --- In svg-developers@yahoogroups.com, Jeff Schiller <codedread@...> wrote:
            >
            > Use the class attribute?
          • jamesd
            I am prone to being oblivious to the obvious, something about the forest through the trees. Slept on it, Jeff s answer is dead on. A minor file tweak and style
            Message 5 of 5 , Oct 24, 2012
            • 0 Attachment
              I am prone to being oblivious to the obvious, something about the forest through the trees. Slept on it, Jeff's answer is dead on. A minor file tweak and style addition makes a simple method simpler. If anyone else is interested in portal files, class attribute is the key.

              Feel dumb, but satisfied.

              James

              --- In svg-developers@yahoogroups.com, Jeff Schiller <codedread@...> wrote:
              >
              > Use the class attribute?
            Your message has been successfully submitted and would be delivered to recipients shortly.