[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Using attribute values in html conversion

Subject: Using attribute values in html conversion
From: "Zietak, James" <James.Zietak@xxxxxxxxxxxxxxx>
Date: Tue, 1 Oct 2002 14:48:01 -0400
zietak
Hello All,

I'm trying to convert an XML document to HTML using XSLT. The problem is I
want to use the value of an attribute as a value for an attribute of an html
node. Here is an example.

customer.xsd
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="Person">
        <complexType>
            <sequence>
                <element name="surname" type="string" maxLength="10"/>
                <element name="firstname" type="string" maxLength="10"/>
                <element name="middlename" type="string" maxLength="10"/>
                <element name="gender" type="string"/>
                <element name="dob" type="string" maxLength="10"/>
            </sequence>
        </complexType>
    </element>
</schema>

I would like to take an element:
	<element name="surname" type="string" maxLength="10"/>

and generate an html input field using the values of the attributes name,
and maxLength ie:
	<input type="text" name=$SURNAME  maxlength=$MAXLENGTH/>

The first idea that came to mind would be something of the sort:
	<input type="text" name=<xsl:apply-templates select="@name"/>
maxlength=<xsl:templates select="@maxLength"/> >

Obviously this is incorrect. I assume this is due to the fact that the
output must be well-formed html. Is there any way to work around this?

Cheers,
 -jamie

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.