本文整理了Java中com.sun.xml.txw2.output.XmlSerializer
类的一些代码示例,展示了XmlSerializer
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlSerializer
类的具体详情如下:
包路径:com.sun.xml.txw2.output.XmlSerializer
类名称:XmlSerializer
XmlSerializer介绍
[英]Low-level typeless XML writer driven from TypedXmlWriter.
Applications can use one of the predefined implementations to send TXW output to the desired location/format, or they can choose to implement this interface for custom output.
One XmlSerializer instance is responsible for writing one XML document.
Call Sequence TXW calls methods on this interface in the following order:
WHOLE_SEQUENCE := startDocument ELEMENT endDocument
ELEMENT := beginStartTag writeXmlns* writeAttribute* endStartTag CONTENT endTag
CONTENT := (text|ELEMENT)
TXW maintains all the in-scope namespace bindings and prefix allocation. The XmlSerializer implementation should just use the prefix specified.
[中]由TypedXmlWriter驱动的低级无类型XML编写器。
应用程序可以使用预定义的实现之一将TXW输出发送到所需的位置/格式,也可以选择实现此接口以进行自定义输出。
一个XmlSerializer实例负责编写一个XML文档。
调用序列TXW按以下顺序调用此接口上的方法:
WHOLE_SEQUENCE := startDocument ELEMENT endDocument
ELEMENT := beginStartTag writeXmlns* writeAttribute* endStartTag CONTENT endTag
CONTENT := (text|ELEMENT)
TXW维护所有范围内的命名空间绑定和前缀分配。XmlSerializer实现应该只使用指定的前缀。
代码示例
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public void beginStartTag(String uri, String localName, String prefix) {
serializer.beginStartTag(uri, localName, prefix);
}
代码示例来源:origin: com.sun.xml.bind/jaxb-core
public void onCdata(StringBuilder buffer) {
if(activeNamespaces!=null)
buffer = fixPrefix(buffer);
out.cdata(buffer);
}
代码示例来源:origin: org.glassfish.jaxb/txw2
public void onComment(StringBuilder buffer) {
if(activeNamespaces!=null)
buffer = fixPrefix(buffer);
out.comment(buffer);
}
代码示例来源:origin: com.sun.xml.bind/jaxb-core
out.startDocument();
out.beginStartTag(nsUri,localName,namespaces.prefix);
out.writeXmlns( ns.prefix, ns.uri );
if(a.nsUri.length()==0) prefix="";
else prefix=inscopeNamespace.getPrefix(a.nsUri);
out.writeAttribute( a.nsUri, a.localName, prefix, fixPrefix(a.value) );
out.endStartTag(nsUri,localName,namespaces.prefix);
代码示例来源:origin: com.sun.xml.ws/rt
@Override
public void endTag() {
serializer.endTag();
}
代码示例来源:origin: org.glassfish.jaxb/txw2
public void onPcdata(StringBuilder buffer) {
if(activeNamespaces!=null)
buffer = fixPrefix(buffer);
out.text(buffer);
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public void flush() {
serializer.flush();
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public void endDocument() {
serializer.endDocument();
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public void startDocument() {
serializer.startDocument();
comment(new StringBuilder(VERSION_COMMENT));
text(new StringBuilder("\n"));
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
serializer.writeAttribute(uri, localName, prefix, value);
}
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public void endStartTag(String uri, String localName, String prefix) {
serializer.endStartTag(uri, localName, prefix);
}
代码示例来源:origin: org.glassfish.jaxb/txw2
out.startDocument();
out.beginStartTag(nsUri,localName,namespaces.prefix);
out.writeXmlns( ns.prefix, ns.uri );
if(a.nsUri.length()==0) prefix="";
else prefix=inscopeNamespace.getPrefix(a.nsUri);
out.writeAttribute( a.nsUri, a.localName, prefix, fixPrefix(a.value) );
out.endStartTag(nsUri,localName,namespaces.prefix);
代码示例来源:origin: com.sun.xml.ws/jaxws-rt
@Override
public void endTag() {
serializer.endTag();
}
代码示例来源:origin: com.sun.xml.bind/jaxb-core
public void onPcdata(StringBuilder buffer) {
if(activeNamespaces!=null)
buffer = fixPrefix(buffer);
out.text(buffer);
}
代码示例来源:origin: com.sun.xml.bind/jaxb-core
void flush() {
out.flush();
}
代码示例来源:origin: com.sun.xml.bind/jaxb-core
public void onEndDocument() {
out.endDocument();
}
代码示例来源:origin: javaee/metro-jax-ws
@Override
public void startDocument() {
serializer.startDocument();
comment(new StringBuilder(VERSION_COMMENT));
text(new StringBuilder("\n"));
}
代码示例来源:origin: com.sun.xml.ws/rt
@Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
serializer.writeAttribute(uri, localName, prefix, value);
}
代码示例来源:origin: com.sun.xml.ws/rt
@Override
public void endStartTag(String uri, String localName, String prefix) {
serializer.endStartTag(uri, localName, prefix);
}
代码示例来源:origin: apache/servicemix-bundles
out.startDocument();
out.beginStartTag(nsUri,localName,namespaces.prefix);
out.writeXmlns( ns.prefix, ns.uri );
if(a.nsUri.length()==0) prefix="";
else prefix=inscopeNamespace.getPrefix(a.nsUri);
out.writeAttribute( a.nsUri, a.localName, prefix, fixPrefix(a.value) );
out.endStartTag(nsUri,localName,namespaces.prefix);