gt:         return createLiveAnimatedNumber(ns, ln, def, false);
context: /*
  
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
     this work for additional information regarding copyright ownership.
     The ASF licenses this file to You under the Apache License, Version 2.0
     (the "License"); you may not use this file except in compliance with
     the License.  You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
  
   */
  package org.apache.batik.dom.svg;
  
  import java.util.Iterator;
  import java.util.LinkedList;
  
  import org.apache.batik.dom.anim.AnimationTarget;
  import org.apache.batik.dom.anim.AnimationTargetListener;
  import org.apache.batik.anim.values.AnimatableNumberOptionalNumberValue;
  import org.apache.batik.anim.values.AnimatableValue;
  import org.apache.batik.css.engine.CSSEngine;
  import org.apache.batik.css.engine.CSSNavigableNode;
  import org.apache.batik.css.engine.value.ShorthandManager;
  import org.apache.batik.css.engine.value.ValueManager;
  import org.apache.batik.dom.AbstractDocument;
  import org.apache.batik.dom.AbstractStylableDocument;
  import org.apache.batik.dom.util.DOMUtilities;
  import org.apache.batik.parser.UnitProcessor;
  import org.apache.batik.util.CSSConstants;
  import org.apache.batik.util.DoublyIndexedTable;
  import org.apache.batik.util.ParsedURL;
  import org.apache.batik.util.SVGTypes;
  
  import org.w3c.dom.Attr;
  import org.w3c.dom.DOMException;
  import org.w3c.dom.Element;
  import org.w3c.dom.Node;
  import org.w3c.dom.svg.SVGAnimatedInteger;
  import org.w3c.dom.svg.SVGAnimatedNumber;
  import org.w3c.dom.svg.SVGElement;
  import org.w3c.dom.svg.SVGException;
  import org.w3c.dom.svg.SVGFitToViewBox;
  import org.w3c.dom.svg.SVGLength;
  import org.w3c.dom.svg.SVGSVGElement;
  
  /**
   * This class implements the {@link SVGElement} interface.
   *
   * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
   * @version $Id$
   */
  public abstract class SVGOMElement
      extends    AbstractElement
      implements SVGElement,
                 ExtendedTraitAccess,
                 AnimationTarget {
  
      /**
       * Table mapping XML attribute names to TraitInformation objects.
       */
      protected static DoublyIndexedTable xmlTraitInformation;
      static {
          DoublyIndexedTable t = new DoublyIndexedTable();
          t.put(null, SVG_ID_ATTRIBUTE,
                  new TraitInformation(false, SVGTypes.TYPE_CDATA));
          t.put(XML_NAMESPACE_URI, XML_BASE_ATTRIBUTE,
                  new TraitInformation(false, SVGTypes.TYPE_URI));
          t.put(XML_NAMESPACE_URI, XML_SPACE_ATTRIBUTE,
                  new TraitInformation(false, SVGTypes.TYPE_IDENT));
          t.put(XML_NAMESPACE_URI, XML_ID_ATTRIBUTE,
                  new TraitInformation(false, SVGTypes.TYPE_CDATA));
          t.put(XML_NAMESPACE_URI, XML_LANG_ATTRIBUTE,
                  new TraitInformation(false, SVGTypes.TYPE_LANG));
          xmlTraitInformation = t;
      }
  
      /**
       * Is this element immutable?
       */
      protected transient boolean readonly;
  
      /**
       * The element prefix.
       */
      protected String prefix;
  
      /**
       * The SVG context to get SVG specific informations.
       */
      protected transient SVGContext svgContext;
  
      /**
       * Table mapping namespaceURI/local name pairs to {@link LinkedList}s
       * of {@link AnimationTargetListener}s.
       */
      protected DoublyIndexedTable targetListeners;
  
      /**
       * The context used to resolve the units.
       */
      protected UnitProcessor.Context unitContext;
  
      /**
       * Creates a new Element object.
       */
      protected SVGOMElement() {
      }
  
      /**
       * Creates a new Element object.
       * @param prefix The namespace prefix.
       * @param owner  The owner document.
       */
      protected SVGOMElement(String prefix, AbstractDocument owner) {
          super(prefix, owner);
          // initializeLiveAttributes();
      }
  
      /**
       * Initializes all live attributes for this element.
       */
      protected void initializeAllLiveAttributes() {
          // initializeLiveAttributes();
      }
  
  //     /**
  //       * Initializes the live attribute values of this element.
  //       */
  //      private void initializeLiveAttributes() {
  //          // If live attributes are added here, make sure to uncomment the
  //          // call to initializeLiveAttributes in the constructor and
  //          // initializeAllLiveAttributes method above.
  //      }
  
      /**
       * <b>DOM</b>: Implements {@link SVGElement#getId()}.
       */
      public String getId() {
          if (((SVGOMDocument) ownerDocument).isSVG12) {
              Attr a = getAttributeNodeNS(XML_NAMESPACE_URI, SVG_ID_ATTRIBUTE);
              if (a != null) {
                  return a.getNodeValue();
              }
          }
          return getAttributeNS(null, SVG_ID_ATTRIBUTE);
      }
  
      /**
       * <b>DOM</b>: Implements {@link SVGElement#setId(String)}.
       */
      public void setId(String id) {
          if (((SVGOMDocument) ownerDocument).isSVG12) {
              setAttributeNS(XML_NAMESPACE_URI, SVG_ID_ATTRIBUTE, id);
              Attr a = getAttributeNodeNS(null, SVG_ID_ATTRIBUTE);
              if (a != null) {
                  a.setNodeValue(id);
              }
          } else {
              setAttributeNS(null, SVG_ID_ATTRIBUTE, id);
          }
      }
  
      /**
       * <b>DOM</b>: Implements {@link SVGElement#getXMLbase()}.
       */
      public String getXMLbase() {
          return getAttributeNS(XML_NAMESPACE_URI, XML_BASE_ATTRIBUTE);
      }
  
      /**
       * <b>DOM</b>: Implements {@link SVGElement#setXMLbase(String)}.
       */
      public void setXMLbase(String xmlbase) throws DOMException {
          setAttributeNS(XML_NAMESPACE_URI, XML_BASE_QNAME, xmlbase);
      }
  
      /**
       * <b>DOM</b>: Implements {@link SVGElement#getOwnerSVGElement()}.
       */
      public SVGSVGElement getOwnerSVGElement() {
          for (Element e = CSSEngine.getParentCSSStylableElement(this);
               e != null;
               e = CSSEngine.getParentCSSStylableElement(e)) {
              if (e instanceof SVGSVGElement) {
                  return (SVGSVGElement)e;
              }
          }
          return null;
      }
  
      /**
       * <b>DOM</b>: Implements {@link SVGElement#getViewportElement()}.
       */
      public SVGElement getViewportElement() {
          for (Element e = CSSEngine.getParentCSSStylableElement(this);
               e != null;
               e = CSSEngine.getParentCSSStylableElement(e)) {
              if (e instanceof SVGFitToViewBox) {
                  return (SVGElement)e;
              }
          }
          return null;
      }
  
      /**
       * <b>DOM</b>: Implements {@link Node#getNodeName()}.
       */
      public String getNodeName() {
          if (prefix == null || prefix.equals("")) {
              return getLocalName();
          }
  
          return prefix + ':' + getLocalName();
      }
  
      /**
       * <b>DOM</b>: Implements {@link Node#getNamespaceURI()}.
       */
      public String getNamespaceURI() {
          return SVGDOMImplementation.SVG_NAMESPACE_URI;
      }
  
      /**
       * <b>DOM</b>: Implements {@link Node#setPrefix(String)}.
       */
      public void setPrefix(String prefix) throws DOMException {
          if (isReadonly()) {
              throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                       "readonly.node",
                                       new Object[] { new Integer(getNodeType()),
                                                      getNodeName() });
          }
          if (prefix != null &&
              !prefix.equals("") &&
              !DOMUtilities.isValidName(prefix)) {
              throw createDOMException(DOMException.INVALID_CHARACTER_ERR,
                                       "prefix",
                                       new Object[] { new Integer(getNodeType()),
                                                      getNodeName(),
                                                      prefix });
          }
          this.prefix = prefix;
      }
  
      /**
       * Returns the xml:base attribute value of the given element,
       * resolving any dependency on parent bases if needed.
       * Follows shadow trees when moving to parent nodes.
       */
      protected String getCascadedXMLBase(Node node) {
          String base = null;
          Node n = node.getParentNode();
          while (n != null) {
              if (n.getNodeType() == Node.ELEMENT_NODE) {
                  base = getCascadedXMLBase(n);
                  break;
              }
              if (n instanceof CSSNavigableNode) {
                  n = ((CSSNavigableNode) n).getCSSParentNode();
              } else {
                  n = n.getParentNode();
              }
          }
          if (base == null) {
              AbstractDocument doc;
              if (node.getNodeType() == Node.DOCUMENT_NODE) {
                  doc = (AbstractDocument) node;
              } else {
                  doc = (AbstractDocument) node.getOwnerDocument();
              }
              base = doc.getDocumentURI();
          }
          while (node != null && node.getNodeType() != Node.ELEMENT_NODE) {
              node = node.getParentNode();
          }
          if (node == null) {
              return base;
          }
          Element e = (Element) node;
          Attr attr = e.getAttributeNodeNS(XML_NAMESPACE_URI, XML_BASE_ATTRIBUTE);
          if (attr != null) {
              if (base == null) {
                  base = attr.getNodeValue();
              } else {
                  base = new ParsedURL(base, attr.getNodeValue()).toString();
              }
          }
          return base;
      }
  
      // SVGContext ////////////////////////////////////////////////////
  
      /**
       * Sets the SVG context to use to get SVG specific informations.
       *
       * @param ctx the SVG context
       */
      public void setSVGContext(SVGContext ctx) {
          svgContext = ctx;
      }
  
      /**
       * Returns the SVG context used to get SVG specific informations.
       */
      public SVGContext getSVGContext() {
          return svgContext;
      }
  
      // ExtendedNode //////////////////////////////////////////////////
  
      /**
       * Creates an SVGException with the appropriate error message.
       */
      public SVGException createSVGException(short type,
                                             String key,
                                             Object [] args) {
          try {
              return new SVGOMException
                  (type, getCurrentDocument().formatMessage(key, args));
          } catch (Exception e) {
              return new SVGOMException(type, key);
          }
      }
  
      /**
       * Tests whether this node is readonly.
       */
      public boolean isReadonly() {
          return readonly;
      }
  
      /**
       * Sets this node readonly attribute.
       */
      public void setReadonly(boolean v) {
          readonly = v;
      }
  
      /**
       * Returns the table of TraitInformation objects for this element.
       */
      protected DoublyIndexedTable getTraitInformationTable() {
          return xmlTraitInformation;
      }
  
      /**
       * Creates a new {@link SVGOMAnimatedTransformList} and stores it in
       * this element's LiveAttributeValue table.
       */
      protected SVGOMAnimatedTransformList createLiveAnimatedTransformList
              (String ns, String ln, String def) {
          SVGOMAnimatedTransformList v =
              new SVGOMAnimatedTransformList(this, ns, ln, def);
          liveAttributeValues.put(ns, ln, v);
          v.addAnimatedAttributeListener
              (((SVGOMDocument) ownerDocument).getAnimatedAttributeListener());
          return v;
      }
  
      /**
       * Creates a new {@link SVGOMAnimatedBoolean} and stores it in
       * this element's LiveAttributeValue table.
       */
      protected SVGOMAnimatedBoolean createLiveAnimatedBoolean
              (String ns, String ln, boolean def) {
          SVGOMAnimatedBoolean v =
              new SVGOMAnimatedBoolean(this, ns, ln, def);
          liveAttributeValues.put(ns, ln, v);
          v.addAnimatedAttributeListener
              (((SVGOMDocument) ownerDocument).getAnimatedAttributeListener());
          return v;
      }
  
      /**
       * Creates a new {@link SVGOMAnimatedString} and stores it in
       * this element's LiveAttributeValue table.
       */
      protected SVGOMAnimatedString createLiveAnimatedString
              (String ns, String ln) {
          SVGOMAnimatedString v =
              new SVGOMAnimatedString(this, ns, ln);
          liveAttributeValues.put(ns, ln, v);
          v.addAnimatedAttributeListener
              (((SVGOMDocument) ownerDocument).getAnimatedAttributeListener());
          return v;
      }
  
      /**
       * Creates a new {@link SVGOMAnimatedPreserveAspectRatio} and stores it in
       * this element's LiveAttributeValue table.
       */
      protected SVGOMAnimatedPreserveAspectRatio
              createLiveAnimatedPreserveAspectRatio() {
          SVGOMAnimatedPreserveAspectRatio v =
              new SVGOMAnimatedPreserveAspectRatio(this);
          liveAttributeValues.put(null, SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, v);
          v.addAnimatedAttributeListener
              (((SVGOMDocument) ownerDocument).getAnimatedAttributeListener());
          return v;
      }
  
      /**
       * Creates a new {@link SVGOMAnimatedMarkerOrientValue} and stores it in
       * this element's LiveAttributeValue table.
       */
      protected SVGOMAnimatedMarkerOrientValue
              createLiveAnimatedMarkerOrientValue(String ns, String ln) {
          SVGOMAnimatedMarkerOrientValue v =
              new SVGOMAnimatedMarkerOrientValue(this, ns, ln);
          liveAttributeValues.put(ns, ln, v);
          v.addAnimatedAttributeListener
              (((SVGOMDocument) ownerDocument).getAnimatedAttributeListener());
          return v;
      }
  
      /**
       * Creates a new {@link SVGOMAnimatedPathData} and stores it in
       * this element's LiveAttributeValue table.
       */
      protected SVGOMAnimatedPathData
              createLiveAnimatedPathData(String ns, String ln, String def) {
          SVGOMAnimatedPathData v =
              new SVGOMAnimatedPathData(this, ns, ln, def);
          liveAttributeValues.put(ns, ln, v);
          v.addAnimatedAttributeListener
              (((SVGOMDocument) ownerDocument).getAnimatedAttributeListener());
          return v;
      }
  
      /**
       * Creates a new {@link SVGOMAnimatedNumber} and stores it in
       * this element's LiveAttributeValue table.
       */
      protected SVGOMAnimatedNumber createLiveAnimatedNumber
              (String ns, String ln, float def) {
  