Example #1
0
 public void removeAttribute(String attributeName) {
   try {
     VEXElement element = this.getCurrentElement();
     if (element.getAttribute(attributeName) != null) {
       element.removeAttribute(attributeName);
     }
   } catch (DocumentValidationException ex) {
     ex.printStackTrace(); // TODO: when can this happen?
   }
 }
Example #2
0
 public void setAttribute(String attributeName, String value) {
   try {
     VEXElement element = this.getCurrentElement();
     if (value == null) {
       this.removeAttribute(attributeName);
     } else if (!value.equals(element.getAttribute(attributeName))) {
       element.setAttribute(attributeName, value);
     }
   } catch (DocumentValidationException ex) {
     ex.printStackTrace(); // TODO: mebbe throw the exception instead
   }
 }