Sagar thanks.
My code is now running.
New problems now.
My xsd is as follows:
My xml is as follows:
I run my code and get the following exception:
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'pen'.
How to get around this.
I have mentioned the pen element in the schema.
Also.
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
Do I need to mention:
http://www.w3.org/2001/XMLSchema as the namespace.
Would something else work in there?
I read somewhere that its just a
string.
The namespace thing is getting too confusing.
Do I need to associate with a namespace when my xsd is on machine.
What is the namespace saving me from.
What is the use of mentioning a namespace url if my machine is not connected to the network?
Priety.