Wrox Programmer Forums
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 8th, 2004, 11:43 PM
Registered User
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Professional ASP XML Book

I am trying to learn xml/xsl using wrox's Professional ASP XML book.

I am having trouble in chapter 8 trying to perform transformations.

Here is my code:

<?xml version="1.0" encoding="utf-8" ?>
            <name>Jon Doe</name>
        <contact relation="family">
            <name>Mary Jones</name>
            <name>Mike Wilson</name>

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

    <xsl:template match="/">
        <xsl:apply-templates />

    <xsl:template match="/contact_info">
                <xsl:apply-templates />

    <xsl:template match="contact_info">
        <xsl:for-each select="./*">
                <xsl:when test=".[.!nodeName()='personal']">
                    <div style="background-color:teal; color:white; font-family:verdana, arial; font-size:12pt; padding:2px;">Personal Contacts</div>
                    <div style="background-color:black; color:white; font-family:verdana, arial; font-size:12pt; padding:2px;">Business Contacts</div>
            <xsl:apply-templates />
        <p />

    <xsl:template match="contact">
        <xsl:for-each select=".">
                <xsl:if test="@relation[.!value()='family']">
                    <xsl:attribute name="style">font-weight:bold;</xsl:attribute>
                <xsl:value-of select="name" />
                    <div style="font-size:10pt; left:.25cm; position:relative;">
                        <xsl:value-of select="phone" />


<%@ Language="VBSCRIPT"%>
    Dim pDoc, pStyle, sHtml

    Set pDoc = Server.CreateObject("Microsoft.XmlDom")
    Set pStyle = Server.CreateObject("Microsoft.XmlDom")

    If Not pDoc Is Nothing And Not pStyle Is Nothing Then
        pDoc.async = False
        pStyle.async = False

        If Not pDoc.parseError And Not pStyle.parseError Then
            sHtml = pDoc.transformNode(pStyle)
            Response.Write("Parser error")
        End If
        Response.Write("Error creating Xml objects")
    End If

When the transformation takes place, not html is returned, any ideas why?


Old January 9th, 2004, 04:21 AM
Friend of Wrox
Join Date: May 2003
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Joe,

Just a little typo error in the following line:


Please correct the variable name as follows


Charul Shukla

Old January 9th, 2004, 08:50 AM
Registered User
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Well, don't I feel like an idiot now, lol

Thanks Charul

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Professional XML" book Habibb XML 1 November 7th, 2006 03:50 AM
Professional ASP.NET 2.0 Book SWA001 BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 May 30th, 2006 09:53 AM
Search code for book "Professional asp.net xml C#" Sunny@China All Other Wrox Books 1 December 4th, 2005 07:08 PM
Professional VB6 XML Book garnold@tfbbiking.com XML 2 December 15th, 2004 12:56 PM
code for book Professional ASP 3.0 ravinkumar Classic ASP Databases 0 September 18th, 2003 04:34 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.