Some XML XSLT transformation woes

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
DarkRanger
Registered User
Posts: 8346
Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:

Some XML XSLT transformation woes

Post by DarkRanger »

Not much. The following does work, I would just like to know if there is a simplified way of doing this.

Code: Select all

<xsl:choose>
    <xsl:when test="$thisTitle = document('reviews.xml')/trd:reviews/trd:review[1]/title">
        <critic><xsl:value-of select="document('reviews.xml')/trd:reviews/trd:review[1]/critic"/></critic>
        <score><xsl:value-of select="document('reviews.xml')/trd:reviews/trd:review[1]/score"/></score>
        <body>
            <xsl:for-each select="document('reviews.xml')/trd:reviews/trd:review[1]/body/paragraph">
                <paragraph>
                    <xsl:value-of select="."/>
                </paragraph>
            </xsl:for-each>
        </body>
        <screenshots>
            <xsl:for-each select="document('reviews.xml')/trd:reviews/trd:review[1]/screenshots/image">
                <xsl:element name="image">
                    <xsl:attribute name="src">
                        <xsl:value-of select="@src"/>
                    </xsl:attribute>
                    <caption><xsl:value-of select="caption"/></caption>
                </xsl:element>
            </xsl:for-each>
        </screenshots>
    </xsl:when>
This is just the first of many steps... So what I would like to know, is there an easier way to get it to go through all the elements with the when and use it when the title in both documents work?

$thisTitle is the title of the current movie I'm working with (movie title being the actual thing as this is for a university project).

Thanks for any help. :)
Image
doo_much
Registered User
Posts: 26022
Joined: 13 May 2004, 02:00
Location: Getting there...
Contact:

Re: Some XML XSLT transformation woes

Post by doo_much »

Albert - dis Saterdag aan. Gaan drink! :lol:
MOOD - Thirsty

A surprising amount of modern pseudoscience is coming out of the environmental sector. Perhaps it should not be so surprising given that environmentalism is political rather than scientific.
Timothy Casey
DarkRanger
Registered User
Posts: 8346
Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:

Re: Some XML XSLT transformation woes

Post by DarkRanger »

Dis Saterdag aan, die bulle het gewen en ek sit en doen univ werk.

Ek het waaragtig my verstand verloor...
Image
doo_much
Registered User
Posts: 26022
Joined: 13 May 2004, 02:00
Location: Getting there...
Contact:

Re: Some XML XSLT transformation woes

Post by doo_much »

:)

Ek's actuallty trots op jou. Min ander mense sal daai een regkry! :lol:
MOOD - Thirsty

A surprising amount of modern pseudoscience is coming out of the environmental sector. Perhaps it should not be so surprising given that environmentalism is political rather than scientific.
Timothy Casey
DarkRanger
Registered User
Posts: 8346
Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:

Re: Some XML XSLT transformation woes

Post by DarkRanger »

:lol: :lol:
Image
Post Reply