تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
السمة
تمثيل لسمة XML
// Reads the first and last name of each person and adds a new attribute with// the full name.letxml='<roster>'+'<person first="John" last="Doe"/>'+'<person first="Mary" last="Smith"/>'+'</roster>';constdocument=XmlService.parse(xml);constpeople=document.getRootElement().getChildren('person');for(leti=0;i < people.length;i++){constperson=people[i];constfirstName=person.getAttribute('first').getValue();constlastName=person.getAttribute('last').getValue();person.setAttribute('full',`${firstName}${lastName}`);}xml=XmlService.getPrettyFormat().format(document);Logger.log(xml);
تاريخ التعديل الأخير: 2024-12-22 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2024-12-22 (حسب التوقيت العالمي المتفَّق عليه)"],[[["`Attribute` object represents an XML attribute and provides methods for manipulating its name, namespace, and value."],["You can get an attribute's local name using `getName()`, its namespace using `getNamespace()`, and its value using `getValue()`."],["`setName()`, `setNamespace()`, and `setValue()` allow modifying an attribute's local name, namespace, and value respectively."],["The provided code example demonstrates how to iterate through XML elements, access their attributes, and add new attributes."]]],["The `Attribute` class represents an XML attribute, allowing for manipulation of its properties. Key actions include retrieving the attribute's name, namespace, and value using `getName()`, `getNamespace()`, and `getValue()`. Modifications are possible via `setName(name)`, `setNamespace(namespace)`, and `setValue(value)`. An example demonstrates reading \"first\" and \"last\" names from an XML, creating a new \"full\" attribute by concatenating these names. The methods allow retrieving and setting of attribute data.\n"]]