[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

using Key/KeyRef VS ref to Global element..

  • From: dave <ceek63@y...>
  • To: xml-dev@l...
  • Date: Sun, 28 Oct 2007 16:51:06 -0700 (PDT)

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:
    <key1>XYZ</key1> <key2>x@y...</key2>
<address>aa aa</address>
    <key1>ABC</key1> <key2>c@c...</key2>
<address>bb aa</address>
  .....many other merchants...
  <service> <data>dsdsds</data>
    I need to refer to merchant XYZ here
  <service> <data>rerere</data>
    I need to refer to merchant ABC here
  <service> <data>ccccc</data>
    I need to refer to merchant XYZ here
  many other services....

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'

Any advice on efficient Schema for the above XML

Appreciate your time.


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.