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

Putting xml into a cfquery

Explorer ,
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

I am having problems when an xml tag is not always present.

The xml looks something like this.
<year value="90" EMPcount="2">
<employer name="bank">
<wages>2000.00</wages>
</employer>
<employer name="gas station">
<wages>1000.00</wages>
</employer>
</year>

<year value="91" EMPcount="2">
<employer name="bank">
<wages>2500.00</wages>
<self_emp>1000.00</self_emp>
</employer>
<employer name="gas station">
<wages>1500.00</wages>
</employer>
</year>

I want the query to look like this.

year employer wages self_emp
90 bank 2000.00 0
90 gas station 1000.00 0
91 bank 2500.00 1000.00
91 gas station 1500.00 0

I can create the query. I can populate it with rows with the tags that are always present. I just can't seem to figure out the logic to put that tag that is only there sometimes.

Can anyone help?
Thanks in advance,

Anthony
TOPICS
Advanced techniques

Views

265

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
New Here ,
May 11, 2007 May 11, 2007

Copy link to clipboard

Copied

LATEST
i guess create a column and make the value null when it doesn exist?

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