-
Notifications
You must be signed in to change notification settings - Fork 84
IN_PROGRESS: Mutating/Creating nodes #76
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
Merged
Merged
Changes from all commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
19b65cd
Very basic modification of single nodes
jimhester 08468fb
Add functions to create new nodes / documents
jimhester c508fb6
Use actual maps for NsMap
jimhester 45e696c
Fix tests
jimhester 76142c6
Use indexes into vectors rather than pointers.
jimhester 4d7b4ed
Use proper size_type rather than assuming it will be size_t
jimhester 4c28ae4
Preserve input order.
jimhester 7dd28c6
Use boost unordered map
jimhester bb4411c
Remove BOOST_AUTO
jimhester 2770288
Current state
jimhester 06d02ea
node content assignment
jimhester 7709e66
Attribute assignment
jimhester d5d2557
Support unsetting attributes
jimhester 567d698
Support writing xml_attrs from a named vector
jimhester c84b4dc
Mode location of node_attrs
jimhester 6c090b5
Support xml_nodesets for xml_attrs modification
jimhester 56c6cb9
Add assignment method for xml_name
jimhester 8f6802e
xml_nodeset method
jimhester f840beb
Tests for xml_attr<- and xml_attrs<-
jimhester 5dd55b8
Errors found by tests
jimhester a8690f9
Tests for xml_contents
jimhester 8f05bb6
Tests for xml_name
jimhester fd31586
Rename xml_contents<- to xml_text<-
jimhester 2692009
Re-oxygenate
jimhester 08140e3
Simple modification vignette
jimhester 298d62b
Mode xml_name replacement function to the xml_name file
jimhester ad491b7
Add sibling nodes
jimhester 543aa77
Fix xml_name test
jimhester 0b104ed
Add xml_add_child
jimhester 7e4a566
Add missing test files
jimhester ad143cd
Have to load the library first
jimhester 7bc4384
Update documentation to fix WARNINGS
jimhester 9fc5130
Additional tests for the modification code
jimhester 7d2131b
Remove unused functions
jimhester 1dd3356
Both ns and value should be lists for xml_attrs<-.xml_nodeset
jimhester 361561c
ns should be a list for xml_name<-.xml_nodeset
jimhester 58e5bdd
Explain behavior of xml_attrs
jimhester 3fbeb6c
Move questions to the bottom
jimhester a657c0c
Use braces around UseMethod
jimhester f86e2f1
Use has_names
jimhester 6cb2d4c
Make xml_replace just a normal function
jimhester f9b7b0f
Document modification methods together
jimhester 6965191
Re-oxygenate
jimhester cbb8986
Adding a new node/document
jimhester 59b2ae7
Node and document creation functions
jimhester dcfbe1e
Include document pointer in xml_namespace object
jimhester 903e978
Tweaks to node creating plus simple example in vignette
jimhester 4eaf6e1
Free unlinked nodes
jimhester c2936d9
Draft of creating new namespaces and setting an existing namespace
jimhester e673249
Return invisibly
jimhester 526ba00
Use named character vector for xml_new_namespace
jimhester 93a4ce3
Export xml_new_node
jimhester ced5c4b
Export xml_new_document
jimhester f7db761
Creating nodes in a namespace
jimhester 391844b
Create new namespaces using xml_attr
jimhester 8019a56
Some cleanup
jimhester 1a3c368
Allow using xml_add_child on xml_document without a root node
jimhester 855b74e
Support adding text to a new node
jimhester f1d4cdf
Update tests
jimhester 179dc4f
Update vignette for new API
jimhester e2a8c68
xml_root to get the document from an xml_node
jimhester cef3f91
Only print node names if the document has a node
jimhester cf9a6f5
Re-oxygenate
jimhester c1a4c64
Rename modify.R
jimhester 6aca780
Remove xml_new_node and xml_new_namespace and fix documentation issues.
jimhester 5435f2a
Throw error if namespace is not found
jimhester 379d808
Move namespace lookup functions to namespace file
jimhester b4f46bb
Rename arguments to avoid namespace clashes
jimhester f7a0d49
Add magrittr in Suggests, as it is used in the vignette
jimhester 8e0a0e8
Only modify text nodes with xml_text<-
jimhester 52183af
Text for text creation
jimhester 29718a1
Tweaks to adding a new node to a document
jimhester e632d3c
Add a format option to write_xml
jimhester cd61f0f
Add an explicit free argument to xml_remove_node
jimhester File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ src/*.so | |
src/*.dll | ||
src/*.a | ||
src/Makevars | ||
inst/doc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
language: R | ||
cache: packages | ||
|
||
github_packages: jimhester/covr | ||
|
||
addons: | ||
apt: | ||
packages: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
`%||%` <- function(a, b) if (is.null(a)) b else a | ||
|
||
is_named <- function(x) { | ||
all(has_names(x)) | ||
} | ||
has_names <- function(x) { | ||
nms <- names(x) | ||
if (is.null(nms)) { | ||
rep(FALSE, length(x)) | ||
} else { | ||
!(is.na(nms) | nms == "") | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check this is not NULL, and elements not "" or NA? (You can just throw an error if not)