Examples of writeAttribute()


Examples of org.apache.tuscany.sca.common.xml.stax.impl.XMLStreamSerializer.writeAttribute()

                                 String value) throws XMLStreamException {
        if (value == null) {
            return null;
        }
        XMLStreamSerializer serializer = new XMLStreamSerializer(isReparingNamespaces());
        return serializer.writeAttribute(writer, prefix, localName, namespaceURI, value);
    }

    public void writeStartElement(XMLStreamWriter writer, QName name) throws XMLStreamException {
        writeStartElement(writer, name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
    }
View Full Code Here

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

        stdXmlStreamWriter.writeNamespace("t4", "test4ns");

        xmlSecurityStreamWriter.writeStartElement("test4ns", "test4");
        stdXmlStreamWriter.writeStartElement("test4ns", "test4");

        xmlSecurityStreamWriter.writeAttribute("attr1", "attr1val");
        stdXmlStreamWriter.writeAttribute("attr1", "attr1val");

        xmlSecurityStreamWriter.writeAttribute("t2", "test2ns", "attr2", "attr2val");
        stdXmlStreamWriter.writeAttribute("t2", "test2ns", "attr2", "attr2val");
View Full Code Here

Examples of org.codehaus.jettison.AbstractXMLStreamWriter.writeAttribute()

       
        w.writeStartDocument();
        w.writeStartElement("", "a", "");

        w.writeStartElement("", "o", "");
        w.writeAttribute("class", "string");
        w.writeCharacters("1");
        w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
View Full Code Here

Examples of org.codehaus.jettison.badgerfish.BadgerFishXMLStreamWriter.writeAttribute()

       
        xsw.writeStartDocument();
        xsw.writeStartElement("Ratings");

        xsw.writeStartElement("Rating");
        xsw.writeAttribute("id", "100");
        xsw.writeAttribute("value", "3");
        xsw.writeEndElement();

        xsw.writeStartElement("Rating");
        xsw.writeAttribute("id", "200");
View Full Code Here

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

        sw.writeStartDocument();
        sw.writeComment("Comment!");
        sw.writeCharacters("\r");
        sw.writeStartElement("root");
        sw.writeAttribute("attr", "value");
        sw.writeAttribute("another", "this & that");
        //sw.writeAttribute("attr", "whatever"); // error!
        sw.writeStartElement(null, "elem");
        sw.writeCharacters("Sub-text");
        sw.writeEndElement();
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeAttribute()

    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    document.closeElement();
    document.closeElement();
    Assert.assertEquals("<g id=\"featureId\"><g style=\"my-super-style:true;\" id=\"featureId.styleId\"/></g>", writer.getBuffer().toString());
  }
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeAttribute()

    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    document.closeElement();
    document.closeElement();
    Assert.assertEquals("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:hlink=\"http://www.w3.org/1999/xlink\">" +
        "<g id=\"featureId\"><g style=\"my-super-style:true;\" id=\"featureId.styleId\"/></g>", writer.getBuffer().toString());
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeAttribute()

    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("g", true);
    document.writeId("featureId");
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    Assert.assertEquals("featureId.styleId", document.getCurrentId());
    document.flush();
    Assert.assertEquals("<g id=\"featureId\"><g style=\"my-super-style:true;\" id=\"featureId.styleId\"/></g>", writer.getBuffer().toString());
  }
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeAttribute()

    document.setRootId("bla");
    document.writeElement("g", true);
    document.writeId("featureId");
    Assert.assertEquals("bla.featureId", document.getCurrentId());
    document.writeElement("g", true);
    document.writeAttribute("style", "my-super-style:true;");
    document.writeId("styleId");
    Assert.assertEquals("bla.featureId.styleId", document.getCurrentId());
    document.closeElement();
    document.closeElement();
    Assert.assertEquals("<g id=\"bla.featureId\"><g style=\"my-super-style:true;\" id=\"bla.featureId.styleId\"/></g>", writer.getBuffer().toString());
View Full Code Here

Examples of org.geomajas.rendering.GraphicsDocument.writeAttribute()

  @Test
  public void escapeAttribute() throws Exception {
    StringWriter writer = new StringWriter();
    GraphicsDocument document = new DefaultSvgDocument(writer, false);
    document.writeElement("x", true);
    document.writeAttribute("bla", "<stop&go>");
    document.closeElement();
    Assert.assertEquals("<x bla=\"&lt;stop&amp;go&gt;\"/>", writer.getBuffer().toString());
  }
}
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.