[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
using Key/KeyRef VS ref to Global element..
- From: dave <ceek63@yahoo.com>
- To: xml-dev@lists.xml.org
- Date: Sun, 28 Oct 2007 16:51:06 -0700 (PDT)
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]