Hello all-
I have a few questions about WDDX I am hoping someone could answer, or point
me in the right direction please. My questions center around constructing
xsl stylesheets around an xml packet created using wddx. My wddx packet is
a representation of a form submission. I'm now wanting to use different xsl
stylesheets to manipulate the wddx packet in various ways. The difficulty
I'm experiencing is, from my understanding, XSL works better with attributes
versus elements and wddx creates packets of information relying heavily on
elements. Is there a way to make wddx place certain form fields as an
attribute versus making it an element? For instance, I have a form element
the user enters a link. It gets stored as an element in my wddx packet,
whereas I really need it to be an attribute so I can apply XSL and pull the
link out and use it in a href. Is wddx really an abstraction of true xml?
Meaning, is wddx a genericized version of XML? Are we as developers not
able to manipulate a wddx packet as freely as if we were a regular xml
packet? I hope this makes sens to you. Here's an example of my wddx packet
and associated xsl style sheet:
wddx packet:
(I'm needing to figure out how to make an href out of the txtLink element)
<wddxPacket version='1.0'><header></header><data><struct><var
name='DTEND'><string></string></var><var
name='DTSTART'><string>03/15/2001</string></var><var
name='NUMSUBMITTEDBYID'><string>1</string></var><var
name='TXTABSTRACT'><string>An up to date copy of the internet usage policy.
Including what is considered abuse, and possible corrective actions that may
be taken</string></var><var name='TXTCONTENTHEADER'><string>Internet Usage
Policy</string></var><var
name='TXTLINK'><string>http://intranet/hr/Internet_Usage_Policy.htm</string>
</var></struct></data></wddxPacket>
xsl stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<table width="100%" border="0" cellspacing="0"
cellpadding="2" align="left">
<tr>
<td class="td">
<span
class="txtTitleRed"><xsl:apply-templates
select="wddxPacket/data/struct/var[@name='TXTCONTENTHEADER']"/></span>
</td>
</tr>
<tr>
<td class="td">
<span
class="txtBlack"><xsl:apply-templates
select="wddxPacket/data/struct/var[@name='TXTABSTRACT']"/></span>
</td>
</tr>
<tr>
<td class="td">
<xsl:apply-templates
select="wddxPacket/data/struct/var[@name='TXTLINK']"/>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="var[@name='TXTCONTENTHEADER']">
<xsl:value-of/>
</xsl:template>
<xsl:template match="var[@name='TXTABSTRACT']">
<xsl:value-of/>
</xsl:template>
<xsl:template match="var[@name='TXTLINK']">
<xsl:value-of/>
</xsl:template>
</xsl:stylesheet>
In order to view this in a browser, you will need the attached custom tag
(soxml) and use the following snippet with modifications to the input and
xslinput attributes:
<cf_SOXML
action="Transform"
input="[path to where the above wddx packet is tored (save it as
an xml file)]"
type="file"
xslinput="[path to where the above xsl stylesheet is stored]"
xsltype="File"
output="sTransformedResult"
r_type="Text">
<cfoutput>#sTransformedResult#</cfoutput>
I appreciate your help.
Thanks -
Tom Schreck
[EMAIL PROTECTED]
817-252-4900
I have not failed. I've just found 10,000 ways that won't work.
- Thomas Edison
<<soxml.cfm>>
soxml.cfm