private final Nodes NONE = new Nodes();
private final Nodes NONE = new Nodes();
/** FIXME text - needs to trap/check values. * * @param text String content * @return Nodes */ public Nodes makeText(String text) { Nodes nodes = new Nodes(); nodes.append(new Text(text)); return nodes; } /** no-op.
public Nodes finishMakingElement(Element element) { flush(); try { serializer.writeEndTag(); } catch (IOException e) { throw new RuntimeException(e); } if (element.getParent() instanceof Document) { return new Nodes(element); } return NONE; }
public Nodes finishMakingElement(Element element) { flush(); try { serializer.writeEndTag(); } catch (IOException e) { throw new RuntimeException(e); } if (element.getParent() instanceof Document) { return new Nodes(element); } return NONE; }
/** callback from element end tag. * * @param element the context element * @return Nodes */ public Nodes finishMakingElement(Element element) { Element parent = stack.pop(); if (current instanceof CMLElement) { // trap exceptions, mainly due to semantics // still trying to work this out // try { ((CMLElement) current).finishMakingElement(parent); // } catch (RuntimeException e) { // LOG.warn("element throws semantic validation problem. " + // "Should be relocated to different places "+e.getMessage()); // } } current = parent; Nodes nodes = new Nodes(); nodes.append(element); return nodes; } /** callback from each attribute.
/** * Validates XML from nu.xom.Node against CML schema. * Throws exception if validation fails. * @param node * @throws IOException * @throws CMLException */ public void validateCML(nu.xom.Node node) throws IOException { ValidatorHandler handler = schema.newValidatorHandler(); SAXConverter converter = new SAXConverter(handler); try { converter.convert(new Nodes(node)); } catch (SAXException e) { throw new RuntimeException("not valid CML", e); } }
private final Nodes NONE = new Nodes(); private final NodeBuilder nodeBuilder = new NodeBuilder();
private final Nodes NONE = new Nodes(); private final NodeBuilder nodeBuilder = new NodeBuilder();
public static Nodes normalizeFormatting(final Nodes docs) { Nodes n = new Nodes(); for (int i = 0; i < docs.size(); i++) { n.append(normalizeFormatting(docs.get(i))); } return n; }
/** * <p> * Detaches all children from this node. * </p> * * @return a list of all the children removed in the order they * appeared in the element */ public Nodes removeChildren() { int length = this.getChildCount(); Nodes result = new Nodes(); for (int i = 0; i < length; i++) { Node child = getChild(0); this.removeChild(child); result.append(child); } return result; }
Nodes nodes = new Nodes(); Attribute attribute = null; int prefixLoc = attributeName.indexOf(":");
Element root = readStartTag(src, type); nodes = new Nodes(root); } else { // slow path Element root = readStartTagF(src, type, true);
Element root = readStartTag(src, type); nodes = new Nodes(root); } else { // slow path Element root = readStartTagF(src, type, true);