Examples of writeEntityRef()


Examples of javax.xml.stream.XMLStreamWriter.writeEntityRef()

        if (type == Node.TEXT_NODE || type == SPACE_NODE) {
            writer.writeCharacters(this.getText());
        } else if (type == Node.CDATA_SECTION_NODE) {
            writer.writeCData(this.getText());
        } else if (type == Node.ENTITY_REFERENCE_NODE) {
            writer.writeEntityRef(this.getText());
        }
    }

    public String getText() {
        if (this.textValue != null) {
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEntityRef()

        if (type == Node.TEXT_NODE || type == SPACE_NODE) {
            writer.writeCharacters(this.getText());
        } else if (type == Node.CDATA_SECTION_NODE) {
            writer.writeCData(this.getText());
        } else if (type == Node.ENTITY_REFERENCE_NODE) {
            writer.writeEntityRef(this.getText());
        }
    }

    public String getText() {
        if (this.textValue != null) {
View Full Code Here

Examples of javax.xml.stream.XMLStreamWriter.writeEntityRef()

  @Test
  public void testWriteEntityRef() throws XMLStreamException {
    XMLStreamWriter writer = createXMLStreamWriter(false);
    writer.writeStartElement("foo");
    writer.writeEntityRef("bar");
    writer.writeEndElement();
    writer.flush();
    Assert.assertEquals("<foo>&bar;</foo>", writer.toString());
  }
}
View Full Code Here

Examples of org.apache.xml.security.stax.impl.XMLSecurityStreamWriter.writeEntityRef()

        stdXmlStreamWriter.writeComment("this is a comment");

        xmlSecurityStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);
        stdXmlStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);

        xmlSecurityStreamWriter.writeEntityRef("x0");
        stdXmlStreamWriter.writeEntityRef("x0");

        xmlSecurityStreamWriter.writeEndElement();
        stdXmlStreamWriter.writeEndElement();
View Full Code Here

Examples of org.apache.xml.security.stax.impl.XMLSecurityStreamWriter.writeEntityRef()

        stdXmlStreamWriter.writeComment("this is a comment");

        xmlSecurityStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);
        stdXmlStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);

        xmlSecurityStreamWriter.writeEntityRef("x0");
        stdXmlStreamWriter.writeEntityRef("x0");

        xmlSecurityStreamWriter.writeEndElement();
        stdXmlStreamWriter.writeEndElement();
View Full Code Here

Examples of org.apache.xml.security.stax.impl.XMLSecurityStreamWriter.writeEntityRef()

        stdXmlStreamWriter.writeComment("this is a comment");

        xmlSecurityStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);
        stdXmlStreamWriter.writeCharacters("abcdcba".toCharArray(), 3, 1);

        xmlSecurityStreamWriter.writeEntityRef("x0");
        stdXmlStreamWriter.writeEntityRef("x0");

        xmlSecurityStreamWriter.writeEndElement();
        stdXmlStreamWriter.writeEndElement();
View Full Code Here

Examples of org.codehaus.stax2.XMLStreamWriter2.writeEntityRef()

            // Then ENTITY
            sw = getDTDValidatingWriter(strw, dtdStr, nsAware, repairing);
            sw.writeStartElement("root");
            try {
                sw.writeEntityRef("amp");
                fail(modeDesc+" Expected a validation exception when trying to add CDATA into EMPTY content model");
            } catch (XMLValidationException vex) { }
            sw.close();

            // Then comment
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.