Link Search Menu Expand Document

XmlText.SplitText Method

Explanation Splits the Text node at the specified position into two Text nodes.
Not supported in Mobile, AI
Call format var text2 = text.SplitText( offset )
Return value XmlText object containing the second half of the split text
Arguments integer offset Split position (specified by the number of characters)
Exception DOM-1 INDEX_SIZE_ERR
DOM-7 NO_MODIFICATION_ALLOWED_ERR
Example of use
    var domimpl = new XmlDOMImplementation;
    var res = session.Get("/test/sample.xml");
    var xmldoc = domimpl.Load(res);
    var text1 = xmldoc.DocumentElement.FirstChild;
    var text2 = text1.SplitText(20);
    print(text1.Data, "\n");
    print(text2.Data, "\n");
    
Related item