I got it... thanks Adam for both of your posts. They got my
wheels turning. Each item in my XML object (element name "item")
contains several children; I'm interested in returning all of the
children for that item.
After doing my conversion, I get an XML object called
myXmlObj. I immediately take that XML object and do:
<cfset myXmlObj =
Replace(ToString(myXmlObj),"<item>",Chr(10) &
"<item>", "all") />
which gives me a delimited list that matches the line numbers
not only in the original CSV but also in the XmlValidate error
results.
When I get a validation error (XmlValidate results stored in
"myResults"), I loop through the returned errors and parse the
error message as a list (using : as a delimeter) to get the line
number using ListGetAt().
<cfset errorLine = ListGetAt(myResults.errors
,2,":") />
I now have a reference to the XML item number and return it
and it's children from myXmlObj using:
<cfset xmlSnip =
XmlParse(ListGetAt(myXmlObj,errorLine,Chr(10))) />
Now I can loop through the xmlSnip XML object, put the
results in a table, and show the user exactly where the error
occurred in the context of the entire record.
I will document this better and post to a blog entry. When I
do, I'll post a link here with a better example of how it works.
Thanks again for the assist!!