OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XML question - reference points

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: XML question - reference points
  • From: "Pascarella, Randy" <randall.pascarella@hp.com>
  • Date: Tue, 6 Apr 2004 17:46:12 -0500
  • Thread-index: AcQcKPYjP2Kp+abnTO2lKZT5nhoTLw==
  • Thread-topic: XML question - reference points

Title: XML question - reference points

Hello,
        I confess I'm new to XML, so please forgive my newbie question in advance.  Take the following XML snippets for reference.  The first snippet describes some streets in a city, and let's say this file was generated by some guy, Tom.

Tom's city description:
<city>
  <name>Chicago</name>
  <streets>
    <street>
      <name>Main</name>
      <zipcode>60609</zipcode>
    </street>
    <street>
      <name>West</name>
      <zipcode>60603</zipcode>
    </street>
    ...
  </streets>
</city>

Now Bob describes the same city with the same schema, but the content differs (the street names are followed by "Street"):

<city>
  <name>Chicago</name>
  <streets>
    <street>
      <name>Main Street</name>
      <zipcode>60609</zipcode>
    </street>
    <street>
      <name>West Street</name>
      <zipcode>60603</zipcode>
    </street>
    ...
  </streets>
</city>

The point is that the two files describe the same thing from the same schema in different ways via the values of the elements.  So if I, being an intercessor, want to link the two together in a common way, how would I do this?  I am currently thinking of something like this.  Let's say I'm a government employee wanting to provide common tags for Bob and Tom to use in their XML files for consistency.  I define a tag called <gov.illinois.chicago.street.name> as a "reference point".  Bob and Tom then insert this tag and the value that I've predefined for them (the street name followed by "St."), so when my software parses their XML files, I can find the street name in the format that I'm looking for, which is the industry standard way now.  If I want to find the zip code of the street "Main St.", I look for my tag and look up the zip code, regardless of how Bob and Tom named the street.

<city>
  <name>Chicago</name>
  <streets>
    <street>
      <name>Main Street</name>
      <gov.illinois.chicago.street.name>Main St.</gov.illinois.chicago.street.name>
      <zipcode>60609</zipcode>
    </street>
    <street>
      <name>West Street</name>
      <gov.illinois.chicago.street.name>West St.</gov.illinois.chicago.street.name>
      <zipcode>60603</zipcode>
    </street>
    ...
  </streets>
</city>

The whole point is that I want to give Tom and Bob the flexibility to use whatever values they want for the names, but have an "internal" way to map those elements into standardized elements that anyone can find, since the standardized elements and values would be published for all to use.

Does this make sense?  Is there a better way to do this?  Am I off in the weeds?

Thanks!

Randy





 

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

Copyright 2001 XML.org. This site is hosted by OASIS