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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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.