从 .xsd 文件创建 xml 文件的用户友好方式 *无需用户编码*
user friendly way to create xml files from .xsd files *no coding for the user*
我不太确定如何解释这个问题,但我会尽力说清楚。我目前正在编写 .xsd 以便为数据集创建元数据文件。当我尝试使用它在 excel 中进行映射时,它会出现错误,只有当我以非常混乱且不友好的方式设置表单时,这些错误才会消失。我只是想知道是否有一种用户友好的方式让其他人能够从我的模式生成 xml 元数据文件?使用它的人不会有太多的编码经验,它会被用在很多不同的数据集上。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Data-set">
<xsd:complexType>
<xsd:sequence>
<xsd:element name= "DataUniqueIdentifier"/>
<xsd:element minOccurs="0" maxOccurs="1" name="ProjectInformation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ProjectName"/>
<xsd:element name="ProjectCode"/>
<xsd:element name="ProjectLead"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="ProjectSponsors"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="Authors">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="LastName"/>
<xsd:element name="FirstName"/>
<xsd:element name="Email"/>
<xsd:element name="Affiliation"/>
<xsd:element name="Role"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="1" name="DataInformation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DatasetTitle"/>
<xsd:element name="StudyStartDate" type="xsd:date"/>
<xsd:element name="StudyEndDate" type="xsd:date"/>
<xsd:element name="EstimatedStudyCompletionDate" type="xsd:date"/>
<xsd:element name="PublicationDate" type="xsd:date"/>
<xsd:element name="DataLocation" type="xsd:string"/>
<xsd:element minOccurs ="0" maxOccurs ="5" name ="Keywords"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name= "DataUsageRights" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="DataAbstract">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="InstrumentsUsed"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="AquisitionMethods"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="ProcessingMethods"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="SoftwareUsed"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="1" name="DataDescription">
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="Completion"/>
<xsd:element name ="ObservationCount"/>
<xsd:element name ="VariableCount"/>
<xsd:element name ="NACount"/>
<xsd:element name ="DatasetState"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="AnalysisPerformed"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="PapersPublished"> #ISSUE
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="PaperTitle"/> #ISSUE
<xsd:element name ="URL"/> #ISSUE
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="DataDescriptors">
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="VariableName"/>
<xsd:element name ="DataType"/>
<xsd:element name ="VariableDescription"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="1" name="DataFileInformation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="FileFormat"/>
<xsd:element name ="FileSize"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
希望我解释得足够好,如有任何帮助,我们将不胜感激。
你的问题很开放,似乎没有附加很多细节。因此,以适合您的方式回答这个问题会很棘手。
如果我正确理解你的问题,你说的是这样一种情况,你有一个 XML 模式(XSD)并且你想“生成”一个基于 XML 的文件在这个架构上没有任何编码。
我想到的是基于 GUI 的编辑器,例如 OxygenXML,它允许加载 XSD 然后提供自动完成、“网格视图”和其他工具来实现 easy/easier 在 XSD 上写一个 XML 基础。此外,XSD 验证也内置在编辑器中。
OxygenXML 有替代品可用,您可以轻松地在网上搜索 XML Editor、XML 等内容发展, XML IDE 等.
如果此答案对您没有帮助,我建议您在问题中添加更多信息。
Oxygen 有一个工具可以从模式生成实例文档。通过稍微调整选项,我生成了这个实例:
<?xml version="1.0" encoding="UTF-8"?>
<Data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:/Users/mike/Desktop/temp/test.xsd">
<DataUniqueIdentifier>
</DataUniqueIdentifier>
<ProjectInformation>
<ProjectName>
</ProjectName>
<ProjectCode>
</ProjectCode>
<ProjectLead>
</ProjectLead>
<ProjectSponsors>
</ProjectSponsors>
<ProjectSponsors>
</ProjectSponsors>
</ProjectInformation>
<Authors>
<LastName>
</LastName>
<FirstName>
</FirstName>
<Email>
</Email>
<Affiliation>
</Affiliation>
<Role>
</Role>
</Authors>
<Authors>
<LastName>
</LastName>
<FirstName>
</FirstName>
<Email>
</Email>
<Affiliation>
</Affiliation>
<Role>
</Role>
</Authors>
<DataInformation>
<DatasetTitle>
</DatasetTitle>
<StudyStartDate>2006-05-04</StudyStartDate>
<StudyEndDate>2006-05-04</StudyEndDate>
<EstimatedStudyCompletionDate>2006-05-04</EstimatedStudyCompletionDate>
<PublicationDate>2006-05-04</PublicationDate>
<DataLocation>DataLocation0</DataLocation>
<Keywords>
</Keywords>
<Keywords>
</Keywords>
</DataInformation>
<DataUsageRights>DataUsageRights0</DataUsageRights>
<DataAbstract>
<InstrumentsUsed>
</InstrumentsUsed>
<InstrumentsUsed>
</InstrumentsUsed>
<AquisitionMethods>
</AquisitionMethods>
<AquisitionMethods>
</AquisitionMethods>
<ProcessingMethods>
</ProcessingMethods>
<ProcessingMethods>
</ProcessingMethods>
<SoftwareUsed>
</SoftwareUsed>
<SoftwareUsed>
</SoftwareUsed>
</DataAbstract>
<DataDescription>
<Completion>
</Completion>
<ObservationCount>
</ObservationCount>
<VariableCount>
</VariableCount>
<NACount>
</NACount>
<DatasetState>
</DatasetState>
<AnalysisPerformed>
</AnalysisPerformed>
<AnalysisPerformed>
</AnalysisPerformed>
<PapersPublished>
<PaperTitle>
</PaperTitle>
<URL>
</URL>
</PapersPublished>
<PapersPublished>
<PaperTitle>
</PaperTitle>
<URL>
</URL>
</PapersPublished>
</DataDescription>
<DataDescriptors>
<VariableName>
</VariableName>
<DataType>
</DataType>
<VariableDescription>
</VariableDescription>
</DataDescriptors>
<DataDescriptors>
<VariableName>
</VariableName>
<DataType>
</DataType>
<VariableDescription>
</VariableDescription>
</DataDescriptors>
<DataFileInformation>
<FileFormat>
</FileFormat>
<FileSize>
</FileSize>
</DataFileInformation>
</Data-set>
哪些用户可能会发现有用的编辑模板。那是你的想法吗?
当然您可以修改模板,例如添加说明字段含义的注释。
但实际上,您想设计一个表单(可能使用 XForms),允许用户在输入数据时看不到任何尖括号。
我不太确定如何解释这个问题,但我会尽力说清楚。我目前正在编写 .xsd 以便为数据集创建元数据文件。当我尝试使用它在 excel 中进行映射时,它会出现错误,只有当我以非常混乱且不友好的方式设置表单时,这些错误才会消失。我只是想知道是否有一种用户友好的方式让其他人能够从我的模式生成 xml 元数据文件?使用它的人不会有太多的编码经验,它会被用在很多不同的数据集上。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Data-set">
<xsd:complexType>
<xsd:sequence>
<xsd:element name= "DataUniqueIdentifier"/>
<xsd:element minOccurs="0" maxOccurs="1" name="ProjectInformation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ProjectName"/>
<xsd:element name="ProjectCode"/>
<xsd:element name="ProjectLead"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="ProjectSponsors"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="Authors">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="LastName"/>
<xsd:element name="FirstName"/>
<xsd:element name="Email"/>
<xsd:element name="Affiliation"/>
<xsd:element name="Role"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="1" name="DataInformation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DatasetTitle"/>
<xsd:element name="StudyStartDate" type="xsd:date"/>
<xsd:element name="StudyEndDate" type="xsd:date"/>
<xsd:element name="EstimatedStudyCompletionDate" type="xsd:date"/>
<xsd:element name="PublicationDate" type="xsd:date"/>
<xsd:element name="DataLocation" type="xsd:string"/>
<xsd:element minOccurs ="0" maxOccurs ="5" name ="Keywords"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name= "DataUsageRights" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="DataAbstract">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="InstrumentsUsed"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="AquisitionMethods"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="ProcessingMethods"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="SoftwareUsed"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="1" name="DataDescription">
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="Completion"/>
<xsd:element name ="ObservationCount"/>
<xsd:element name ="VariableCount"/>
<xsd:element name ="NACount"/>
<xsd:element name ="DatasetState"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="AnalysisPerformed"/>
<xsd:element minOccurs ="0" maxOccurs ="unbounded" name ="PapersPublished"> #ISSUE
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="PaperTitle"/> #ISSUE
<xsd:element name ="URL"/> #ISSUE
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="DataDescriptors">
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="VariableName"/>
<xsd:element name ="DataType"/>
<xsd:element name ="VariableDescription"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="1" name="DataFileInformation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name ="FileFormat"/>
<xsd:element name ="FileSize"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
希望我解释得足够好,如有任何帮助,我们将不胜感激。
你的问题很开放,似乎没有附加很多细节。因此,以适合您的方式回答这个问题会很棘手。
如果我正确理解你的问题,你说的是这样一种情况,你有一个 XML 模式(XSD)并且你想“生成”一个基于 XML 的文件在这个架构上没有任何编码。
我想到的是基于 GUI 的编辑器,例如 OxygenXML,它允许加载 XSD 然后提供自动完成、“网格视图”和其他工具来实现 easy/easier 在 XSD 上写一个 XML 基础。此外,XSD 验证也内置在编辑器中。 OxygenXML 有替代品可用,您可以轻松地在网上搜索 XML Editor、XML 等内容发展, XML IDE 等.
如果此答案对您没有帮助,我建议您在问题中添加更多信息。
Oxygen 有一个工具可以从模式生成实例文档。通过稍微调整选项,我生成了这个实例:
<?xml version="1.0" encoding="UTF-8"?>
<Data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:/Users/mike/Desktop/temp/test.xsd">
<DataUniqueIdentifier>
</DataUniqueIdentifier>
<ProjectInformation>
<ProjectName>
</ProjectName>
<ProjectCode>
</ProjectCode>
<ProjectLead>
</ProjectLead>
<ProjectSponsors>
</ProjectSponsors>
<ProjectSponsors>
</ProjectSponsors>
</ProjectInformation>
<Authors>
<LastName>
</LastName>
<FirstName>
</FirstName>
<Email>
</Email>
<Affiliation>
</Affiliation>
<Role>
</Role>
</Authors>
<Authors>
<LastName>
</LastName>
<FirstName>
</FirstName>
<Email>
</Email>
<Affiliation>
</Affiliation>
<Role>
</Role>
</Authors>
<DataInformation>
<DatasetTitle>
</DatasetTitle>
<StudyStartDate>2006-05-04</StudyStartDate>
<StudyEndDate>2006-05-04</StudyEndDate>
<EstimatedStudyCompletionDate>2006-05-04</EstimatedStudyCompletionDate>
<PublicationDate>2006-05-04</PublicationDate>
<DataLocation>DataLocation0</DataLocation>
<Keywords>
</Keywords>
<Keywords>
</Keywords>
</DataInformation>
<DataUsageRights>DataUsageRights0</DataUsageRights>
<DataAbstract>
<InstrumentsUsed>
</InstrumentsUsed>
<InstrumentsUsed>
</InstrumentsUsed>
<AquisitionMethods>
</AquisitionMethods>
<AquisitionMethods>
</AquisitionMethods>
<ProcessingMethods>
</ProcessingMethods>
<ProcessingMethods>
</ProcessingMethods>
<SoftwareUsed>
</SoftwareUsed>
<SoftwareUsed>
</SoftwareUsed>
</DataAbstract>
<DataDescription>
<Completion>
</Completion>
<ObservationCount>
</ObservationCount>
<VariableCount>
</VariableCount>
<NACount>
</NACount>
<DatasetState>
</DatasetState>
<AnalysisPerformed>
</AnalysisPerformed>
<AnalysisPerformed>
</AnalysisPerformed>
<PapersPublished>
<PaperTitle>
</PaperTitle>
<URL>
</URL>
</PapersPublished>
<PapersPublished>
<PaperTitle>
</PaperTitle>
<URL>
</URL>
</PapersPublished>
</DataDescription>
<DataDescriptors>
<VariableName>
</VariableName>
<DataType>
</DataType>
<VariableDescription>
</VariableDescription>
</DataDescriptors>
<DataDescriptors>
<VariableName>
</VariableName>
<DataType>
</DataType>
<VariableDescription>
</VariableDescription>
</DataDescriptors>
<DataFileInformation>
<FileFormat>
</FileFormat>
<FileSize>
</FileSize>
</DataFileInformation>
</Data-set>
哪些用户可能会发现有用的编辑模板。那是你的想法吗?
当然您可以修改模板,例如添加说明字段含义的注释。
但实际上,您想设计一个表单(可能使用 XForms),允许用户在输入数据时看不到任何尖括号。