• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

an easy xml question from the J2EE Web Services (RMH) book

 
naz alam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

as pathetic as this may sound, i for the life of me can't figure out the answer to the question listed on p.54 of the book: '...can you explain why the XML document in Listing 3-18 is valid for the XML schema in Listing 3-15'?

this is with the assumption that i'm supposed to know the answer having read only up to p. 54 in the book. what am i missing?

thanks
naz
 
Sim Kim
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Naz,

Schema in Listing 3.15 syas elementFormDefault="qualified" but the Elements in XML of Listing 3.18 are not qualified. But if you see the XMl carefully there us a default namespace assigned xmlns="htt://ww.Monson-Haefel.com/jwsbook" which makes all the elemnts qualified !

When is you exam scheduled ?
 
naz alam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Sim. but what confuses me is that there is an <address> element declared in the schema, and in the document itself there is no element with the same name. there are <shippingaddress> and <billingaddress> elements which are of the same type as <address>, however is that still valid? how?

i'm scheduled to go early next week, but i've only given myself a week to study for this...and there are too many fine points to remember lets see.
 
Sim Kim
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right !

I didn't notice it Are you reading between the lines
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by naz alam:
however is that still valid? how?


Because the document in 3-18 is actually based on the schema in 3-24, not 3-15. However the complex type {http://www.Monson-Haefel.com/jwsbook}Address which isn't shown in 3-24 is assumed to have the same subelements as {http://www.Monson-Haefel.com/jwsbook}USAddress in 3-15.

Errata for RMH are posted at http://www.monson-haefel.com/jws_errata.html but they aren't complete and haven't been updated for a long time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic