Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XML. Create relationships.

From: shapper <mdmoura@-----.--->
To: NULL
Date: 7/13/2009 5:49:00 AM
Hello,

I am using XML files to save data for Products and Brands and I have
the following (example):

<Products>
  <Product>
    <Id>1</Id>
    <Name>Series 3</Name>
    <Brand>
      <Id>1</Id>
      <Name>BMW</Name>
    </Brand>
  </Product>
</Products>

And on Brands I have:

<Brands>
  <Brand>
    <BrandId>1</BrandId>
    <Name>BMW</Name>
  </Brand>
</Brands>

I think that on products I should change it to:

  <Product>
    <ProductId>1</ProductId>
    <Name>Series 3</Name>
    <BrandId>1</BrandId>
  </Product>

Replicating how a database works and then using LINQ to build the
Product object that contains Brand object.
This way if a Brand changes I don't need to change all the records in
Products.

What do you think?

And if I have a Many to Many relationship I could do something like:

<Products>
  <Product>
    <ProductId>1</ProductId>
    <Name>Series 3</Name>
  </Product>
</Products>

<Brands>
  <Brand>
    <BrandId>1</BrandId>
    <Name>BMW</Name>
  </Brand>
</Brands>

<ProductsBrands>
  <ProductBrand>
     <ProductId>1</ProductId>
     <BrandId>1</BrandId>
  </ProductBrand>
<ProductsBrands>

Is this the way to go?

Thanks,
Miguel


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent