XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
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.com</key2>
<address>aa aa</address>
  </merchant>
  <merchant>
    <key1>ABC</key1> <key2>c@c.com</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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS