New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: xml validator / parser function or parameter #31

Closed
stephlocke opened this Issue May 11, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@stephlocke

stephlocke commented May 11, 2015

It would be very handy to have a function in this suite that tests whether a fragment is valid XML or HTML. Currently, you can only try performing a conversion and see if it errors or not.

xmlfrag<-"<foo><bar /></foot>"

## Additional function
if(xml_validate(xmlfrag)){
read_xml(xmlfrag)
}else{
print(xmlfrag)
}
## Extended read_xml
xmlresult<-read_xml(xmlfrag, check=TRUE) # Output a TRUE or FALSE
@jeroen

This comment has been minimized.

Member

jeroen commented Jun 6, 2015

@cboettig

This comment has been minimized.

cboettig commented Oct 26, 2015

It would be really nice if validation included schema validation, not just validating the XML. As I see it, the ability to actually check if a document obeys a specified schema is one of the main reasons for providing data in XML in the first place and not just in JSON (even though I suppose schemas are beginning to pop up there to).

Thanks for xml2 btw, avoiding segfaults is a beautiful thing! right now I guess XML is still our only option for serializing and validating though...

@jeroen

This comment has been minimized.

@hadley

This comment has been minimized.

Member

hadley commented May 4, 2016

I'd consider a pull request to implement this; otherwise it's unlikely to get high-enough on my priority list to implement.

@jeroen

This comment has been minimized.

Member

jeroen commented Dec 14, 2016

Added xml_validate in a8ca948 to validate xml 1.0 schemas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment