schemaLocation...Need help very badly

4 views
Skip to first unread message

El Nino

unread,
Jun 19, 2008, 11:15:26 AM6/19/08
to XML Schema
Hi All,
I am new to XML.I have started reading a book(Monson & Haefel-J2EE Web
Services) since few days and am stuck very badly at apoint.Hoping that
you all will help me out!!!
Here is the address.xsd file:
<schema xmlns:"http://www.w3.org/2001/XMLSchema"
xmlns:mh="http://www.Monson-Haefel.com/jwsbook"
targetNameSpace="http://www.Monson-Haefel.com/jwsbook" >

<element name="purcahseOrder" type="mh:USAddress" />

<complexType name="USAddress"?
<sequence>
<element name="name" type="string" />
<element name="street" type="string" />
<element name="city" type="string" />
</sequence>
</complexType>

</schema>

And the address.xml file is:
<purchaseOrder xmlns="http://www.Monson-Haefel.com/jwsbook"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.Monson-Haefel.com/jwsbook
address.xsd">
<name>El Nino</name>
<city>Pune</city>
<street>J.M</street>

I have kept both the files in the same folder.According to the schema
above xml file should generate an error but it doesnt.Can anyone help
me out why is this happening??

Waiting for your generous responses,
El Nino

msbalaji

unread,
Jun 24, 2008, 6:41:20 AM6/24/08
to XML Schema
Hi,

As per Schema elements appear in name, street and city, but in your
XML elements in wrong order

<name>El Nino</name>
<city>Pune</city>
<street>J.M</street>

instead

<name>El Nino</name>
<street>J.M</street>
<city>Pune</city>



Regards,
Balaji. M
sql-ebooks.blogspot.com

El Nino

unread,
Jun 25, 2008, 11:31:12 AM6/25/08
to XML Schema
Yes.That's what my question is!!!!
If the elements in .xml are not in accordance with the schema,it
should produce an error.But no error is being shown.
Any other suggestions??

Thanks,
El Nino
Reply all
Reply to author
Forward
0 new messages