mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.3.4.1'
This commit is contained in:
@@ -27,12 +27,12 @@ public class Gfs_Date_tst {
|
||||
fx.tst_MsgStr(fx.msg_(String_.Ary("Date_", "Now")), DateAdp_.parse_gplx("2001-01-01 00:00:00.000"));
|
||||
}
|
||||
@Test public void Add_day() {
|
||||
fx.tst_MsgStr(fx.msg_(String_.Ary("Date_", "Now", "Add_day"), KeyVal_.new_("days", 1)), DateAdp_.parse_gplx("2001-01-02 00:00:00.000"));
|
||||
fx.tst_MsgStr(fx.msg_(String_.Ary("Date_", "Now", "Add_day"), Keyval_.new_("days", 1)), DateAdp_.parse_gplx("2001-01-02 00:00:00.000"));
|
||||
}
|
||||
}
|
||||
class GfsCoreFxt {
|
||||
public GfsCore Core() {return core;} GfsCore core = GfsCore.new_();
|
||||
public GfoMsg msg_(String[] ary, KeyVal... kvAry) {return GfoMsg_.root_leafArgs_(ary, kvAry);}
|
||||
public GfoMsg msg_(String[] ary, Keyval... kvAry) {return GfoMsg_.root_leafArgs_(ary, kvAry);}
|
||||
public void AddObj(GfoInvkAble invk, String s) {core.AddObj(invk, s);}
|
||||
public void tst_MsgStr(GfoMsg msg, Object expd) {
|
||||
GfsCtx ctx = GfsCtx.new_();
|
||||
|
||||
@@ -57,14 +57,14 @@ public class Xpath_ {
|
||||
}
|
||||
}
|
||||
public static final String InnetTextKey = "&innerText";
|
||||
public static KeyValHash ExtractKeyVals(String xml, Int_obj_ref posRef, String nodeName) {
|
||||
public static Keyval_hash ExtractKeyVals(String xml, Int_obj_ref posRef, String nodeName) {
|
||||
int pos = posRef.Val();
|
||||
Err xmlErr = Err_.new_wo_type("error parsing xml", "xml", xml, "pos", pos);
|
||||
String headBgnFind = "<" + nodeName + " "; int headBgnFindLen = String_.Len(headBgnFind);
|
||||
int headBgn = String_.FindFwd(xml, headBgnFind, pos); if (headBgn == String_.Find_none) return null;
|
||||
int headEnd = String_.FindFwd(xml, ">", headBgn + headBgnFindLen); if (headEnd == String_.Find_none) throw xmlErr;
|
||||
String atrXml = String_.Mid(xml, headBgn, headEnd);
|
||||
KeyValHash rv = ExtractNodeVals(atrXml, xmlErr);
|
||||
Keyval_hash rv = ExtractNodeVals(atrXml, xmlErr);
|
||||
boolean noInnerText = String_.CharAt(xml, headEnd - 1) == '/'; // if />, then no inner text
|
||||
if (!noInnerText) {
|
||||
int tail = String_.FindFwd(xml, "</" + nodeName + ">", headBgn); if (tail == String_.Find_none) throw Err_.new_wo_type("could not find tailPos", "headBgn", headBgn);
|
||||
@@ -74,8 +74,8 @@ public class Xpath_ {
|
||||
posRef.Val_(headEnd);
|
||||
return rv;
|
||||
}
|
||||
static KeyValHash ExtractNodeVals(String xml, Err xmlErr) {
|
||||
KeyValHash rv = KeyValHash.new_();
|
||||
static Keyval_hash ExtractNodeVals(String xml, Err xmlErr) {
|
||||
Keyval_hash rv = new Keyval_hash();
|
||||
int pos = 0;
|
||||
while (true) {
|
||||
int eqPos = String_.FindFwd(xml, "=", pos); if (eqPos == String_.Find_none) break;
|
||||
|
||||
Reference in New Issue
Block a user