-----Original Message-----
From: Barney Boisvert [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 1:33 PM
To: [EMAIL PROTECTED]
Subject: RE: [cf-xml] Value list in an XML Element?Unless you change the XML doc, you can't use XSL to make the list. The reason is that XSL doesn't understand comma delimited lists, it only understands tags. From the XML document's perspective, there is only one thing in the <userNames> section of your doc, a string of chars. You need to tell it that there are several items (so you can use <xsl:for-each>). I'd recommend this:<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href=""?>
<messageBody>
<userNames><userName>John Doe</userName><userName>Jane Doe</userName><userName>Frank Smith</userName></userNames>
</messageBody>HTH,barneyb-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Suyer, Ed [PRD Non-J&J]
Sent: Tuesday, January 28, 2003 1:00 PM
To: '[EMAIL PROTECTED]'
Subject: [cf-xml] Value list in an XML Element?
Hi Folks,
Does anyone know if the following is possible, and if so, the proper syntax:
I have a coldFusion variable, userNames, which contains a comma delimited list of user names i.e. <cfset userNames = "John Doe, Jane Doe, Frank Smith">
I wrote some code that merges this variable with the following XML document:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href=""?>
<messageBody>
<userNames><![CDATA[~userNames]]></userNames>
</messageBody>And that transforms it with the following XSL Doc (listUsers.xls):
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
</head>
<body bgcolor="#ECECFF" text="#000000" link="#004080">
<div align="center">
<xsl:for-each select="messageBody">
User Names: <xsl:value-of select="userNames"/><br/>
</xsl:for-each>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The generated output looks as follows:
User Names: John Doe, Jane Doe, Frank Smith
My question is this: How do I get the output to look as follows:
User Names: + John Doe
+ Jane Doe
+ Frank Smith(a unordered list)
I've tried passing "<UL><LI>John Doe</LI><LI>Jane Doe</LI><LI>Frank Smith</LI></UL>" to userNames, but the parser/transformer escapes these values with < and >
If possible, I'd like to do this without changing the XML doc.
Any help is much appreciated!
Thanks,
Ed.
Title: Value list in an XML Element?
Thank
you much Barney! This helped a bunch.
- [cf-xml] Value list in an XML Element? Suyer, Ed [PRD Non-J&J]
- RE: [cf-xml] Value list in an XML Element... Barney Boisvert
- [cf-xml] general question Saul Rothbart
- Re: [cf-xml] general question Steve Nelson
- Re: [cf-xml] general question Saul Rothbart
- Re: [cf-xml] general question David Hannum
- RE: [cf-xml] general que... Pete Freitag
- Suyer, Ed [PRD Non-J&J]
