[R] Extract XMLAtrributeValue

Mohan.Radhakrishnan at cognizant.com Mohan.Radhakrishnan at cognizant.com
Mon Jul 10 09:03:59 CEST 2017


I am trying to extract an attribute value which is like this.

(e.g) class="whQuestion"

The 'extract' function prints this. But I am not sure how to get "whQuestion" from that. The type of 'x' in extract
is "character"

[1] "XMLAttributeValue"

extract <- function(x){

filteredclasses <-
classes <- xpathSApply(doc = posts, path = "/*/Posts/Post/@class", extract)

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.

	[[alternative HTML version deleted]]

More information about the R-help mailing list