<Products xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<Product>
<status>1</status>
<ProductName>******************</ProductName>
<model>******************</model>
<ProductQTY>******************</ProductQTY>
<CostPrice>******************</CostPrice>
<RetailPrice>******************</RetailPrice>
<FullCategoryPath>******************</FullCategoryPath>
<description>
<![CDATA[******************
]]></description>
<image_link>https://******************</image_link>
</Product>
<Product>
<status>1</status>
<ProductName>******************</ProductName>
<model>******************7</model>
<ProductQTY>0</ProductQTY>
<CostPrice>1******************</CostPrice>
<RetailPrice>141.9</RetailPrice>
<FullCategoryPath>******************</FullCategoryPath><description>
<![CDATA******************
]]></description>
<image_link>https://******************</image_link>
</Product>
</Products> <!-- Added by edit -->
as you see above.
How can I fix my XSLT file?
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
exclude-result-prefixes="sitemap image">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node() "/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xml>
<xsl:for-each select="node()">
<xsl:choose >
<xsl:when test="node() | model !=''">
<Product>
<xsl:apply-templates select="@* | node() "/>
<SProductCode >
<xsl:value-of select="node() | @model" />
</SProductCode>
<CategoryName>
<value-of select=""/>
</CategoryName>
.
.
.
.
</Product>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xml>
</xsl:template>
</xsl:stylesheet> <!-- Added by edit -->
For example:
How can I show category names product name ex. from my node(). I can't parse them.
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
These two namespaces ruin me so badly.They are inside of my root element"Products".
Output is: All values are false .
<xml>
<Product>
<SProductCode>1</SProductCode>
<CategoryName>
<value-of select="node() | @model" />
</CategoryName>
</Product>
<Product>
<SProductCode>1</SProductCode>
<CategoryName>
<value-of select="node() | @model" />
</CategoryName>
</Product>
What am I gonna write for "SProductCode" or"CategoryName" to properly run it?