博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何在Eclipse中从XSD生成XML
阅读量:2531 次
发布时间:2019-05-11

本文共 1903 字,大约阅读时间需要 6 分钟。

If you work on , you must have been using XSD. To test the web service, you need to generate XML from XSD file.

如果您使用 ,则必须一直在使用XSD。 要测试Web服务,您需要从XSD文件生成XML。

从XSD生成XML (Generate XML from XSD)

We can use Eclipse IDE to easily generate XML from the XSD file. Just follow the below steps to get XML from XSD.

我们可以使用Eclipse IDE轻松地从XSD文件生成XML。 只需按照以下步骤从XSD获取XML。

  1. Select XSD File in project, right click for Menu and select Generate > XML File…

    在项目中选择XSD文件,右键单击菜单,然后选择生成> XML文件…
  2. Provide the XML file Name and XML File location in the popup window. Click on next button.

    在弹出窗口中提供XML文件名和XML文件位置。 单击下一步按钮。
  3. Select the root element for which you want to generate the sample XML file, make sure to select checkboxes for “Create optional attributes” and “Create optional elements”. Below image shows how the window will look.

    选择要为其生成示例XML文件的根元素,确保选中“创建可选属性”和“创建可选元素”的复选框。 下图显示了窗口的外观。
  4. Click on Finish button and it will generate the XML File for you with the default values. Now you can change the values according to your requirement.

    单击完成按钮,它将为您生成具有默认值的XML文件。 现在,您可以根据需要更改值。

XSD到XML的示例 (XSD to XML Example)

Here is the XSD for which I will be generating XML files.

这是我将为其生成XML文件的XSD。

Employee.xsd

Employee.xsd

Since Employee.xsd has two root elements; empRequest and empResponse; I can generate two XML files.

由于Employee.xsd具有两个根元素; empRequestempResponse ; 我可以生成两个XML文件。

Here are the XML files generated by Eclipse, the values are changed by me.

这是Eclipse生成的XML文件,值由我更改。

EmployeeRequest.xml

EmployeeRequest.xml

5

EmployeeResponse.xml

EmployeeResponse.xml

1
Developer
Pankaj Kumar

I hope this quick tip will help you in generating XML from XSD easily.

我希望这个快速技巧可以帮助您轻松地从XSD生成XML。

翻译自:

转载地址:http://lmozd.baihongyu.com/

你可能感兴趣的文章
5个基于HTML5的加载动画推荐
查看>>
水平权限漏洞的修复方案
查看>>
静态链接与动态链接的区别
查看>>
Android 关于悬浮窗权限的问题
查看>>
如何使用mysql
查看>>
linux下wc命令详解
查看>>
敏捷开发中软件测试团队的职责和产出是什么?
查看>>
在mvc3中使用ffmpeg对上传视频进行截图和转换格式
查看>>
python的字符串内建函数
查看>>
Spring - DI
查看>>
微软自己的官网介绍 SSL 参数相关
查看>>
Composite UI Application Block (CAB) 概念和术语
查看>>
ajax跨域,携带cookie
查看>>
阶段3 2.Spring_01.Spring框架简介_03.spring概述
查看>>
阶段3 2.Spring_02.程序间耦合_1 编写jdbc的工程代码用于分析程序的耦合
查看>>
阶段3 2.Spring_01.Spring框架简介_04.spring发展历程
查看>>
阶段3 2.Spring_02.程序间耦合_3 程序的耦合和解耦的思路分析1
查看>>
阶段3 2.Spring_02.程序间耦合_5 编写工厂类和配置文件
查看>>
阶段3 2.Spring_01.Spring框架简介_05.spring的优势
查看>>
阶段3 2.Spring_02.程序间耦合_7 分析工厂模式中的问题并改造
查看>>