![](/img/trans.png)
[英]Unable to execute 'DocumentBuilderFactory' in matlab
[英]DocumentBuilderFactory and operator
我試圖解析輸入'文本'行,並由於某種原因它擺脫了'。 它似乎全部被忽略了。 我該如何獲得這部分內容?
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
String input = "<status> <id>000000014</id> <created_at>2012/03/07</created_at><text>"Resolutionary" ...</text> <retweet_count>2</retweet_count> <user> <name>Siggi Eggertsson</name> <location>Berlin, Germany</location> <description></description> <url>http://www.siggieggertsson.com</url> </user> </status> ";
Document document = builder.parse(new InputSource(new StringReader(
input)));
String value = document.getElementsByTagName("id").item(0)
.getTextContent();
System.out.println(value);
當你打印出來
<text>"Resolutionary" ...</text>
將成為“具有決定性”......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.