Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: xPath how [Thread Next] Re: xPath howTo: NULL Date: 8/3/2006 6:13:00 AM > I wish I knew XSL/XPath better. It is such a struggle. I keep trying to > relate it to SQL and perhaps that is the problem. People have been successful learning XPath the fun way using the XPath Visualizer. Cheers, Dimitre Novatchev "HSalim[MVP]" <HSalim@m...> wrote in message news:%23hxGvrstGHA.324@T...... > Greg, > Thanks again! That did it. > > Now I have my xsl all worked out to convert the source file into csv. > > I now want to transform the source XML into a new XML. > What I want to do is to flatten the XML file, quite similar to the CSV. > > The snippet below is the xsl I used to transform the source XML to CSV > (thanks toDave McMahon and you!) > How do I copy the tags? (elements?) > Do I have to wite them out as text or is there a simpler way? > In the snippet below, the price should appear as > <MapPrice>2323.34</MAPPrice> > > I wish I knew XSL/XPath better. It is such a struggle. I keep trying to > relate it to SQL and perhaps that is the problem. > > Thanks in advance > Habib > > --------------------------- > <xsl:template match="smbxml/response/inventoryItem"> > <xsl:text>"</xsl:text> > <xsl:value-of select="@handle"/> > <xsl:text>","</xsl:text> > <xsl:value-of select="name"/> > <xsl:text>","</xsl:text> > <xsl:value-of select="displayName"/> > <xsl:text>","</xsl:text> > <xsl:value-of > select="itemPriceList/itemPriceLine[itemPriceTypeRef/name='MAP > Price']/itemPrice"/> > <xsl:text>","</xsl:text> > ... > > </xsl:template> > > > > > "Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_com> wrote in message > news:un33XBptGHA.644@T...... > Elements and Attributes are not allowed to have spaces in their name. The > spaces you are encountering are part of an attribute VALUE. > > You need something like this: > > <xsl:value-of select="customFieldValues/customFieldValue[@name='Item Part > Number']"/> > > > -- > Greg Collins [Microsoft MVP] > Visit Brain Trove ( http://www.BrainTrove.com ) > > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
