Reputation: 1477
How to get this text isPermaLink="false" from guid?
<guid isPermaLink="false">article-67228311</guid>
I am using this library com.rometools.rome.feed.synd.SyndEntry. Is there a way to get value inside guid tag using this library? The below print statement prints the value as article-67228311, but I want to get isPermaLink="false" text.
Sample code:
try (CloseableHttpClient client = HttpClients.createMinimal()) {
HttpUriRequest request = new HttpGet(feedUrl);
try (CloseableHttpResponse response = client.execute(request); InputStream stream = response.getEntity().getContent()) {
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(stream));
Iterator iter = feed.getEntries().iterator();
while (iter.hasNext()) {
SyndEntry syndEntry = (SyndEntry) iter.next();
System.out.println("guid ========" + syndEntry.getUri());
}
}
}
Upvotes: 1
Views: 323