• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hyphen in XML row name causing problems

Participant ,
Jan 10, 2014 Jan 10, 2014

Copy link to clipboard

Copied

I have an xml file that I am trying to turn into a qury object so I can have the query interact with my SQL database

The XML file has 15 rows and I have successfully got 13 of them into a query.

The problem is that the remaining 2 fields have hyphens  or dashes -  in the row names. Like (WORK_E-MAIL)..See the - between E-Mail

So when I go to set the value in the query with this code

   <cfset temp = QuerySetCell(orderquery,"WORK_E_MAIL",

   #mydoc.rowset.ROW.WORK_E-MAIL.XmlText#, #i#)>  

I get this error message

Error Occurred While Processing Request

Invalid construct: Either argument or name is missing.

Is there some way to alias the row name with the hypen, maybe like this {WORK_E-MAIL}  or like this [WORK_E-MAIL]

I need to ge these 2 hypenated named rows into my query.

Any ideas?

Views

595

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jan 11, 2014 Jan 11, 2014

Have you attempted to use an assosicative array syntax?

mydoc.rowset.row[ i ][ 'WORK_E-MAIL' ].XMLText

Votes

Translate

Translate
Advocate ,
Jan 10, 2014 Jan 10, 2014

Copy link to clipboard

Copied

Try:

<cfset temp = QuerySetCell(orderquery,"WORK_E_MAIL",

mydoc.rowset.ROW.WORK_E-MAIL.XmlText, i)>

or:

<cfset temp = QuerySetCell(orderquery,"WORK_E_MAIL",

"#mydoc.rowset.ROW.WORK_E-MAIL.XmlText#", i)>

If either of these work, I'm not sure how your code worked for the first 13 rows.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 11, 2014 Jan 11, 2014

Copy link to clipboard

Copied

LATEST

Have you attempted to use an assosicative array syntax?

mydoc.rowset.row[ i ][ 'WORK_E-MAIL' ].XMLText

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation