Here is and xsl file that we use to convert XML into html.

Feel free to ask questions about the details.

<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE xsl:stylesheet  [
        <!ENTITY nbsp   "&#160;">
        <!ENTITY copy   "&#169;">
        <!ENTITY reg    "&#174;">
        <!ENTITY trade  "&#8482;">
        <!ENTITY mdash  "&#8212;">
        <!ENTITY ldquo  "&#8220;">
        <!ENTITY rdquo  "&#8221;"> 
        <!ENTITY pound  "&#163;">
        <!ENTITY yen    "&#165;">
        <!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html" encoding="iso-8859-1" />
<xsl:template match="/BSNews/release">
<!-- @id= a place holder used for a find and replace in order to allow the news 
article id to be passed in via url.newsReleaseID for the dynamic display of 
news articles. -->
        <xsl:if test="self::node()[EMAIL PROTECTED]'x0xox0x0']">
<!-- News Type -->
                <p>
                        <xsl:value-of select="category" /><br />
                        For Immediate Release
                </p>
                
<!-- Contact Information -->
                <p>
                        CONTACT: <xsl:value-of select="contact/firstName" 
/>&nbsp;<xsl:value-of select="contact/lastName" /><br />
                        <xsl:for-each select="contact/phone">
                                <xsl:value-of select="@type" /> Number: 
<xsl:value-of select="." /><br />
                        </xsl:for-each> 
                        <xsl:for-each select="contact/email">
                                <xsl:value-of select="@type" /> E-Mail Address: 
<xsl:value-of select="." /><br />
                        </xsl:for-each>
                </p>
                
<!-- Title -->          
                <h2 class="articleTitle"><xsl:value-of select="article/title" 
/></h2>
                <p class="articleSubTitle"><xsl:value-of 
select="article/subTitle" /></p>

<!-- Image -->
        <xsl:if test="article/image">
                <xsl:element name="img">
                        <xsl:attribute 
name="src">/images/NewsRoom/<xsl:value-of select="article/image" 
/></xsl:attribute>
                        <xsl:attribute name="align">middle</xsl:attribute>
                </xsl:element>
        </xsl:if>

<!-- Article -->
                <xsl:copy-of select="article/content" />
        </xsl:if>
</xsl:template>
</xsl:stylesheet>


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

---------
| 1 |   |
---------  Binary Soduko
|   |   |
---------
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246800
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to