AnsweredAssumed Answered

xml element values using parseXMLDocuments

Question asked by boneill on Jul 23, 2008
Latest reply on Oct 22, 2008 by giorgio.cardellini
Hi all,

I am trying to read xml element values from existing webform created xml documents during the rendering process (xslt) of a different document.  In this case an xml document has a model:model_details/model:price element.

I have used the parseXMLDocuments method to get all documents that are created from a specific webform in the specified virtual path.  That works fine and I know I am getting the correct documents because the File Name below is populated correctly.

<xsl:for-each select="alf:parseXMLDocuments('model','/models/xml')">
     <xsl:variable name="vehicle"><xsl:value-of select="."/></xsl:variable>
    [b]File Name = <xsl:value-of select="fn:replaceAll(string(@alf:file_name), '.xml', '')"/>[/b]    Model Price <xsl:value-of select="$vehicle/model:model_details/model:price"/>

However the element value, price, I am trying to get comes back as empty.  I thought the $vehicle variable would be the root node of the xml document and whence the xpath $vehicle/model:model_details/model:price would get me the value.  Can anyone spread any light on what the problem may be.  Am pulling my hair out.

Model Price <xsl:value-of select="$vehicle/model:model_details/model:price"/>

Should reference price in this xml:

<model:model xmlns:alf="" xmlns:chiba="" xmlns:ev=""
xmlns:model="" xmlns:xf="" xmlns:xhtml=""
xmlns:xs="" xmlns:xsi="">
        <model:heading>Model Heading</model:heading>
        <model:image>/resources/advertising banners/bgimage.jpg</model:image>
        <model:rollover_thumbnail xsi:nil="false">/resources/models/flyouts/warranty.png</model:rollover_thumbnail>