Home > Net >  Selecting the value of "type" attribute from XML file using XSLT
Selecting the value of "type" attribute from XML file using XSLT

Time:01-14

XML:

<laptop category="business">
        <name lang="en">HP Pavilion 15</name>
        <color>Silver</color>
        <processor>i5-1135G7</processor>
        <price type ="pln">3200</price>
        <price type ="usd">795</price>
        <price type ="euro">700</price>
</laptop>

XSL:

<h2><xsl:value-of select="name"/></h2>
<p>Color: <xsl:value-of select="color"/></p>
<p>Processor: <xsl:value-of select="processor"/></p>

I want to show as above, 3 different prices in XSL based on attribute type, how can i do it? Please help.

CodePudding user response:

The question is not entirely clear.

To show a specific price, you could use a enter image description here

  •  Tags:  
  • Related