I'm using CFMX's new
<CFXML> tag to generate an xml document that will be stored in a text
field in a SQL database. The <CFXML> tag is generating weird output
that's not XML at all. Here's the result of the <CFXML>
tag:
This is the string
that written to the database.
Here's the
<CFXML> snippet:
<cfxml
variable="variables.testXML">
<RootElement>
<PersonnelProfile>
<numStructureID/>
<numPersonnelID/>
<FirstName/>
<LastName/>
<email/>
<phone/>
<department/>
</PersonnelProfile>
<RootElement>
<PersonnelProfile>
<numStructureID/>
<numPersonnelID/>
<FirstName/>
<LastName/>
<email/>
<phone/>
<department/>
</PersonnelProfile>
...
</RootElement>
</cfxml>
</RootElement>
</cfxml>
Here's my SQL
INsert:
<cfquery name="qryInsert"
datasource="#Request.DSN#">
SET NOCOUNT ON
INSERT INTO TABLE_NAME(
txtName
,txtDescription
,numAuthorID
,txtXML
)
VALUES(
'#trim(Arguments.txtName)#'
,'#trim(Arguments.txtDescription)#'
,#client.numPersonnelID#
,'#variables.testXML#'
)
SELECT @@IDENTITY [NewId]
</cfquery>
SET NOCOUNT ON
INSERT INTO TABLE_NAME(
txtName
,txtDescription
,numAuthorID
,txtXML
)
VALUES(
'#trim(Arguments.txtName)#'
,'#trim(Arguments.txtDescription)#'
,#client.numPersonnelID#
,'#variables.testXML#'
)
SELECT @@IDENTITY [NewId]
</cfquery>
I'm using CFC
function to create the testXML document and a second CFC funstion to insert the
xml document into my table structure. What am I
missing?
Thanks -
Tom
