Examples of EntityRef


Examples of org.jdom.EntityRef

    public void writeComment(String text) throws IOException {
        this.currentElement.addContent(new Comment(text));
    }

    public void writeEntityRef(String name) throws IOException {
        this.currentElement.addContent(new EntityRef(name));
    }
View Full Code Here

Examples of org.jdom.EntityRef

      IInteger code = (IInteger) n.get(0);
      int c = java.lang.Integer.parseInt(code.getStringRepresentation());
      return new Text(new java.lang.String(Character.toChars(c)));
    }
    if (n.getConstructorType() == Factory.Node_entityRef) {
      return new EntityRef(((IString)n.get(0)).getValue());
    }

    java.lang.String text = ((IString)n.get(0)).getValue();
    if (n.getConstructorType() == Factory.Node_cdata) {
      return new CDATA(text);
View Full Code Here

Examples of org.jdom.EntityRef

      ProcessingInstruction pi = (ProcessingInstruction)content;
      IString data = vf.string(pi.getData());
      return vf.constructor(Factory.Node_pi, data);
    }
    if (content instanceof EntityRef) {
      EntityRef er = (EntityRef)content;
      IString data = vf.string(er.getName());
      return vf.constructor(Factory.Node_entityRef, data);
    }
    throw new AssertionError("cannot convert JDOM content type " + content.getClass());
  }
View Full Code Here

Examples of org.jdom.EntityRef

                    text = com.getText().trim();
                } else if (obj instanceof ProcessingInstruction) {
                    ProcessingInstruction pi = (ProcessingInstruction) obj;
                    text = pi.getData().trim();
                } else if (obj instanceof EntityRef) {
                    EntityRef er = (EntityRef) obj;
                    text = er.toString().trim();
                }
                if (StringUtils.isNotEmpty(text)) {
                    chaineConcat.append(text);
                    if (ls.size() == 1) {
                        return;
View Full Code Here

Examples of org.jdom.EntityRef

                    metadata.add(name, com.getText());
                } else if (node instanceof ProcessingInstruction) {
                    ProcessingInstruction pi = (ProcessingInstruction) node;
                    metadata.add(name, pi.getData());
                } else if (node instanceof EntityRef) {
                    EntityRef er = (EntityRef) node;
                    metadata.add(name, er.toString());
                }
            }
        } catch (JaxenException e) {
            logger.error(e.getMessage());
        }
View Full Code Here

Examples of org.jdom.EntityRef

            proxy.addContent(new ProcessingInstruction("a", ""));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
        try {
            proxy.addContent(new EntityRef("a"));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
        try {
            proxy.addContent(new Comment(""));
View Full Code Here

Examples of org.jdom.EntityRef

            proxy.removeContent(new ProcessingInstruction("a", ""));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
        try {
            proxy.removeContent(new EntityRef("a"));
            proxy.removeContent(new Comment(""));
            fail("Expected an UnsupportedOperationException");
        } catch (UnsupportedOperationException e) {
        }
        try {
View Full Code Here

Examples of org.jdom.EntityRef

    public void writeDTD(String arg0) throws XMLStreamException {

    }

    public void writeEntityRef(String ref) throws XMLStreamException {
        currentNode.addContent(new EntityRef(ref));
    }
View Full Code Here

Examples of org.jdom.EntityRef

                 * See org/xml/sax/ext/LexicalHandler.html#startEntity(java.lang.String)
                 * for more information
                 */
                if (!atRoot) {
                    flushCharacters();
                    EntityRef entity = factory.entityRef(name, pub, sys);

                    // no way to tell if the entity was from an attribute or element so just assume element
                    factory.addContent(getCurrentElement(), entity);
                }
                suppress = true;
View Full Code Here

Examples of org.jdom.EntityRef

                  element.addContent(new Comment(currentEvent.asCharacters().getData()));
                  break;
 
              case XMLStreamConstants.ENTITY_REFERENCE:
                EntityReference er = (EntityReference)currentEvent;
                  element.addContent(new EntityRef(er.getName(), er.getDeclaration().getPublicId(), er.getDeclaration().getSystemId()));
                break;
 
              case XMLStreamConstants.PROCESSING_INSTRUCTION:
                javax.xml.stream.events.ProcessingInstruction pi = (javax.xml.stream.events.ProcessingInstruction)currentEvent;
                  element.addContent(new ProcessingInstruction(pi.getTarget(), pi.getData()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.