[xslt] problems using document()



Hello,

I am writing a real estate listings system. It uses XML gathered from an mls database, that is transformed with an xsl stylesheet. It works fine for gathering/displaying 99% of the listing data, but it dies on the additional image area. Here is a snippet from the XML file:

<LotSize>3960.0 sqft.</LotSize>
<Basement>Full</Basement>
<AdditionalPhotoXML>http://www.realtylink.org/listings/view.cfm?list_num=404700&amp;AgentID=032428&amp;XML=true</AdditionalPhotoXML>
<OpenHouseTime></OpenHouseTime>

As stated above, I have no problem with displaying data from the main xml file, but I can't figure out how to transform _and_ integrate the results into the middle of the main xsl file...

In the sub-xml file there can be a possibility of 10 images. If a listing doesn't have any additional pictures then the node is left empty. This is what I have so far:

<xsl:if test="Extended/AdditionalPhotoXML[text()]">
<xsl:for-each select="document({Extended/AdditionalPhotoXML})/html/body/listingphotos/stillphotos/photo">


and then I have this 10 times, with the photo # incremented on each one:

<xsl:if test="photo[ number='1']/fullpicture[text()]">
<td width="65"><img src="{photo/fullpicture}" width="58" height="58" /></td>
</xsl:if>



And then after all the pictures I do the same in a separate <tr> displaying the descriptions instead of images.


I can't seem to get it to work. What am I doing wrong? Is there any other way I can do it?

Thanks in advance,

Casimir Loeber

p.s. to view the sub-xml file, just replace the &amp; with a single & . Not to be insulting, as I fell for that simple trick...

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]