Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - xslt not working when xml has xmlns="urn" in root element. >Thread Next - Re: xslt not working when xml has xmlns="urn" in root element. Re: xslt not working when xml has xmlns="urn" in root element.To: NULL Date: 4/4/2007 1:37:00 PM Lee wrote: > <ProductSearch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns="urn:yahoo:aprods" xsi:schemaLocation="urn:yahoo:aprods > http://api.shopping.yahoo.com/shoppingservice/v2/aproductsearch.xsd"> > .................. > </ProductSearch> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> Add xmlns:ap="urn:yahoo:aprods" on the xsl:stylesheet element, then use the prefix 'ap' in your XPath expressions e.g. > <xsl:for-each select="ProductSearch/ > Products/Product"> <xsl:for-each select="ap:ProductSearch/ap:Products/ap:Product"> > <xsl:value-of > select="Catalog/PriceFrom"/> <xsl:value-of select="ap:Catalog/ap:PriceForm"> > <xsl:value-of > select="Catalog/PriceTo"/> <xsl:value-of select="ap:Catalog/ap:PriceTo"/> -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
