|
@@ -42,6 +42,30 @@ namespace Spry {
|
|
|
return _instance;
|
|
return _instance;
|
|
|
}}
|
|
}}
|
|
|
|
|
|
|
|
|
|
+ protected MarkupNodeList get_elements_by_class_name(string class_name) {
|
|
|
|
|
+ return instance.get_elements_by_class_name(class_name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected MarkupNodeList get_elements_by_tag_name(string tag_name) {
|
|
|
|
|
+ return instance.get_elements_by_tag_name(tag_name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected new MarkupNodeList query(string xpath) {
|
|
|
|
|
+ return instance.select(xpath);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected MarkupNode? query_one(string xpath) {
|
|
|
|
|
+ return instance.select_one(xpath);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected MarkupNode get_element_by_global_id(string global_id) {
|
|
|
|
|
+ return instance.get_element_by_id(global_id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected new MarkupNode? @get(string spry_id) {
|
|
|
|
|
+ return instance.select_one(@"//*[@sid='$(spry_id)']");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
protected void add_outlet_child(string outlet_id, Component component) {
|
|
protected void add_outlet_child(string outlet_id, Component component) {
|
|
|
_children.add(outlet_id, component);
|
|
_children.add(outlet_id, component);
|
|
|
}
|
|
}
|
|
@@ -69,7 +93,7 @@ namespace Spry {
|
|
|
var outlets = final_instance.select("//spry-outlet");
|
|
var outlets = final_instance.select("//spry-outlet");
|
|
|
foreach (var outlet in outlets) {
|
|
foreach (var outlet in outlets) {
|
|
|
print(@"loop $(outlet.id)\n");
|
|
print(@"loop $(outlet.id)\n");
|
|
|
- var nodes = _children.get_or_empty(outlet.id)
|
|
|
|
|
|
|
+ var nodes = _children.get_or_empty(outlet.get_attribute("sid"))
|
|
|
.attempt_select<MarkupDocument>(c => c.to_document())
|
|
.attempt_select<MarkupDocument>(c => c.to_document())
|
|
|
.to_series() // To series first so we don't delete the document (which deletes the children internally)
|
|
.to_series() // To series first so we don't delete the document (which deletes the children internally)
|
|
|
.select_many<MarkupNode>(d => d.body.children);
|
|
.select_many<MarkupNode>(d => d.body.children);
|
|
@@ -86,6 +110,10 @@ namespace Spry {
|
|
|
final_instance.select("//spry-control")
|
|
final_instance.select("//spry-control")
|
|
|
.iterate(n => n.replace_with_nodes(n.children));
|
|
.iterate(n => n.replace_with_nodes(n.children));
|
|
|
|
|
|
|
|
|
|
+ // Finally, remove all internal SIDs
|
|
|
|
|
+ final_instance.select("//*[@sid]")
|
|
|
|
|
+ .iterate(n => n.remove_attribute("sid"));
|
|
|
|
|
+
|
|
|
return final_instance;
|
|
return final_instance;
|
|
|
}
|
|
}
|
|
|
|
|
|