|
Hi Cheenu I think there’s a few different bugs
here. First of all (as mentioned in another reply to this mail) in your schema
you have the attribute: targetNamespace="http://www.w3.org/2001/XMLSchema" The targetNamespace attribute is the
namespace by which you want the elements you define in this schema to be known.
You have chosen the namespace of XML Schema itself which is probably not what
you intended (I think trying to extend Schema itself in this way is not to be
recommended – it may even be illegal – I’m not sure). So
start by changing this to something of your own e.g. targetNamespace="http://myNamespace.org/myTest" You will, of course, have to change the
default namespace attribute you use in the instance doc to match this –
so your 2nd append should look like this: sb.append("<BusRoute
xmlns='http://myNamespace.org/myTest'>"); Secondly I would add in the attribute: elementFormDefault=”qualified”
into the <xs:schema> element. There
are alternatives to this, but seems to map to what most people (and you in
particular) expect the instance doc to look like – so for instance it
will then be correct to refer to _all_
your elements using their namespaces (if you do not do this then only the
global elements should use the namespace – the local elements such as Id,
Bus and Seat would need to be referred to without their namespace –in
your instance doc you have declared a default namespace attribute which affects
_all_ descendants so for you this
is important). Thirdly, as Vlad pointed out below, XML is
case-sensitive – your instance document <bus> element will not
match your schema <Bus> element. After that it should all work. Cheers, From: Vlad Mangeym
[mailto: Should you have 'b' capitalized?
Yahoo!
Autos. Looking for a sweet ride? Get pricing, reviews, & more on new
and used cars. _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. |
- Parsing array elements cheenu vasan
- Re: Parsing array elements Vlad Mangeym
- Re: Parsing array elements Jerome Magnet
- RE: Parsing array elements Lawrence Jones

