Jump to content

grhodes

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About grhodes

  • Rank
    Newbie
  1. Hi I am working with the NIEM schema. I am using the citation elament and want to restrict the number of citationviolations to a 1 to 1 on a citation but on the citation the citationviolation is included with maxoccurs as unbounded. How do I restrict the cardinality on my xsd to allow only 1 violation? Thanks.
  2. Hi all:I am a newbie. I have a some schemas,below, but the ref to the attribute does not seem to be inherited, or something. If I create an xml document and include and id attribute for person the xml dcoument does not validate because of that attribute. I have tried with prefixes on the attr. also. Here is my error:Attribute "id" is not allowed in element <main-ns:Person>Sample.xml<?xml version="1.0" encoding="UTF-8"?><!--Sample XML file generated by XMLSpy v2011 (http://www.altova.com)--><x:PersonBatch xsi:schemaLocation="http://Extensions Extensions.xsd" xmlns:x="http://Extensions" xmlns:main-ns="http://Main" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <main-ns:TheDate>String</main-ns:TheDate> <main-ns:Person id="001"> <main-ns:######>String</main-ns:######> </main-ns:Person> <main-ns:Person> <main-ns:######>String</main-ns:######> </main-ns:Person></x:PersonBatch>Base1.xsd<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:b1="http://Base1" targetNamespace="http://Base1" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:complexType name="ObjType" abstract="true"> <xs:attribute name="idref" type="xs:string"/> <xs:attribute ref="b1:id"/> </xs:complexType> <xs:attribute name="id" type="xs:string"/></xs:schema>Base2.xsd<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:b1="http://Base1" xmlns:main-ns="http://Main" targetNamespace="http://Main" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:import namespace="http://Base1" schemaLocation="Base1.xsd"/> <xs:complexType name="PetType"> <xs:complexContent> <xs:extension base="b1:ObjType"> <xs:sequence> <xs:element name="PetAnimal" type="xs:string" minOccurs="1"/> <xs:element name="PetName" type="xs:string" minOccurs="1"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="PersonType"> <xs:complexContent> <xs:extension base="b1:ObjType"> <xs:sequence> <xs:element name="######" type="xs:string"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="DocType"> <xs:complexContent> <xs:extension base="b1:ObjType"> <xs:sequence> <xs:element name="TheDate" type="xs:string" minOccurs="1"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="Doc" type="main-ns:DocType"/> <xs:element name="Person" type="main-ns:PersonType"/> <xs:element name="Pet" type="main-ns:PetType"/></xs:schema>Extension.xsd<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:x="http://Extensions" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:b1="http://Base1" xmlns:main-ns="http://Main" targetNamespace="http://Extensions" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:import namespace="http://Main" schemaLocation="Base2.xsd"/> <xs:import namespace="http://Base1" schemaLocation="Base1.xsd"/> <xs:complexType name="PersonBatchType"> <xs:complexContent> <xs:extension base="main-ns:DocType"> <xs:sequence> <xs:element ref="main-ns:Person" minOccurs="2" maxOccurs="5"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="PersonBatch" type="x:PersonBatchType"> <xs:annotation> <xs:documentation>Comment describing your root element</xs:documentation> </xs:annotation> </xs:element></xs:schema>
×
×
  • Create New...