hi, to whom it may concern: i've added a first version of the new plugin2script() methods to rkwarddev in git. there's still a few quirks, but it is generally working better than i expected, and much sooner so, too. an example:
test.checkboxes <- rk.XML.row(
rk.XML.col(
list(
rk.XML.cbox(label="foo", value="foo1", chk=TRUE),
rk.XML.cbox(label="bar", value="bar2")
)
)
))
# this generates the following XML code -- already present XML files
# can be imported with parseXMLTree()
<row id="row_clmndc1212">
<column id="clm_chckbxdc12">
<checkbox id="chc_foo" label="foo" value="foo1" checked="true" />
<checkbox id="chc_bar" label="bar" value="bar2" />
</column>
</row>
# now we turn this back into rkwarddev script code
rkwarddevScript <- plugin2script(test.checkboxes)
# see the generated script code
cat(rkwarddevScript)
# gives you:
rkdev.row.row_clmndc1212 <- rk.XML.row(
rkdev.column.clm_chckbxdc12 <- rk.XML.col(
rkdev.checkbox.chc_foo <- rk.XML.cbox(
label="foo",
value="foo1",
chk=TRUE,
id.name="chc_foo"
),
rkdev.checkbox.chc_bar <- rk.XML.cbox(
label="bar",
value="bar2",
id.name="chc_bar"
),
id.name="clm_chckbxdc12"
),
id.name="row_clmndc1212"
)
# we can evaluate the generated code to check whether original
# XML and the newly generated one are identical
eval(parse(text=rkwarddevScript))
identical(rkdev.row.row_clmndc1212, test.checkboxes)
[1] TRUE
amongst the outstanding bugs are <logic> stuff, dealing with "<stretch />" and
a multiple comma issue in tabbook <tab>s. but since this thing is only
intended to give you a quick starting point for rkwarddev scripts this is
already something i can live with.
i've already parsed and re-generated the full "read CSV" plugin XML
successfully (after one minor change to the XML, parseXMLTree() doesn't like
"\" in the XML code). great fun ;-)
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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ rkward-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/rkward-devel
