[rkward-devel] XML parser

meik michalke meik.michalke at uni-duesseldorf.de
Mon Aug 22 20:59:33 UTC 2011


hi,

a short update on the XML parser: i added two methods get content out of and 
into a node of a parsed XML file.

  install.packages("XiMpLe", repo="http://R.reaktanz.de")
  library(XiMpLe)

and then

  parsed.foo <- parseXMLTree("/path/to/some.pluginmap")

  # get info
  node(parsed.foo, node=list("document","about","author"),
    what="attributes", element="email")

  # change contents
  node(parsed.foo, node=list("document","about","author"),
    what="attributes", element="email") <- "new.address at example.com"


especially the latter is probably not yet as robust as it could be. there's 
some more options, like

  node(..., cond.attr=list(name="first author"))

so the only missing thing is a paste method, to write an XML object back to a 
readably formatted file. the full path to the original file is stored in the 
XML object, btw.


viele grüße :: m.eik

-- 
dipl. psych. meik michalke
institut f"ur experimentelle psychologie
abt. f"ur diagnostik und differentielle psychologie
heinrich-heine-universit"at d-40204 d"usseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20110822/c5ce775e/attachment.sig>


More information about the Rkward-devel mailing list