Class JniYXmlElement

java.lang.Object
net.carcdr.ycrdt.jni.JniYXmlElement
All Implemented Interfaces:
AutoCloseable, net.carcdr.ycrdt.YXmlElement, net.carcdr.ycrdt.YXmlNode

public class JniYXmlElement extends Object implements net.carcdr.ycrdt.YXmlElement
YXmlElement represents a collaborative XML element type in a Y-CRDT document.

YXmlElement provides collaborative operations for XML elements including tag names and attributes. Multiple users can modify the same element simultaneously, and changes will be merged automatically using CRDT algorithms.

This class implements Closeable and should be used with try-with-resources to ensure proper cleanup of native resources.

Example usage:


 try (YDoc doc = new JniYDoc();
      YXmlElement element = doc.getXmlElement("div")) {
     element.setAttribute("class", "container");
     element.setAttribute("id", "main");
     System.out.println(element.getTag()); // div
     System.out.println(element.getAttribute("class")); // container
 }
 
See Also:
  • YDoc