| Author |
an easy xml question from the J2EE Web Services (RMH) book
|
naz alam
Greenhorn
Joined: Nov 11, 2008
Posts: 3
|
|
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
Joined: Aug 06, 2004
Posts: 268
|
|
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
Joined: Nov 11, 2008
Posts: 3
|
|
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
Joined: Aug 06, 2004
Posts: 268
|
|
You are right ! I didn't notice it Are you reading between the lines
|
 |
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
|
|
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.
|
"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
|
 |
 |
|
|
subject: an easy xml question from the J2EE Web Services (RMH) book
|
|
|