Eclipse XSD 生成枚举类型的Schema的实例详解(eclipse生成xml)学会了吗

随心笔谈5个月前更新 admin
208 00
🌐 经济型:买域名、轻量云服务器、用途:游戏 网站等 《腾讯云》特点:特价机便宜 适合初学者用 点我优惠购买
🚀 拓展型:买域名、轻量云服务器、用途:游戏 网站等 《阿里云》特点:中档服务器便宜 域名备案事多 点我优惠购买
🛡️ 稳定型:买域名、轻量云服务器、用途:游戏 网站等 《西部数码》 特点:比上两家略贵但是稳定性超好事也少 点我优惠购买

文章摘要

本文介绍了如何使用Eclipse的XSD工具包来定义和管理复杂的XSD(Extensible Schema Definitions)模型。文章重点讲解了如何创建枚举类型(EnumFacet)来表示单元格对齐(cell alignment)的值,以及如何通过测试类EnumFacetTest实现这一功能。代码展示了如何定义枚举类型、创建AlignmentElement类,并将其添加到XSD模型中。通过本文,读者可以学习如何利用Eclipse的XSD功能来扩展和管理复杂的XSD定义。


import org.eclipse.xsd.XSDComplexTypeDefinition;
import org.eclipse.xsd.XSDCompositor;
import org.eclipse.xsd.XSDElementDeclaration;
import org.eclipse.xsd.XSDEnumerationFacet;
import org.eclipse.xsd.XSDFactory;
import org.eclipse.xsd.XSDImport;
import org.eclipse.xsd.XSDInclude;
import org.eclipse.xsd.XSDModelGroup;
import org.eclipse.xsd.XSDParticle;
import org.eclipse.xsd.XSDRedefine;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSchemaDirective;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.util.XSDResourceImpl;
import org.eclipse.xsd.util.XSDUtil;
import org.junit.Test;
import org.w3c.dom.Element;

public class EnumFacetTest {
protected static XSDFactory xsdFactory=XSDFactory.eINSTANCE;
private void createAligementElement(XSDSimpleTypeDefinition aligmentType){
String[] cellAligements=

© 版权声明

相关文章