Node dataNode; if (parent.tagName().equals(titleTag) || parent.tagName().equals(textareaTag)) dataNode = TextNode.createFromEncoded(text, baseUri); else // data not encoded but raw (for " in script) dataNode = new DataNode(text, baseUri);
Node dataNode; if (parent.tagName().equals(titleTag) || parent.tagName().equals(textareaTag)) dataNode = TextNode.createFromEncoded(text, baseUri); else // data not encoded but raw (for " in script) dataNode = new DataNode(text, baseUri);
Node dataNode; if (parent.tagName().equals(titleTag) || parent.tagName().equals(textareaTag)) dataNode = TextNode.createFromEncoded(text, baseUri); else // data not encoded but raw (for " in script) dataNode = new DataNode(text, baseUri);
/** * Break the text up by the first line delimiter. We only want annotations applied to the first line of a block of text * and not to a whole segment. * * @param text the text to turn into nodes * @param parent the parent node * @param annotation the current annotation to be applied to the first line of text */ private void addTextNodeToParent (String text, Element parent, AnnotationNode annotation) { String [] lines = new String[] {text}; if (annotation != null) lines = splitInTwo(text); for (int i = 0; i < lines.length; i++){ TextNode textNode = TextNode.createFromEncoded(lines[i], baseUri); lines(textNode, lines[i]); // apply the annotation and reset it to null if (annotation != null && i == 0) annotation.apply(textNode); // put the text node on the parent parent.appendChild(textNode); } }
/** * Break the text up by the first line delimiter. We only want annotations applied to the first line of a block of text * and not to a whole segment. * * @param text the text to turn into nodes * @param parent the parent node * @param annotation the current annotation to be applied to the first line of text */ private void addTextNodeToParent (String text, Element parent, AnnotationNode annotation) { String [] lines = new String[] {text}; if (annotation != null) lines = splitInTwo(text); for (int i = 0; i < lines.length; i++){ TextNode textNode = TextNode.createFromEncoded(lines[i], baseUri); lines(textNode, lines[i]); // apply the annotation and reset it to null if (annotation != null && i == 0) annotation.apply(textNode); // put the text node on the parent parent.appendChild(textNode); } }
/** * Break the text up by the first line delimiter. We only want annotations applied to the first line of a block of text * and not to a whole segment. * * @param text the text to turn into nodes * @param parent the parent node * @param annotation the current annotation to be applied to the first line of text */ private void addTextNodeToParent (String text, Element parent, AnnotationNode annotation) { String [] lines = new String[] {text}; if (annotation != null) lines = splitInTwo(text); for (int i = 0; i < lines.length; i++){ TextNode textNode = TextNode.createFromEncoded(lines[i], baseUri); lines(textNode, lines[i]); // apply the annotation and reset it to null if (annotation != null && i == 0) annotation.apply(textNode); // put the text node on the parent parent.appendChild(textNode); } }
private void parseTextNode() { String text = tq.consumeTo("<"); String annotationText = AnnotationParser.readAnnotation(text); text = AnnotationParser.stripAnnotation(text); if (text.length() > 0) { TextNode textNode = TextNode.createFromEncoded(text, baseUri); // if (pendingAnnotation != null) { pendingAnnotation.apply(textNode); } lines(textNode, text); add(textNode); } if (null != annotationText) { AnnotationNode annotation = new AnnotationNode(annotationText); lines(annotation, annotationText); add(annotation); } }
private void parseTextNode() { String rawText = tq.consumeTo("<"); String annotationText = AnnotationParser.readAnnotation(rawText); String text = AnnotationParser.stripAnnotation(rawText); if (text.length() > 0) { TextNode textNode = TextNode.createFromEncoded(text, baseUri); // if (pendingAnnotation != null) { pendingAnnotation.apply(textNode); } lines(textNode, rawText); add(textNode); } if (null != annotationText) { AnnotationNode annotation = new AnnotationNode(annotationText); lines(annotation, annotationText); add(annotation); } }
private void parseTextNode() { String rawText = tq.consumeTo("<"); String annotationText = AnnotationParser.readAnnotation(rawText); String text = AnnotationParser.stripAnnotation(rawText); if (text.length() > 0) { TextNode textNode = TextNode.createFromEncoded(text, baseUri); // if (pendingAnnotation != null) { pendingAnnotation.apply(textNode); } lines(textNode, rawText); add(textNode); } if (null != annotationText) { AnnotationNode annotation = new AnnotationNode(annotationText); lines(annotation, annotationText); add(annotation); } }