DocumentFragment

DocumentFragment

סקירה כללית

DocumentFragment היא מחלקה ב-Aspose.Html FOSS עבור Python. יורשת מ: Node.

מכולה קלת משקל עבור תת-עץ.

מחלקה זו מספקת 28 שיטות לעבודה עם עצמים DocumentFragment בתוכניות Python. השיטות הזמינות כוללות: __init__, add_event_listener, append, append_child, clone_node, compare_document_position, contains, dispatch_event, get_feature, get_root_node, get_user_data, has_child_nodes, ו-16 שיטות נוספות. כל החברים הציבוריים נגישים לכל יישום Python לאחר התקנת חבילת Aspose.Html FOSS עבור Python. מאפיינים: child_nodes, first_child, is_connected, last_child, next_sibling, node_name, ו-7 נוספים.

מאפיינים

שםסוגגישהתיאור
node_namestrקריאה'#document-fragment'
text_content`strNone`קריאה/כתיבה
node_typeintקריאהקבוע סוג צומת של מספר שלם מ-NodeType.
node_value`strNone`קריאה/כתיבה
parent_node`NodeNone`קריאה
parent_element`ElementNone`קריאה
is_connectedboolקריאההאם צומת זה הוא חלק מעץ הצמתים של מסמך (WHATWG DOM §4.4).
owner_document`DocumentNone`קריאה
child_nodesNodeListקריאהNodeList חי של כל הצמתים הבנים.
first_child`NodeNone`קריאה
last_child`NodeNone`קריאה
previous_sibling`NodeNone`קריאה
next_sibling`NodeNone`קריאה

שיטות

חתימהתיאור
`init(owner_document: DocumentNone)`
prepend()Insert nodes לפני הילד הראשון של הקטע הזה.
append()Append nodes כאחרונים של הקטע הזה.
replace_children()הסר את כל הילדים של הקטע הזה, ואז הוסף nodes.
query_selector(selector: str) → `“ElementNone”`
query_selector_all(selector: str) → "NodeList"החזר NodeList סטטי של כל האלמנטים בקטע הזה התואמים selector.
get_root_node(composed: bool) → "Node"החזר את השורש של עץ הצומת.
has_child_nodes() → boolהחזר האם לצומת זה יש לפחות צומת בן ישיר אחד.
`lookup_namespace_uri(prefix: strNone)→str
`lookup_prefix(namespace_uri: strNone)→str
`is_default_namespace(namespace_uri: strNone)→bool`
`is_supported(feature: str, version: strNone)→bool`
`get_feature(feature: str, version: strNone)→object
`set_user_data(key: str, data: objectNone, handler: object
get_user_data(key: str) → `objectNone`
append_child(node: Node) → NodeAppend node כילד האחרון של הצומת הזה.
`insert_before(node: Node, reference: NodeNone)→Node`
remove_child(node: Node) → NodeRemove node מתוך רשימת הילדים והחזר אותה.
replace_child(new_child: Node, old_child: Node) → NodeReplace old_child with new_child.
clone_node(deep: bool) → Nodeהחזר עותק של הצומת הזה.
normalize()הציבו את הצומת הזה ואת כל תת-העץ שלו לצורה מנורמלת.
`contains(other: NodeNone)→bool`
compare_document_position(other: "Node") → intהחזר מסכת ביטים המתארת את המיקום של other ביחס לצומת זה.
`is_equal_node(other: NodeNone)→bool`
`is_same_node(other_node: NodeNone)→bool`
add_event_listener(type: str, listener: Callable, capture: bool, once: bool)Register listener לאירועים של type.
remove_event_listener(type: str, listener: Callable, capture: bool)הסר רישום של מאזין שנרשם בעבר.
dispatch_event(event: "Event") → boolDispatch event דרך עץ האבות.

ראה גם

 עברית