Jump to content

Recommended Posts

Posted

I am trying to get a program working that uses a (poorly) written tutorial. It uses an XML file which calls an XLS style sheet.

 

This is the XLS Style Sheet:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

 

  <xsl:template match="/">

    <xsl:apply-templates select="location"/>

  </xsl:template>

 

  <xsl:template match="location">

    <div style="padding-right: 8px; margin-top: 2px">

      <xsl:apply-templates select="info"/>

    </div>

  </xsl:template>

 

  <xsl:template match="info">

 

    <xsl:variable name="page" select="../@arg0"/>

    <xsl:variable name="address">

        <xsl:for-each select="address/line">

          <xsl:if test="position() > 1">, </xsl:if>

          <xsl:value-of select="."/>

        </xsl:for-each>

    </xsl:variable>

 

    <div style="font-weight: bold">Custom!</div>

 

    <div>

<img>

    <xsl:attribute name="src">

  <xsl:value-of select="image"/> 

    </xsl:attribute>

</img>

    </div>

 

    <div style="font-size: small; margin-top: 14px">

      <xsl:apply-templates select="address/line"/>

    </div>

 

  </xsl:template>

 

  <xsl:template match="line">

    <div style="margin-top: 2px"><xsl:value-of select="."/></div>

  </xsl:template>

 

  <xsl:template name="getSingleLineAddress">

    <xsl:for-each select="address/line">

      <xsl:if test="position() > 1">, </xsl:if>

      <xsl:value-of select="."/>

    </xsl:for-each>

  </xsl:template>

 

</xsl:stylesheet>

The tutorial goes on to 'hack' the above style sheet so that the XML file can use standard HTML tags. The 'hack' to the XLS style sheet isn't precisely given, but when clicking on the link that is suppsoed to give the code for the style sheet, this is what i get:
<xsl:stylesheet version="1.0">

<xsl:template match="/">

<xsl:apply-templates select="location"/>

</xsl:template>

<xsl:template match="location">

<xsl:apply-templates select="info"/>

</xsl:template>

<xsl:template match="info">

<xsl:variable name="page" select="../@arg0"/>

<div>

<xsl:copy-of select="minipage/node()"/>

</div>

</xsl:template>

</xsl:stylesheet>

 

The code for the above stylesheet doesn't look long enough (relative to the one above it) and i really don't know anything about XML and XLS files (can you tell :) ).

 

Can anybody tell if the above should be enough to display HTML tags in an XML file that calls this style sheet; if not, what is missing and/or any leads as to what may be wrong. (or am i way off base?)

 

As always, thank you.

Posted

I merged your posts,

we read all forums.

 

Sorry no one has any insight on this.

Maybe it will take a little longer for all the family members to check in

and help.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...