Home All Groups Group Topic Archive Search About

XML PROBLEM HELP NEEDED URGENTLY

Author
6 Sep 2006 8:17 AM
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

--
Message posted via http://www.dotnetmonster.com

Author
6 Sep 2006 9:20 AM
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.

gauravkg via DotNetMonster.com wrote:
Show quoteHide quote
> 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
>
Are all your drivers up to date? click for free checkup

Author
6 Sep 2006 11:56 AM
gauravkg via DotNetMonster.com
thanks for the help ,u judge the problem rightly.in this like i



<products>
>    <product>
>        <id>11</id>
>        <reviews>
>            <review>
>                <review_title>It is good product
>                <review_description>i have tried it .It isa good product
>            </review>
                                                                  <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 Booysen wrote:
Show quoteHide quote
>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

Author
6 Sep 2006 5:43 PM
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" <u25584@uwe> wrote in message
news:65e25bbff0d3f@uwe...
Show quoteHide quote
> thanks for the help ,u judge the problem rightly.in this like i
>
>
>
> <products>
>> <product>
>> <id>11</id>
>> <reviews>
>> <review>
>> <review_title>It is good product
>> <review_description>i have tried it .It isa good product
>> </review>
>                                                                  <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 Booysen wrote:
>>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
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200609/1
>

Bookmark and Share