View Single Post
  #3 (permalink)  
Old November 28th, 2008, 05:44 AM
mswin mswin is offline
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Here are the xml and xslt that I am using:
XML:

 <?xml version="1.0" encoding="iso-8859-1" ?>
<company>
  <name>XYZ Inc.</name>
  <address1>One Abc Way</address1>
  <address2>Some avenue</address2>
  <city>Tech city</city>
  <country>Neverland</country>
  </company>


XSLT:

<!--
    - XSLT is a template based language to transform Xml documents
    It uses XPath to select specific nodes
    for processing.

    - A XSLT file is a well formed Xml document
-->


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


<xsl:output method="html" />

    <!--
        Main template to kick off processing our Sample.xml
        From here on we use a simple XPath selection query to
        get to our data.
    -->
    <xsl:template match="/">

        <html>

            <head>

                <title>Welcome to <xsl:value-of select="/company/name"/></title>

                <style>
                    body,td {font-family:Tahoma,Arial; font-size:9pt;}
                </style>

            </head>

            <body>
                <h2>Welcome to <xsl:value-of select="/company/name"/></h2>
                <p/>
                <b>Our contact details:</b>
                <br/>
                <br/>
                <xsl:value-of select="/company/name"/>
                <br/>
                <xsl:value-of select="/company/address1"/>
                <br/>
                <xsl:value-of select="/company/address2"/>
                <br/>
                <xsl:value-of select="/company/city"/>
                <br/>
                <xsl:value-of select="/company/country"/>
                <br/>
                <xsl:value-of select="Ø"/>

            </body>

        </html>

    </xsl:template>

</xsl:stylesheet>


I am using XSLTCompiledTransform in C#, and writing result to html file.

Even I added encoding to the xml file it doesn't work. Still I get the same error.

Many thanks for further help on this.
Reply With Quote