🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by jivanmuktaWYTNIJTO Mon, 20 Jul 2009 12:33
newbie uczy się XML i XSD
#10204
Author: jivanmuktaWYTNIJTO
Date: Mon, 20 Jul 2009 12:33
42 lines
2124 bytes
Dzień dobry,
Uczę się XML i XSD. Mam taki plik XML:

<?xml version="1.0" encoding="utf-8"?>
<publisherCategories>
    <category>
        <id>2</id>
        <name>Ebooki</name>
    </category>
    <category>
        <id>101</id>
        <name>Biznes</name>
        <parentId>2</parentId>
    </category>
</publisherCategories>

Zrobiłem do tego schemat (czy dobrze?):

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="publisherCategories">
		<xsd:element name="category" minOccurs="0">
			<xsd:complexType>
				<xsd:element name="id" type="xsd:integer"/>
				<xsd:element name="name" type="xsd:string"/>
				<xsd:element name="parentId" type="xsd:integer"/>
			</xsd:complexType>
		</xsd:element>
	</xsd:element>
</xsd:schema>

Proszę o pomoc: dlaczego walidator http://tools.decisionsoft.com/schemaValidate/
wypluwa mi błąd:

Validation 	3, 46 	s4s-elt-must-match.1: The content of 'publisherCategories'
must match (annotation?, (simpleType | complexType)?, (unique | key |
keyref)*)). A problem was found starting at: element.

(Nie rozumiem co to znaczy lokalizacja 3, 46.)
Dziękuję.

-- 
Wysłano z serwisu OnetNiusy: http://niusy.onet.pl
Re: newbie uczy się XML i XSD
#10205
Author: szomiz
Date: Tue, 21 Jul 2009 15:27
13 lines
1494 bytes
Użytkownik <jivanmuktaWYTNIJTO@poczta.onet.pl> napisał w wiadomości 
news:12d2.000002c9.4a646437@newsgate.onet.pl...

> (Nie rozumiem co to znaczy lokalizacja 3, 46.)
> Dziękuję.

Strzelam - wiersz trzeci, znak czterdziesty szosty. Co moze nic nie znaczyc 
(a konkretnie nie wskazywac na miejsce w ktorym problem sie zaczyna).

A w schemie masz blad polegajacy na tym, ze xs:element nie moze byc 
dzieckiem xs:complexType (co moze byc walidator ci uprzejmie napisal).

sz. 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads