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

related CSS and XML questions (simple ones :-))

Expand Messages
  • andre m. winter
    hello, get/setStyle() isn t defined anymore in the ASV3 documentation. but it still works and as CSSStyleDefinitions all related methods seem correct. is this
    Message 1 of 4 , Jul 30, 2002
    • 0 Attachment
      hello,

      get/setStyle() isn't defined anymore in the ASV3 documentation. but it
      still works and as CSSStyleDefinitions all related methods seem correct.
      is this outdated, only not on the task list of adobe or how is this
      handled with SVG?

      tags: the difference between <bla/> and <bla /> (blank or not) ?

      thx
      andré
    • Kevin Lindsey
      André, ... Any element that inherits from SVGStylable has a style attribute. getStyle() and setStyle() access that same attribute. The style attribute is
      Message 2 of 4 , Jul 30, 2002
      • 0 Attachment
        André,

        > get/setStyle() isn't defined anymore in the ASV3 documentation. but it
        > still works and as CSSStyleDefinitions all related methods seem correct.
        > is this outdated, only not on the task list of adobe or how is this
        > handled with SVG?

        Any element that inherits from SVGStylable has a style attribute. getStyle() and setStyle() access that same attribute. The style attribute is defined as a CSSStyleDeclaration type (I cannot find CSSStyleDefinitions in the IDLs). CSSStyleDeclarations include getPropertyValue() and setProperty() methods.

        > tags: the difference between <bla/> and <bla /> (blank or not) ?

        Both are equivalent: an element with no children.

        Kevin
        KevLinDev - http://www.kevlindev.com


        [Non-text portions of this message have been removed]
      • andre m. winter
        kevin, ... i read about this, but in the time passing from ASV1 to ASV2 there were problems using getStyle(). general hint here: use getAttribute( style ) and
        Message 3 of 4 , Jul 31, 2002
        • 0 Attachment
          kevin,

          >Any element that inherits from SVGStylable has a style attribute. getStyle() and setStyle() access that same attribute. The style attribute is defined as a CSSStyleDeclaration type (I cannot find CSSStyleDefinitions in the IDLs). CSSStyleDeclarations include getPropertyValue() and setProperty() methods.
          >
          i read about this, but in the time passing from ASV1 to ASV2 there were
          problems using getStyle(). general hint here: use getAttribute('style')
          and so on. and http://www.adobe.com/svg/indepth/pdfs/CurrentSupport.pdf
          lists all possible methods but nothing about getStyle(), the older
          documentations did. so what happend?

          the story behind: i've troubles explaining our students in SVG-courses
          "complex" javascripts like

          var rect1 = SVGDoc.getElementById('myRect1');
          var rStyle = rect1.getStyle();
          var numProps = rStyle.getLength();
          for (var i=0; i<numProps; i++) {
          cProp = rStyle.item(i);
          cVal = rStyle.getPropertyValue(cProp);
          document.write(cProp+"=");
          document.write(cVal+"<br>");
          }

          >>tags: the difference between <bla/> and <bla /> (blank or not) ?
          >>
          >Both are equivalent: an element with no children.
          >
          and which one is the correct "orthography" from a strict XML point of view?

          thanks again in advance

          andré


          [Non-text portions of this message have been removed]
        • Kevin Lindsey
          Hi André, ... I started working with ASV 2, so I m not familiar with the problems between 1.0 to 2.0. ... The way I read their support document, it is still
          Message 4 of 4 , Aug 1, 2002
          • 0 Attachment
            Hi André,

            > i read about this, but in the time passing from ASV1 to ASV2 there were
            > problems using getStyle(). general hint here: use getAttribute('style')
            > and so on.

            I started working with ASV 2, so I'm not familiar with the problems between 1.0 to 2.0.


            > and http://www.adobe.com/svg/indepth/pdfs/CurrentSupport.pdf
            > lists all possible methods but nothing about getStyle(), the older
            > documentations did. so what happend?

            The way I read their support document, it is still there. They have a note in the document which states:

            'To work around this limitation, Adobe SVG Viewer
            supports additional "get/set" methods for each
            DOM interface attribute.'

            Since the SVGStylable interface has a "style" attribute, you still have getStyle() and setStyle().


            > the story behind: i've troubles explaining our students in SVG-courses
            > "complex" javascripts like
            >
            > var rect1 = SVGDoc.getElementById('myRect1');
            > var rStyle = rect1.getStyle();
            > var numProps = rStyle.getLength();
            > for (var i=0; i<numProps; i++) {
            > cProp = rStyle.item(i);
            > cVal = rStyle.getPropertyValue(cProp);
            > document.write(cProp+"=");
            > document.write(cVal+"<br>");
            > }

            These are all attributes and operations of the CSSStyleDeclaration interface. When you say:

            var rStyle = rect1.getStyle();

            this is equivalent to:

            var rStyle = rect1.style;

            The style property returns a CSSStyleDeclaration object. I'm sorry. I'm not sure where the confusion is.


            > > > tags: the difference between <bla/> and <bla /> (blank or not) ?
            > > Both are equivalent: an element with no children.
            > and which one is the correct "orthography" from a strict XML point of view?

            According to the XML 1.0 spec [1], the empty element is defined as:

            [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'

            Since S [2] is defined as:

            [3] S ::= (#x20 | #x9 | #xD | #xA)+

            forms with or without whitespace are spelled correctly.

            HTH,
            Kevin
            KevLinDev - http://www.kevlindev.com

            [1] http://www.w3c.org/TR/2000/REC-xml-20001006#dt-eetag
            [2] http://www.w3c.org/TR/2000/REC-xml-20001006#sec-common-syn


            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.