Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xPath how

From: "Dimitre Novatchev" <dimitren@---.---.-->
To: 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 )
>
>
> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent