• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

schema generation

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I'm trying to generate schema from DTD using xmlspy.Below is the DTD.
<?xml version="1.0" encoding="UTF-8"?>
<!--DTD generated by XMLSPY v2004 rel. 4 (http://www.xmlspy.com)-->
<!ELEMENT definitions (message+, portType+, plnk artnerLinkType+)>
<!ATTLIST definitions
targetNamespace CDATA #REQUIRED
xmlns CDATA #REQUIRED
xmlns:xsd CDATA #REQUIRED
xmlns lnk CDATA #REQUIRED
xmlns:lns CDATA #REQUIRED
>
<!ELEMENT fault EMPTY>
<!ATTLIST fault
name (loanProcessFault | unableToHandleRequest) #REQUIRED
message CDATA #REQUIRED
>
<!ELEMENT input EMPTY>
<!ATTLIST input
message CDATA #REQUIRED
>
<!ELEMENT message (part+)>
<!ATTLIST message
name (approvalMessage | creditInformationMessage | errorMessage | riskAssessmentMessage) #REQUIRED
>
<!ELEMENT operation (input, output, fault)>
<!ATTLIST operation
name (approve | check | request) #REQUIRED
>
<!ELEMENT output EMPTY>
<!ATTLIST output
message (lns:approvalMessage | lns:riskAssessmentMessage) #REQUIRED
>
<!ELEMENT part EMPTY>
<!ATTLIST part
name (accept | amount | errorCode | firstName | level | name) #REQUIRED
type (xsd:integer | xsd:string) #REQUIRED
>
<!ELEMENT plnk artnerLinkType (plnk:role)>
<!ATTLIST plnk artnerLinkType
name (loanApprovalLinkType | loanPartnerLinkType | riskAssessmentLinkType) #REQUIRED
>
<!ELEMENT plnk ortType EMPTY>
<!ATTLIST plnk ortType
name (lns:loanApprovalPT | lns:loanServicePT | lns:riskAssessmentPT) #REQUIRED
>
<!ELEMENT plnk:role (plnk ortType)>
<!ATTLIST plnk:role
name (approver | assessor | loanService) #REQUIRED
>
<!ELEMENT portType (operation)>
<!ATTLIST portType
name (loanApprovalPT | loanServicePT | riskAssessmentPT) #REQUIRED
>

Below is the schema.
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSPY v2004 rel. 4 (http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="definitions">
<xs:complexType>
<xs:sequence>
<xs:element name="message" type="messageType" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="portType" type="portTypeType" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="plnk artnerLinkType" type="plnk artnerLinkTypeType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="targetNamespace" type="xs:string" use="required"/>
<xs:attribute ref="xmlns:xsd" type="xs:string" use="required"/>
<xs:attribute ref="xmlns lnk" type="xs:string" use="required"/>
<xs:attribute ref="xmlns:lns" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="faultType">
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="loanProcessFault"/>
<xs:enumeration value="unableToHandleRequest"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="message" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="inputType">
<xs:attribute name="message" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="messageType">
<xs:sequence>
<xs:element name="part" type="partType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="approvalMessage"/>
<xs:enumeration value="creditInformationMessage"/>
<xs:enumeration value="errorMessage"/>
<xs:enumeration value="riskAssessmentMessage"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="operationType">
<xs:sequence>
<xs:element name="input" type="inputType"/>
<xs:element name="output" type="outputType"/>
<xs:element name="fault" type="faultType"/>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="approve"/>
<xs:enumeration value="check"/>
<xs:enumeration value="request"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="outputType">
<xs:attribute name="message" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="lns:approvalMessage"/>
<xs:enumeration value="lns:riskAssessmentMessage"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="partType">
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="accept"/>
<xs:enumeration value="amount"/>
<xs:enumeration value="errorCode"/>
<xs:enumeration value="firstName"/>
<xs:enumeration value="level"/>
<xs:enumeration value="name"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="xsd:integer"/>
<xs:enumeration value="xsd:string"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="plnk artnerLinkTypeType">
<xs:sequence>
<xs:element name="plnk:role" type="plnk:roleType"/>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="loanApprovalLinkType"/>
<xs:enumeration value="loanPartnerLinkType"/>
<xs:enumeration value="riskAssessmentLinkType"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="plnk ortTypeType"><--error here-->
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="lns:loanApprovalPT"/>
<xs:enumeration value="lns:loanServicePT"/>
<xs:enumeration value="lns:riskAssessmentPT"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="plnk:roleType">
<xs:sequence>
<xs:element name="plnk ortType" type="plnk ortTypeType"/>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="approver"/>
<xs:enumeration value="assessor"/>
<xs:enumeration value="loanService"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="portTypeType">
<xs:sequence>
<xs:element name="operation" type="operationType"/>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="loanApprovalPT"/>
<xs:enumeration value="loanServicePT"/>
<xs:enumeration value="riskAssessmentPT"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:schema>

when im generating schema im getting the following error

This schema does not apper to be valid by itself(as a part of another schema,it might still be ok)
schema error - name="plnk artnerLinkTypeType" cannot have a namespace prefix.Please remove prefix or use ref= instead!
where it is going wrong.Any help will be highly appreciated.

ManyRegards
Ved
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic