本文整理匯總了Java中org.w3c.dom.CharacterData.getData方法的典型用法代碼示例。如果您正苦於以下問題:Java CharacterData.getData方法的具體用法?Java CharacterData.getData怎麽用?Java CharacterData.getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.w3c.dom.CharacterData
的用法示例。
在下文中一共展示了CharacterData.getData方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
/**
* getDataFromElement - Make XML parsing a bit easier
* @param e XML Element
* @return XML data as a String
*/
public static String getDataFromElement(Element e) {
try {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
}
catch (Exception ex) {
logger.debug("Error in getDataFromElement");
logger.debug(ex.getMessage());
logger.debug(ex.getStackTrace());
}
return "";
}
示例2: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
return "";
}
示例3: convertToSoapText
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
protected TextImpl convertToSoapText(CharacterData characterData) {
final Node soapNode = getSoapDocument().findIfPresent(characterData);
if (soapNode instanceof TextImpl) {
return (TextImpl) soapNode;
} else {
TextImpl t = null;
switch (characterData.getNodeType()) {
case CDATA_SECTION_NODE:
t = new CDATAImpl(getSoapDocument(), characterData.getData());
break;
case COMMENT_NODE:
t = new SOAPCommentImpl(getSoapDocument(), characterData.getData());
break;
case TEXT_NODE:
t = new SOAPTextImpl(getSoapDocument(), characterData.getData());
break;
}
Node parent = getSoapDocument().find(characterData.getParentNode());
if (parent != null) {
parent.replaceChild(t, characterData);
} // XXX else throw an exception?
return t;
// return replaceElementWithSOAPElement(
// element,
// (ElementImpl) createElement(NameImpl.copyElementName(element)));
}
}
示例4: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
private String getCharacterDataFromElement(Element e) {
try {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
} catch (Exception ex) {
ex.printStackTrace();
}
return "";
}
示例5: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
/**
* Retrieve character data from an element if it exists
*
* @param e is the DOM Element to retrieve character data from
* @return the character data as String [possibly empty String]
*/
private static String getCharacterDataFromElement (Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
return "";
}
示例6: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
return"" ;
}
示例7: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
private String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
return "?";
}
示例8: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
return "";
}
示例9: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
/**
* convert the value of a given XML element to a string for further processing
*
* @param e
* XML Element
* @return the elements value converted to string
*/
private static String getCharacterDataFromElement(Element e) {
final Node child = e.getFirstChild();
if (child instanceof CharacterData) {
final CharacterData cd = (CharacterData) child;
return cd.getData();
}
return "";
}
示例10: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
org.w3c.dom.Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
return "?";
}
示例11: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
} else {
return "?";
}
}
示例12: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
org.w3c.dom.Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
} else {
return "?";
}
}
示例13: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
}
return "?";
}
示例14: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
String getCharacterDataFromElement(Element element)
{
Node child = element.getFirstChild();
if (child instanceof CharacterData) {
CharacterData characterData = (CharacterData) child;
return characterData.getData();
}
return "";
}
示例15: getCharacterDataFromElement
import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
private String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
} else {
return "?";
}
}