XmlElement
XmlElement
개요
XmlElement는 C++용 Aspose.Cells FOSS에 포함된 클래스입니다.
XML 요소에 대한 경량 핸들입니다. 기본 생성된 인스턴스는 null입니다.
이 클래스는 C++ 프로그램에서 XmlElement 객체를 다루기 위한 16개의 메서드를 제공합니다. 사용 가능한 메서드에는 AddChild, GetAttribute, GetAttributes, GetChildNodes, GetDescendantsAndSelf, GetElement, GetElements, GetName, GetValue, IsNull, IsTextNode, MakeElement 및 추가 메서드 1개가 포함됩니다. Aspose.Cells FOSS for C++ 패키지를 설치한 후에는 모든 공개 멤버를 어떤 C++ 애플리케이션에서도 사용할 수 있습니다.
메서드
| 시그니처 | 설명 |
|---|---|
IsNull() → bool | null이 설정된 경우 true를 반환합니다. |
GetName() → std::string | Clark notation {uri}localname 형식의 한정된 이름을 가져옵니다. |
GetValue() → std::string | 모든 하위 텍스트 노드의 연결된 텍스트를 가져옵니다. |
IsTextNode() → bool | 이 노드가 요소가 아니라 텍스트 노드를 나타내는 경우 true를 반환합니다. |
GetAttributes() → std::vector<std::pair<std::string, std::string>> | 모든 속성을 로컬 이름/값 쌍으로 가져옵니다. |
GetChildNodes() → std::vector<XmlElement> | 직접적인 자식 노드(요소 및 텍스트 노드)를 모두 가져옵니다. |
GetAttribute(localName: std::string_view) → XmlAttribute | 로컬 이름으로 속성을 가져옵니다. 찾지 못하면 null XmlAttribute을 반환합니다. |
GetElements(qualifiedName: std::string_view) → std::vector<XmlElement> | 주어진 정규화된 이름을 가진 모든 직접 자식 요소를 가져옵니다. |
GetElement(qualifiedName: std::string_view) → XmlElement | 주어진 정규화된 이름을 가진 첫 번째 직접 자식 요소를 가져옵니다. |
GetDescendantsAndSelf() → std::vector<XmlElement> | 자신을 포함한 모든 하위 요소를 문서 순서대로 가져옵니다. |
MakeElement(node: std::shared_ptr<XmlNodeData>) → XmlElement | 이 XmlElement 인스턴스에서 MakeElement를 호출합니다. |
MakeElement(qualifiedName: std::string) → XmlElement | 주어진 정규화된 이름으로 새 요소를 생성하고, 속성이나 자식이 없습니다. |
MakeElement(qualifiedName: std::string, attributes: std::vector<std::pair<std::string, std::string>>, children: std::vector<XmlElement>) → XmlElement | 주어진 정규화된 이름, 속성 및 자식 요소로 새 요소를 생성합니다. |
AddChild(child: XmlElement) | 이 요소에 자식 요소를 추가합니다. |
AddChild(child: XmlElement) | 이동하여 자식 요소를 추가합니다. |
SetAttribute(localName: std::string_view, value: std::string) | 속성 값을 설정합니다. 속성이 없으면 추가하고, 있으면 업데이트합니다. |