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++. يحدد الألوان لتعبئة الأشكال، الخطوط، النص، والتأثيرات.
| Example | Example | Example | Example |
|---|---|---|---|
ParentNode | `Node | None` | Example |
Document | `Document | None` | Example |
خصائص الوصول إلى الأطفال
| Example | Example | Example | Example |
|---|---|---|---|
FirstChild | `Node | None` | Example |
LastChild | `Node | None` | Example |
Example
AppendChildLast(node)
composite.AppendChildLast(node: Node) -> NodeExample node كآخر ابن مباشر. يضبط node.ParentNode = self. يُرجِع node.
AppendChildFirst(node)
composite.AppendChildFirst(node: Node) -> NodeExample node كأول ابن مباشر. يُرجِع node.
InsertChild(index, node)
composite.InsertChild(index: int, node: Node) -> NodeExample node في الموضع index في قائمة الأبناء. يُرجِع node.
RemoveChild(node)
composite.RemoveChild(node: Node) -> NoneExample 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 عندما لا يحتوي العقد على أبناء. احرص دائمًا على الحماية قبل إلغاء الإشارة إليها.
انظر أيضًا
- Example: الفئة الأساسية لجميع عقد المستند
- Example: الجذر
CompositeNode - Example: مستوى الصفحة
CompositeNode - RichText: كتلة نص
CompositeNode - يقوم بتسلسل ورقة العمل إلى سلسلة CSV ويعيدها. لا يتم كتابة أي ملف.