alholden
04/23/2025, 8:25 PMbdw429s
04/23/2025, 8:29 PMbdw429s
04/23/2025, 8:29 PMbdw429s
04/23/2025, 8:30 PMform.name
and inserting it into the DB, there's nothing that would encode that out of the box in CFalholden
04/23/2025, 8:31 PMbdw429s
04/23/2025, 8:32 PMbdw429s
04/23/2025, 8:32 PMalholden
04/23/2025, 8:33 PMalholden
04/23/2025, 8:33 PMbdw429s
04/23/2025, 8:33 PMalholden
04/23/2025, 8:34 PMalholden
04/23/2025, 8:34 PMbdw429s
04/23/2025, 8:34 PMalholden
04/23/2025, 8:35 PMbdw429s
04/23/2025, 8:35 PMalholden
04/23/2025, 8:35 PMbdw429s
04/23/2025, 8:35 PMalholden
04/23/2025, 8:36 PMalholden
04/23/2025, 8:37 PMbdw429s
04/23/2025, 8:39 PMalholden
04/23/2025, 8:39 PMbdw429s
04/23/2025, 8:39 PM<
and >
from that code?alholden
04/23/2025, 8:39 PMalholden
04/23/2025, 8:40 PMbdw429s
04/23/2025, 8:40 PMleft(trim(xmlVendor.VENDOR_SITE_CODE.xmlText),20)
directlyalholden
04/23/2025, 8:41 PMalholden
04/23/2025, 8:41 PMbdw429s
04/23/2025, 8:42 PMbdw429s
04/23/2025, 8:42 PMbdw429s
04/23/2025, 8:42 PMalholden
04/23/2025, 8:42 PMMatt Jones
04/23/2025, 8:43 PMalholden
04/23/2025, 8:43 PMbdw429s
04/23/2025, 8:43 PMbdw429s
04/23/2025, 8:43 PMbdw429s
04/23/2025, 8:43 PMbdw429s
04/23/2025, 8:44 PMhave it within a cfoutput with the attribute encode="html" ?That's an interesting theory. Did CF11 support that? You could try outputting and aborting prior to the cfquery to test the cfoutput theory, though I don't know to what degree CF "inherits" cfoutput encoding from "higher up"
Matt Jones
04/23/2025, 8:46 PMalholden
04/23/2025, 8:46 PMbdw429s
04/23/2025, 8:46 PMalholden
04/23/2025, 8:47 PMbdw429s
04/23/2025, 8:47 PMalholden
04/23/2025, 8:50 PMErin Brewer
04/23/2025, 8:52 PMalholden
04/24/2025, 12:46 AMReuben Brown
04/24/2025, 12:50 AMalholden
04/24/2025, 1:03 AMalholden
04/24/2025, 1:05 AMbdw429s
04/24/2025, 5:54 PM'
in the XML, but once parsed, it won't be there. The parsing will decode that back into a '
myXML_encoded = "<root>O'Reilly</root>";
The only way the actual XMLText
of a node would still have the '
is if the original source XML was double encoded like so:
myXML_double_encoded = "<root>O'Reilly</root>";
This example shows the raw contexts of the parsed xml text in each case
https://trycf.com/gist/b30908dff1d96d5295a44465c9b12b52/acf11?theme=monokaibdw429s
04/24/2025, 5:54 PMbdw429s
04/24/2025, 5:55 PMalholden
04/24/2025, 6:01 PM<cfqueryparam _cfsqltype_="cf_sql_nvarchar" _value_="#*left*(*trim*( *replace*(xmlVendor.VENDOR_SITE_CODE.xmlText,"'","'","all") ),20)#" />
(the target column is a nVarchar)
The queryparam seems to handle the apostrophe as part of the INSERT for me.bdw429s
04/24/2025, 6:02 PMbdw429s
04/24/2025, 6:02 PM'
back to a '
as it shouldbdw429s
04/24/2025, 6:02 PMalholden
04/24/2025, 6:04 PMbdw429s
04/24/2025, 6:05 PM%25
in a query string. CF/the servlet automatically decode those for you when they parse it.bdw429s
04/24/2025, 6:06 PM&...;
is an encoded XML/HTML entitybdw429s
04/24/2025, 6:06 PM'
OR you can litearlly encode any possible ASCII char as A
which would be an A
alholden
04/24/2025, 6:06 PMbdw429s
04/24/2025, 6:06 PMbdw429s
04/24/2025, 6:07 PM"foo\"bar"
you don't need to manually replace the \"
with "
as the JSON parsing decodes that for you.bdw429s
04/24/2025, 6:08 PMalholden
04/24/2025, 6:08 PM'
when I opened it in Notepad, and later when it got inserted.bdw429s
04/24/2025, 6:08 PMalholden
04/24/2025, 6:09 PMxmlVendor
in the snip above is the parsed object. It's a mystery.bdw429s
04/24/2025, 6:09 PMbdw429s
04/24/2025, 6:10 PMalholden
04/24/2025, 6:11 PMalholden
04/24/2025, 6:12 PM<cfset xmlDoc = *xmlparse*(vendorFileXML)>
<cfset arRows = xmlDoc.XMLRoot.XMLChildren> _<!--- each array element contains the XML for one UID --->_
<!--- loop over array of vendors rows (the array contents are xml)) --->
<cfloop _from_=1 _to_="#*arrayLen*(arRows)#" _index_="ii" >
<cfset xmlVendor = arRows[ii]>
and so on...alholden
04/24/2025, 6:13 PMbdw429s
04/24/2025, 6:14 PM11.0.19+314546
is the latest patch levelbdw429s
04/24/2025, 6:14 PMserver.coldfusion
to see where you're sittingbdw429s
04/24/2025, 6:19 PMbdw429s
04/24/2025, 6:21 PMlen()
of the string reported a length that would imply a '
?alholden
04/24/2025, 6:26 PM