Jump to content
AJBM

Validar Data

Recommended Posts

AJBM

Boas!

Eu tenho que fazer isto:

Um novo tipo de dados “Year” que deriva de “gYear” e só aceita

valores entre 1950 e 2011 (inclusive)

Eu tenho isto

<xs:schema version="1.0"
	   xmlns:xs="http://www.w3.org/2001/XMLSchema"
	   elementFormDefault="qualified">
<xs:element name="Song">
	<xs:complexType>
		<xs:sequence>
			<xs:element name= "Title">
				<xs:simpleType>
					<xs:restriction base="xs:string">
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name= "Year">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:gYear">

						</xs:extension>


					</xs:simpleContent>

				</xs:complexType>
			</xs:element>
			<xs:element name= "Artist">
				<xs:simpleType>
					<xs:restriction base="xs:string">
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
</xs:element>
</xs:schema>

Quando faço as restrições da-me sempre erro

Share this post


Link to post
Share on other sites
AJBM

Assim já funciona, mas é possível fazer isto usando extensions?

<xs:simpleType>

				    <xs:restriction base="xs:gYear">
					    <xs:minInclusive value="1950"></xs:minInclusive>
					    <xs:maxInclusive value="2011"></xs:maxInclusive>
				    </xs:restriction>

			    </xs:simpleType>

Share this post


Link to post
Share on other sites
AJBM

Crie num documento XSD o vocabulário necessário para estruturar o

documento referente ao modelo do boletim para incrição em exames. O XSD

deverá reutilizar informação referente aos cursos e unidades curriculares que

deverão estar num segundo ficheiro XSD.

Já criei o xsd, agora não sei como é que vou liga-los alguém me pode dar uma dica

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.