XML PROBLEM HELP NEEDED URGENTLY

  • Thread starter gauravkg via DotNetMonster.com
  • Start date
G

gauravkg via DotNetMonster.com

Hi i have a problem

I have a product

product_name=taj Mahal product_id=111

i and different users will be putting reviews title and review description.

this is the following xml file i have make
<reviews>



<Product>

<id>

111

</id>

<review_title>It is good book</review_title>

<review_content>I have read the book it is a good book</review_content>

</Product>

<Product>

<id>111</id>

<review_title> good book</review_title>

<review_content> the book it is a good book</review_content>

</Product>

<Product>

<id>112</id>

<review_title> good book</review_title>

<review_content> the book it is a good book</review_content>

</Product>

</reviews>



plz review it if not approperiate just tell me how to do It
 
R

Ray Booysen

Hi guaravkg

Not sure what the problem is... But I would suggest the following
changes to the xml file. I'm taking for granted that a product can be
reviewed more than once.

<products>
<product>
<id></id>
<reviews>
<review>
<review_title>
<review_description>
</review>
</reviews>
</product>
</products>

This provides a more normalised view of the data. AKA

Many products.
1 product can have more than one review.

Hope this is what you're needing.
 
G

gauravkg via DotNetMonster.com

thanks for the help ,u judge the problem rightly.in this like i



<product>
<id>11</id>
<reviews>
<review>
<review_title>It is good product
<review_description>i have tried it .It isa good product
</review>
said:
<review_title>It is fabolus product
<review_description>i have not tried it
</review>
</reviews>
</product>
</products>



now can u tell me xsl format to reterive the row where product id=11. i
really appreciate ur help





Ray said:
Hi guaravkg

Not sure what the problem is... But I would suggest the following
changes to the xml file. I'm taking for granted that a product can be
reviewed more than once.

<products>
<product>
<id></id>
<reviews>
<review>
<review_title>
<review_description>
</review>
</reviews>
</product>
</products>

This provides a more normalised view of the data. AKA

Many products.
1 product can have more than one review.

Hope this is what you're needing.
Hi i have a problem
[quoted text clipped - 44 lines]
plz review it if not approperiate just tell me how to do It
 
T

Tarren

to answer your second question, your xpath query would be
\products\product[id='11']

You would use xpath to get that node. If you unfamiliar with xslt or xpath
then you should try and find a beginner intro to them - plenty on the web.



gauravkg via DotNetMonster.com said:
thanks for the help ,u judge the problem rightly.in this like i



<product>
<id>11</id>
<reviews>
<review>
<review_title>It is good product
<review_description>i have tried it .It isa good product
</review>
<review_title>It is fabolus product
<review_description>i have not tried it
</review>
</reviews>
</product>
</products>



now can u tell me xsl format to reterive the row where product id=11. i
really appreciate ur help





Ray said:
Hi guaravkg

Not sure what the problem is... But I would suggest the following
changes to the xml file. I'm taking for granted that a product can be
reviewed more than once.

<products>
<product>
<id></id>
<reviews>
<review>
<review_title>
<review_description>
</review>
</reviews>
</product>
</products>

This provides a more normalised view of the data. AKA

Many products.
1 product can have more than one review.

Hope this is what you're needing.
Hi i have a problem
[quoted text clipped - 44 lines]
plz review it if not approperiate just tell me how to do It
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top