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

RE: using XML elements as attributes in HTML

Subject: RE: using XML elements as attributes in HTML
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 6 Oct 2004 09:06:02 +0100
xml font color
You've been given the answer, but it's not the whole answer.

When I see this:

   <font color="{{/namespace_location}color}">

I guess that you've looked at a few examples of XSLT stylesheets, you've
tried to guess the syntax and semantics of the language from these examples,
and you've guessed wildly wrong.

So please, don't just type in the answer you've been given and make guesses
about how it works, and then come back to the list next time you invent some
similar syntax that doesn't work: go and read something!

Michael Kay
http://www.saxonica.com/ 


> -----Original Message-----
> From: Seby [mailto:Sebastian.Krueger@xxxxxxxxxxxxx] 
> Sent: 06 October 2004 07:16
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  using XML elements as attributes in HTML
> 
> Hey, hopefully someone will be able to help me out here.
> 
> Say I have an XML file like this:
> <ans:color xmlns:ans="namespace_location">
>     green
> </ans:color>
> <ans:color xmlns:ans="namespace_location">
>     blue
> </ans:color>
> 
> And I want to produce HTML like this:
> <html>
>     <body>
>        <font color="green">
>           some text
>        </font>
>        <font color="blue">
>           some text
>        </font>
>     </body>
> </html>
> 
> I think I do something like this:
> <xsl:for-each select="/">
>     <font color="{{/namespace_location}color}">
>        some text
>     </font>
> </xsl:for-each>
> 
> But it doesn't work! :'(
> 
> I must be wrong on the syntax I think.
> 
> Any help would be much appreciated.
> 
> Thanks, Seby.
> 
> -- Sebastian Krueger 
> -- 205 Aro St, Aro Valley, Wellington, New Zealand
> -- Phone:+64 4 3844458 
> -- Mobile:+64 21 1781826

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.