[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] using Key/KeyRef VS ref to Global element..
I have a need where a list of global elements need to be referenced at many places in my XML instance. I am trying to design an efficient XSD. For e.g. I have a list of global 'merchant' elements below that need to be referenced in 'service' element. I would like to define list of 'merchant' elements only once and refer them inside the 'service' elements. I am trying Not to duplicate same 'merchant' definition inside 'service' elements below: <rootElement> <merchants> <merchant> <key1>XYZ</key1> <key2>x@y...</key2> <address>aa aa</address> </merchant> <merchant> <key1>ABC</key1> <key2>c@c...</key2> <address>bb aa</address> </merchant> .....many other merchants... </merchants> <services> <service> <data>dsdsds</data> I need to refer to merchant XYZ here </service> <service> <data>rerere</data> I need to refer to merchant ABC here </service> <service> <data>ccccc</data> I need to refer to merchant XYZ here </service> many other services.... <services> <rootElement> With my understanding, I need to use Key/KeyRefs with Xpaths. Is that correct? I also read about using 'Ref' attribute to refer to global elements. Not sure which approach is better to Avoid duplicates of 'merchant' element definition. Each 'merchant' element is uniquely identified with 'key1' and 'key2' elements. Any advice on efficient Schema for the above XML instance? Appreciate your time. -D __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|