/*
package com.usky.oa.service.utils;

import com.usky.common.core.exception.BusinessException;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;

*/
/**
 *
 * @author fyc
 * @email yuchuan.fu@chinausky.com
 * @date 2025/1/23
 *//*

@Slf4j
@Configuration
public class OaProcessAnalysis {
    public void processAnalysis(String xmlString) {
        try {
            // 移除潜在的空格/BOM
            xmlString = xmlString.trim().replaceFirst("^\uFEFF", "");
            // 替换HTML实体
            // xmlString = xmlString.replace("&#34;", "\"");

            SAXReader reader = new SAXReader();
            // 将 XML 字符串解析为 Document 对象
            Document document = reader.read(new java.io.StringReader(xmlString));

            // 获取根元素
            Element root = document.getRootElement();

            // 遍历根元素的子元素
            parseElement(root);
        } catch (DocumentException e) {
            throw new BusinessException("解析流程xml文件失败" + e);
        }
    }

    private void parseElement(Element element) {
        // 输出元素名称
        System.out.println("元素名称: " + element.getName());
        // 处理元素的属性
        element.attributes().forEach(attribute -> {
            System.out.println("元素属性: " + attribute.getName() + ", 元素值: " + attribute.getValue());
        });
        // 遍历子元素
        element.elements().forEach(subElement -> {
            // 递归处理子元素
            parseElement((Element) subElement);
        });
    }
}
*/
