CompositeNode — Aspose.Note FOSS for Python API Reference

يزيل node من قائمة الأطفال ويعيّن node.ParentNode = None.

Example: aspose.note Example: from aspose.note import CompositeNode Example: Node

CompositeNode يمتد Node مع القدرة على امتلاك عقد فرعية. جميع أنواع العقد الهيكلية في نموذج المستند (Document, Page, Outline, OutlineElement, RichText, Image, Table, TableRow, TableCell, AttachedFile) CompositeNode.تورث من CompositeNode مباشرةً.


Example

مرجع API لفئة ColorFormat في Aspose.Slides FOSS للغة C++. يحدد الألوان لتعبئة الأشكال، الخطوط، النص، والتأثيرات.

ExampleExampleExampleExample
ParentNode`NodeNone`Example
Document`DocumentNone`Example

خصائص الوصول إلى الأطفال

ExampleExampleExampleExample
FirstChild`NodeNone`Example
LastChild`NodeNone`Example

Example

AppendChildLast(node)

composite.AppendChildLast(node: Node) -> Node

Example node كآخر ابن مباشر. يضبط node.ParentNode = self. يُرجِع node.


AppendChildFirst(node)

composite.AppendChildFirst(node: Node) -> Node

Example node كأول ابن مباشر. يُرجِع node.


InsertChild(index, node)

composite.InsertChild(index: int, node: Node) -> Node

Example node في الموضع index في قائمة الأبناء. يُرجِع node.


RemoveChild(node)

composite.RemoveChild(node: Node) -> None

Example node من قائمة الأبناء ويضبط node.ParentNode = None.


GetChildNodes(node_type)

composite.GetChildNodes(node_type: type) -> list

يبحث بشكل متكرر في الشجرة الفرعية بأكملها (بعمق أولاً، بما في ذلك self) ويُرجِع جميع العقد التي تطابق node_type. هذه هي الطريقة الأساسية لجمع جميع مثيلات فئة معينة داخل أي شجرة فرعية.


Example

for child in composite:
    ...

تكرار CompositeNode يعطي الأبناء المباشرين فقط. استخدم GetChildNodes() للبحث العميق.


الفئة: CompositeNode

مرجع API لـ Aspose.Slides FOSS للغة C++. مكتبة C++ مجانية ومفتوحة المصدر لقراءة وإنشاء وحفظ عروض PowerPoint بصيغة .pptx. مرخصة تحت رخصة MIT، نظام بناء CMake.

from aspose.note import Document, Page, Outline, RichText

doc = Document("MyNotes.one")
first_page = doc.GetChildNodes(Page)[0]

# Direct children of a page (Outline nodes)
print("Direct children of first page:")
for child in first_page:
    print(f"  {child.NodeType}")

# Deep search — all RichText nodes anywhere under first_page
all_rt = first_page.GetChildNodes(RichText)
print(f"\nAll RichText nodes in first page: {len(all_rt)}")

Core Classes

from aspose.note import Document, Page, Outline, OutlineElement, RichText, SaveFormat, PdfSaveOptions

doc = Document()
page = Page()
outline = Outline()
oe = OutlineElement()
rt = RichText()
rt.Append("Hello, OneNote!")

oe.AppendChildLast(rt)
outline.AppendChildLast(oe)
page.AppendChildLast(outline)
doc.AppendChildLast(page)

doc.Save("output.pdf", PdfSaveOptions(SaveFormat.Pdf))

مرجع API لفئة ColorFormat في Aspose.Slides FOSS للغة C++. يحدد الألوان لتعبئة الأشكال، الخطوط، النص، والتأثيرات.

FirstChild و LastChild هي None عندما لا يحتوي العقد على أبناء. احرص دائمًا على الحماية قبل إلغاء الإشارة إليها.


انظر أيضًا

 العربية