2014-12-26 4 views
1

xsd2code VS 플러그인을 사용하여 몇 개의 xsd 파일에서 데이터 클래스를 만들고 XSD의 요소에 대한 네임 스페이스 접두사가 생성되지 않는 문제가 있습니다. XML 파일.xsd2code 요소 네임 스페이스 접두사 문제

는 XSD :

<ProductMasterItem> 

    <PrimaryItemCode xmlns="urn:tracelink:mapper:sl:mdx:commontypes"> 
    <type>INTERNAL_MATERIAL_CODE</type> 
    TestBOM5 
    </PrimaryItemCode> 
    <ProductGroupCode xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
    >100</ProductGroupCode> 
    <ProductStatus xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
    >Released</ProductStatus> 
    <RecordStatus xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
    >Active</RecordStatus> 
    <TargetMarketList>   
    <TargetMarket> 
     <CountryMarket 
     xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >US</CountryMarket> 
    </TargetMarket> 
    <DeleteTargetMarket/> 
    </TargetMarketList> 
    <ItemInfoList> 
    <ItemInfo> 
     <LanguageCode xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >EN</LanguageCode> 
     <ProductDescription 
     xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >Test BOM 5</ProductDescription> 
     <DrugName xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >Nameofadrug</DrugName> 
     <Manufacturer xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >- No Manufacturer -</Manufacturer> 
     <Strength xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >verystrong</Strength> 
     <DosageForm xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >15ml</DosageForm> 
     <PackageSize xmlns="urn:tracelink:mapper:sl:mdx:commontypes" 
     >40ml</PackageSize> 
    </ItemInfo> 
    <DeleteItemInfo/> 
    </ItemInfoList> 

가 생성 된 XML은 요소에 대한 'CMN'네임 스페이스 접두사를 가지고 있지 않습니다

<xsd:complexType name="ProductMasterItemType"> 
    <xsd:sequence> 
    <xsd:element ref="cmn:PrimaryItemCode"/> 
    <xsd:element ref="cmn:NewPrimaryItemCode" minOccurs="0"/> 
    <xsd:element ref="cmn:ProductGroupCode"/> 
    <xsd:element ref="cmn:ProductStatus"/> 
    <xsd:element ref="cmn:EffectiveDate" minOccurs="0"/> 
    <xsd:element ref="cmn:RecordStatus"/> 
    <xsd:element name="AlternateItemCodes" 
       type="cmn:AlternateItemCodeListType" 
       minOccurs="0"/> 
    <xsd:element name="TargetMarketList" 
       type="mdx:TargetMarketListType" 
       minOccurs="0"/> 
    <xsd:element name="ItemInfoList" 
       type="mdx:ItemInfoListType"/> 
    <xsd:element name="PackagingInfoList" 
       type="mdx:PackagingInfoListType" 
       minOccurs="0"/> 
    </xsd:sequence> 
</xsd:complexType> 

는 XML을 생성합니다. 플러그인을 실행했을 때 클래스를 잘못 생성 했습니까? 플러그 - 인 소스 코드에서 변경해야 할 사항입니까?

XML에 대한 많은 경험이 없으므로 충분한 정보가 아닌 경우 사과드립니다. 대답을 돕기 위해 알아야 할 것이 있으면 알려주세요. 미리 감사드립니다 :)

+0

스키마 문서를 조금 더 보여줘야합니다. xsd : schema 요소는 어떤 모습입니까? –

답변

1

xsd : schema 요소에는 complexForm에 로컬 인 요소가 네임 스페이스 한정인지 아닌지를 결정하는 elementFormDefault라는 특성이 있습니다. 기본값은 'unqualified'이며, 이는 AlternateItemCodes, TargetMarketList 등의 요소가 네임 스페이스로 정규화되지 않았 음을 의미합니다. 값을 'qualified'로 변경하면 로컬 요소는 스키마 문서의 대상 네임 스페이스, 즉 xsd : schema의 targetNamespace 특성으로 식별되는 네임 스페이스에 있습니다.

예를 들어, 스키마에 대한 대상 네임 스페이스가없는 것처럼 보이며 요소에서 수행 할 복합 유형의 네임 스페이스를 예상하는 것처럼 보입니다. 그렇지 않을 것이다.

관련 문제