public List operate(Object node) { if (node instanceof Element) return Collections.singletonList(((Element) node).getNamespace().getPrefix()); else if (node instanceof Attribute) return Collections.singletonList(((Attribute) node).getNamespace().getPrefix()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsprefix can not be applied on " + node.getClass()); } }
public List operate(Object node) { if (node instanceof Element) return Collections.singletonList(((Element) node).getNamespace().getURI()); else if (node instanceof Attribute) return Collections.singletonList(((Attribute) node).getNamespace().getURI()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsuri can not be applied on " + node.getClass()); } }
public List operate(Object node) { if (node instanceof Element) { Element element = (Element) node; return Collections.singletonList(element.getNamespace().getURI() + element.getName()); } else if (node instanceof Attribute) { Attribute attribute = (Attribute) node; return Collections.singletonList(attribute.getNamespace().getURI() + attribute.getName()); } // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_cname can not be applied on " + node.getClass()); } }
Namespace attrNS = attribute.getNamespace();
protected void printQualifiedName(Writer out, Attribute a) throws IOException { String prefix = a.getNamespace().getPrefix(); if ((prefix != null) && (!prefix.equals(""))) { out.write(prefix); out.write(':'); } printName(out, a); }
private void printQualifiedName(Writer out, Attribute a) throws IOException { String prefix = a.getNamespace().getPrefix(); if ((prefix != null) && (!prefix.equals(""))) { out.write(prefix); out.write(':'); out.write(a.getName()); } else { out.write(a.getName()); } }
private void printQualifiedName(Writer out, Attribute a) throws IOException { String prefix=a.getNamespace().getPrefix(); if ((prefix != null) && (!prefix.equals(""))) { out.write(prefix); out.write(':'); out.write(a.getName()); } else { out.write(a.getName()); } }
public List operate(Object node) { if (node instanceof Element) return Collections.singletonList(((Element) node).getNamespace().getURI()); else if (node instanceof Attribute) return Collections.singletonList(((Attribute) node).getNamespace().getURI()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsuri can not be applied on " + node.getClass()); } }
/** * Return index of attribute with same name and Namespace, or * -1 if one doesn't exist */ private int indexOfDuplicate(Attribute attribute) { int duplicate = -1; String name = attribute.getName(); Namespace namespace = attribute.getNamespace(); duplicate = indexOf(name, namespace); return duplicate; }
private void printQualifiedName( Writer out, Attribute a ) throws IOException { String prefix = a.getNamespace().getPrefix(); if ( ( prefix != null ) && ( !prefix.equals( "" ) ) ) { out.write( prefix ); out.write( ':' ); out.write( a.getName() ); } else { out.write( a.getName() ); } }
public List operate(Object node) { if (node instanceof Element) return Collections.singletonList(((Element) node).getNamespace().getPrefix()); else if (node instanceof Attribute) return Collections.singletonList(((Attribute) node).getNamespace().getPrefix()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsprefix can not be applied on " + node.getClass()); } }
public List operate(Object node) { if (node instanceof Element) return Collections.singletonList(((Element) node).getNamespace().getPrefix()); else if (node instanceof Attribute) return Collections.singletonList(((Attribute) node).getNamespace().getPrefix()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsprefix can not be applied on " + node.getClass()); } }
public List operate(Object node) { if (node instanceof Element) return Collections.singletonList(((Element) node).getNamespace().getURI()); else if (node instanceof Attribute) return Collections.singletonList(((Attribute) node).getNamespace().getURI()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsuri can not be applied on " + node.getClass()); } }
public List operate(Object node) { if (node instanceof Element) { Element element = (Element) node; return Collections.singletonList(element.getNamespace().getURI() + element.getName()); } else if (node instanceof Attribute) { Attribute attribute = (Attribute) node; return Collections.singletonList(attribute.getNamespace().getURI() + attribute.getName()); } // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_cname can not be applied on " + node.getClass()); } }
public List operate(Object node) { if (node instanceof Element) { Element element = (Element) node; return Collections.singletonList(element.getNamespace().getURI() + element.getName()); } else if (node instanceof Attribute) { Attribute attribute = (Attribute) node; return Collections.singletonList(attribute.getNamespace().getURI() + attribute.getName()); } // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_cname can not be applied on " + node.getClass()); } }
/** * This detaches the <code>Attribute</code> from its parent, or does * nothing if the <code>Attribute</code> has no parent. * * @return <code>Attribute</code> - this <code>Attribute</code> modified. */ public Attribute detach() { final Element parentElement = getParent(); if (parentElement != null) { parentElement.removeAttribute(getName(),getNamespace()); } return this; }
public List operate(Object node) { if (node instanceof Element) return Collections12.singletonList(((Element)node).getNamespace().getURI()); else if (node instanceof Attribute) return Collections12.singletonList(((Attribute)node).getNamespace().getURI()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsuri can not be applied on " + node.getClass()); } }
public List operate(Object node) { if (node instanceof Element) return Collections12.singletonList(((Element)node).getNamespace().getPrefix()); else if (node instanceof Attribute) return Collections12.singletonList(((Attribute)node).getNamespace().getPrefix()); // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) return null; // throw new TemplateModelException("_nsprefix can not be applied on " + node.getClass()); } }
@SuppressWarnings("unchecked") static public void process_aput_object(Element element, InstructionUseInfo i) throws DataConversionException { i.requiresRetain.orEq(getDestReg(element, "vx").and(i.usesAsObj())); if (!i.requiresRetain.isEmpty()) { Element toAdd= new Element(cmd_a_release, vm); for (Attribute a : (List<Attribute>) i.Instruction.getAttributes()) { toAdd.setAttribute(a.getName(), a.getValue(), a.getNamespace()); } i.putRelease= toAdd; } i.isWrite= false; }
@SuppressWarnings("unchecked") static public void process_iput(Element element, InstructionUseInfo i) throws DataConversionException { i.requiresRetain.orEq(getDestReg(element, "vx").and(i.usesAsObj())); if (!i.requiresRetain.isEmpty()) { // need to release before we overwrite Element toAdd= new Element(cmd_i_release, vm); for (Attribute a : (List<Attribute>) i.Instruction.getAttributes()) { toAdd.setAttribute(a.getName(), a.getValue(), a.getNamespace()); } i.putRelease= toAdd; } i.isWrite= false; }