我有一个具有引用xsd的xml文件.Master引用xsd也有许多引用xsd。如何从Java中引用xsd的Master XSD生成java类对象
我的问题是如何将xsd转换为具有许多参考xsd的java类。
我是否必须在同一位置提供所有引用的xsd?
这里是我的xsd结构:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:env="http://data.schemas.tfn.fsr.com/Envelope/2008-05-01/" xmlns="http://fsr.com/Fundamental/2011-07-07/" xmlns:sou="http://fsr.com/FinancialSource/2011-07-07/" xmlns:pe="http://fsr.com/FinancialPeriod/2011-07-07/" xmlns:fs="http://fsr.com/FinancialStatement/2011-07-07/" xmlns:ir="http://fsr.com/FinancialInstrumentRelationship/2011-07-07/" xmlns:fl="http://fsr.com/FinancialLineItem/2011-07-07/" xmlns:seg="http://fsr.com/FinancialSegment/2011-07-07/" xmlns:sli="http://fsr.com/StandardizedLineItem/2011-07-07/" xmlns:ss="http://fsr.com/StandardizedStatement/2011-07-07/" xmlns:ful="http://fsr.com/FundamentalLineItem/2011-07-07/" xmlns:esg="http://fsr.com/ESGSupportingInfo/2011-07-07/" xmlns:cor="http://fsr.com/CoraxData/2012-10-25/" xmlns:al="http://fsr.com/FundamentalAnalytics/2011-07-07/" xmlns:md="http://data.schemas.financial.fsr.com/metadata/2010-10-10/" targetNamespace="http://fsr.com/Fundamental/2011-07-07/" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0.0">
<xs:import namespace="http://data.schemas.tfn.fsr.com/Envelope/2008-05-01/" schemaLocation="../../Envelope/2008-05-01/ContentEnvelope.xsd"/>
<xs:include schemaLocation="FundamentalDataItem.xsd"/>
<xs:import namespace="http://fsr.com/FinancialSource/2011-07-07/" schemaLocation="FinancialSource.xsd"/>
<xs:import namespace="http://fsr.com/FinancialPeriod/2011-07-07/" schemaLocation="FinancialPeriod.xsd"/>
<xs:import namespace="http://fsr.com/FinancialStatement/2011-07-07/" schemaLocation="FinancialStatement.xsd"/>
<xs:import namespace="http://fsr.com/FinancialInstrumentRelationship/2011-07-07/" schemaLocation="FundamentalInstrument.xsd"/>
<xs:import namespace="http://fsr.com/FinancialLineItem/2011-07-07/" schemaLocation="FinancialLineItem.xsd"/>
<xs:import namespace="http://fsr.com/FinancialSegment/2011-07-07/" schemaLocation="FinancialSegment.xsd"/>
<!--<xs:import namespace="http://fsr.com/StandardizedLineItem/2011-07-07/" schemaLocation="StandardizedLineItem.xsd"/>-->
<xs:import namespace="http://fsr.com/StandardizedStatement/2011-07-07/" schemaLocation="StandardizedStatement.xsd"/>
<!--xs:import namespace="http://fsr.com/FundamentalLineItem/2011-07-07/" schemaLocation="FundamentalLineItem.xsd"/-->
<xs:import namespace="http://fsr.com/CoraxData/2012-10-25/" schemaLocation="TRFCorax.xsd"/>
<xs:import namespace="http://fsr.com/FundamentalAnalytics/2011-07-07/" schemaLocation="FundamentalSeries.xsd"/>
<xs:import namespace="http://fsr.com/FundamentalAnalytics/2011-07-07/" schemaLocation="FundamentalSeriesPeriod.xsd"/>
<xs:import namespace="http://fsr.com/FundamentalAnalytics/2011-07-07/" schemaLocation="FundamentalSeriesFiscalCalendar.xsd"/>
<xs:import namespace="http://fsr.com/FundamentalAnalytics/2011-07-07/" schemaLocation="FundamentalAnalytic.xsd"/>
<xs:import namespace="http://data.schemas.financial.fsr.com/metadata/2010-10-10/" schemaLocation="../../Metadata/2010-10-10/RelationshipDataItem.xsd"/>
<xs:import namespace="http://data.schemas.financial.fsr.com/metadata/2010-10-10/" schemaLocation="../../Metadata/2010-10-10/IdentifierDataItem.xsd"/>
<xs:import namespace="http://data.schemas.financial.fsr.com/metadata/2010-10-10/" schemaLocation="../../Metadata/2010-10-10/AdminStatusDataItem.xsd"/>
<xs:import namespace="http://fsr.com/ESGSupportingInfo/2011-07-07/" schemaLocation="ESGSupportingInfo.xsd"/>
<xs:import namespace="http://fsr.com/FinancialStatement/2011-07-07/" schemaLocation="FinancialStatementLineItem.xsd"/>
<xs:import namespace="http://fsr.com/FinancialStatement/2011-07-07/" schemaLocation="FinancialStatementNonNumericLineItem.xsd"/>
<xs:import namespace="http://fsr.com/StandardizedStatement/2011-07-07/" schemaLocation="StandardizedStatementLineItem.xsd"/>
<xs:complexType name="FundamentalDataItem" mixed="false">
<xs:complexContent>
<xs:extension base="env:DataItemBase">
<xs:sequence>
<xs:element ref="Fundamental" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="FinancialPeriodDataItem" mixed="false">
<xs:complexContent>
<xs:extension base="env:DataItemBase">
<xs:sequence>
<xs:element ref="pe:FinancialPeriod" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
,这里是我的xsd树结构
主要XSD
<xs:import schemaLocation="../../Envelope/2008-05-01/Mentale.xsd" namespace="http://data.schemas.tfn.son.com/Envelope/2008-05-01/"/>
<xs:include schemaLocation="MentaleDataItem.xsd"/>
<xs:complexType mixed="false" name="MentaleDataItem">
<xs:complexContent>
<xs:extension base="env:DataItemBase">
<xs:sequence>
<xs:element minOccurs="0" ref="Mentale"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
所以我要创建Java类每个XSD分别为是,则我将如何链接them.Can请你给。我是新来的XML的例子和xsd – SUDARSHAN
JAXB将处理所有事情......只需查看文档即可。 –
我有三个XSD引用到另一个,这是一个被称为另一个我已经更新了我的XSD树结构也请看看一次。为什么我问是我已经尝试过但抛出异常 – SUDARSHAN