本文整理汇总了Java中org.xml.sax.ContentHandler.characters方法的典型用法代码示例。如果您正苦于以下问题:Java ContentHandler.characters方法的具体用法?Java ContentHandler.characters怎么用?Java ContentHandler.characters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.xml.sax.ContentHandler
的用法示例。
在下文中一共展示了ContentHandler.characters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeTo
import org.xml.sax.ContentHandler; //导入方法依赖的package包/类
public void writeTo(ContentHandler h, ErrorHandler errorHandler) throws SAXException {
String nsUri = getNamespaceURI();
String ln = getLocalPart();
h.startPrefixMapping("",nsUri);
h.startElement(nsUri,ln,ln,EMPTY_ATTS);
h.startElement(nsUri,actionLocalName,actionLocalName,EMPTY_ATTS);
h.characters(action.toCharArray(),0,action.length());
h.endElement(nsUri,actionLocalName,actionLocalName);
if (soapAction != null) {
h.startElement(nsUri,soapActionLocalName,soapActionLocalName,EMPTY_ATTS);
h.characters(soapAction.toCharArray(),0,soapAction.length());
h.endElement(nsUri,soapActionLocalName,soapActionLocalName);
}
h.endElement(nsUri,ln,ln);
}
示例2: writeTo
import org.xml.sax.ContentHandler; //导入方法依赖的package包/类
public void writeTo(ContentHandler h, ErrorHandler errorHandler) throws SAXException {
String nsUri = av.nsUri;
String ln = av.faultDetailTag.getLocalPart();
h.startPrefixMapping("",nsUri);
h.startElement(nsUri,ln,ln,EMPTY_ATTS);
h.startElement(nsUri,wrapper,wrapper,EMPTY_ATTS);
h.characters(problemValue.toCharArray(),0,problemValue.length());
h.endElement(nsUri,wrapper,wrapper);
h.endElement(nsUri,ln,ln);
}
示例3: writeTo
import org.xml.sax.ContentHandler; //导入方法依赖的package包/类
public void writeTo(ContentHandler h, ErrorHandler errorHandler) throws SAXException {
String nsUri = name.getNamespaceURI();
String ln = name.getLocalPart();
h.startPrefixMapping("",nsUri);
if(mustUnderstand) {
AttributesImpl attributes = new AttributesImpl();
attributes.addAttribute(soapVersion.nsUri,MUST_UNDERSTAND,"S:"+MUST_UNDERSTAND,"CDATA", getMustUnderstandLiteral(soapVersion));
h.startElement(nsUri,ln,ln,attributes);
} else {
h.startElement(nsUri,ln,ln,EMPTY_ATTS);
}
h.characters(value.toCharArray(),0,value.length());
h.endElement(nsUri,ln,ln);
}
示例4: addSaxString
import org.xml.sax.ContentHandler; //导入方法依赖的package包/类
/**
* Add a SAX tag with a string inside.
*
* @param contentHandler the SAX content handler
* @param tag the element tag to use
* @param val the string to put inside the tag
*/
public static void addSaxString(ContentHandler contentHandler,
String tag, String val) throws SAXException {
contentHandler.startElement("", "", tag, new AttributesImpl());
char c[] = mangleXmlString(val, false).toCharArray();
contentHandler.characters(c, 0, c.length);
contentHandler.endElement("", "", tag);
}