Jump to content

assigning the value of an xml node element to div tag


tamanna35

Recommended Posts

HelloI want to know, how can I assign the value of an xml node element to a div tag.The reason I want this is I have xml which is like below<ProductList><ProductDetails> <ProductID> AX1 </ProductID> <ProductType> Commercial </ProductType> <ProductValue> Tradeable </ProductValue> <ProductBuyer> Bulk </ProductBuyer><ProductDetails><ProductDetails> <ProductID> AX1 </ProductID> <ProductName> Zeefolex </ProductName> <ProductCode> ARN005</ProductCode> <ProductChain> Continuous </ProductChain><ProductDetails><ProductDetails> <ProductID> AX2 </ProductID> <ProductType> Commercial </ProductType> <ProductValue> Tradeable </ProductValue> <ProductCost> 543 </ProductCost><ProductDetails><ProductDetails> <ProductID> AX2 </ProductID> <ProductName> Cabezon </ProductName> <ProductCode> ARN00776</ProductCode> <ProductChain> Spread </ProductChain><ProductDetails></ProductList>the information of product is present as multiple xml nodes , like for product AX1 , we have 2 different xml node bringing different information. and this is being displayed in the form of a table on the page. I do not have control over the type of xml, that I am receiving, As we have continuous rows of different information of same product, I WANT to assign a separate div tag to all the rows containing information about same product, I want to highlight all the rows belonging to the same product when the user takes his mouse on any one of the rows.And if they click on any of the rows, it takes them to a page that contains all the information about that single product.So I am facing problem As we have continuous rows of different information of same product, I WANT to assign a div tag to all the rows containing information about same product, it is using a loop <xsl:for each............> to display all the information in seperate rowsSo what I want is , everytime it loops, it assigns the product id as div id or class, and I can add a function and pass this div id or class as an argument to that functionlike <xsl:for-each select="//ProductList/ProductDetails"><div id=<xsl:value-of select ='./ProductID'> <tr onmouserollover= highlighteffect(./ProductID)>>and then define this function highlighteffect, such that it highlights all the rows under the div tag with same id.Can this be done, assigning the node element to the div id or class.Cause when I tried I got errors , like assigning the same div tag , div tag has already been used.and when I tried this <div id=<xsl:value-of select ='./ProductID'> I got an error something like "<" unexpected element for the underlined "<" ORIs there any other method to associate rows belonging to same product?thank you very muchOR how can I do grouping on this data?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...