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

CFX_XMLParser for multiple XML

Guest
May 05, 2006 May 05, 2006

Copy link to clipboard

Copied

Hello all, I am trying to parse a large XML doc and running into an issue. I running the following code to try and get multiple dates of horoscopes and I need to somehow loop through the XML but I only pull up the first item.

<cfset xml="#inputFile#">


<CFX_XMLParser xml="#xml#" output="wddx">
<cfwddx action="WDDX2CFML" input="#wddx#" output="root">
#root.horoscope.date.ref#<br><br>

#root.horoscope.date.ARIES.INNER_TEXT#<br>
#root.horoscope.date.TAURUS.INNER_TEXT#<br>
#root.horoscope.date.GEMINI.INNER_TEXT#<br>
#root.horoscope.date.CANCER.INNER_TEXT#<br>
#root.horoscope.date.LEO.INNER_TEXT#<br>
#root.horoscope.date.VIRGO.INNER_TEXT#<br>
#root.horoscope.date.LIBRA.INNER_TEXT#<br>
#root.horoscope.date.SCORPIO.INNER_TEXT#<br>
#root.horoscope.date.SAGITTARIUS.INNER_TEXT#<br>
#root.horoscope.date.CAPRICORN.INNER_TEXT#<br>
#root.horoscope.date.AQUARIUS.INNER_TEXT#<br>
#root.horoscope.date.PISCES.INNER_TEXT#<br>
</cfoutput>


Here is what the XML doc looks like....


<?xml version="1.0" ?>
- <horoscope>
- <date ref="20040915">
<ARIES>You don't have to hike the Himalayas, but try to get some fresh air and exercise today. It will improve your outlook considerably.</ARIES>
<TAURUS>You may not be seeing enough sides of an issue eating at you. Take a step back, take a walk, come back to it. It will become clearer.</TAURUS>
<GEMINI>A good belly laugh is the best medicine today. Take a break from your analysis of things and grab a beer or the comics, whatever works.</GEMINI>
<CANCER>Sensuality is your task. Soak up smells, tastes, textures today. And, no need to do this with a partner; you can be on your own this time.</CANCER>
<LEO>When is the last time you cleaned those sock drawers or the frig? Not glamorous chores, but your mood will lift with some added discipline.</LEO>
<VIRGO>Your tenacity is a great attribute. Congratulate yourself today for coming through the storm and landing in an even better situation.</VIRGO>
<LIBRA>For today, stop the perfectionism and allow for surprises. Your tendency to know it all may spoil the fun you could be having.</LIBRA>
<SCORPIO>Time to teach yourself something new. The old brain needs some new data - take a bit for reading or research of a topic that sparks curiosity.</SCORPIO>
<SAGITTARIUS>Today is an important day. It's a good thing you're feeling sharp and have that eye of the tiger. You'll blow them away with your charm!</SAGITTARIUS>
<CAPRICORN>Someone is trying to find you. You think you have been forgotten, but they remember you fondly still. Stay open to unexpected reunions.</CAPRICORN>
<AQUARIUS>Be careful about that temper, and take a step back when angry. You will need those who will be alienated, and they actually need you, too.</AQUARIUS>
<PISCES>Today, give the affection you most want to receive. It will come back to you tenfold, and you, more than just about anyone, is craving some TLC.</PISCES>
</date>
- <date ref="20040916">
<ARIES>You don't have to hike the Himalayas, but try to get some fresh air and exercise today. It will improve your outlook considerably.</ARIES>
<TAURUS>You may not be seeing enough sides of an issue eating at you. Take a step back, take a walk, come back to it. It will become clearer.</TAURUS>
<GEMINI>A good belly laugh is the best medicine today. Take a break from your analysis of things and grab a beer or the comics, whatever works.</GEMINI>
<CANCER>Sensuality is your task. Soak up smells, tastes, textures today. And, no need to do this with a partner; you can be on your own this time.</CANCER>
<LEO>When is the last time you cleaned those sock drawers or the frig? Not glamorous chores, but your mood will lift with some added discipline.</LEO>
<VIRGO>Your tenacity is a great attribute. Congratulate yourself today for coming through the storm and landing in an even better situation.</VIRGO>
<LIBRA>For today, stop the perfectionism and allow for surprises. Your tendency to know it all may spoil the fun you could be having.</LIBRA>
<SCORPIO>Time to teach yourself something new. The old brain needs some new data - take a bit for reading or research of a topic that sparks curiosity.</SCORPIO>
<SAGITTARIUS>Today is an important day. It's a good thing you're feeling sharp and have that eye of the tiger. You'll blow them away with your charm!</SAGITTARIUS>
<CAPRICORN>Someone is trying to find you. You think you have been forgotten, but they remember you fondly still. Stay open to unexpected reunions.</CAPRICORN>
<AQUARIUS>Be careful about that temper, and take a step back when angry. You will need those who will be alienated, and they actually need you, too.</AQUARIUS>
<PISCES>Today, give the affection you most want to receive. It will come back to you tenfold, and you, more than just about anyone, is craving some TLC.</PISCES>
</date>
- <date ref="20040917">
<ARIES>You don't have to hike the Himalayas, but try to get some fresh air and exercise today. It will improve your outlook considerably.</ARIES>
<TAURUS>You may not be seeing enough sides of an issue eating at you. Take a step back, take a walk, come back to it. It will become clearer.</TAURUS>
<GEMINI>A good belly laugh is the best medicine today. Take a break from your analysis of things and grab a beer or the comics, whatever works.</GEMINI>
<CANCER>Sensuality is your task. Soak up smells, tastes, textures today. And, no need to do this with a partner; you can be on your own this time.</CANCER>
<LEO>When is the last time you cleaned those sock drawers or the frig? Not glamorous chores, but your mood will lift with some added discipline.</LEO>
<VIRGO>Your tenacity is a great attribute. Congratulate yourself today for coming through the storm and landing in an even better situation.</VIRGO>
<LIBRA>For today, stop the perfectionism and allow for surprises. Your tendency to know it all may spoil the fun you could be having.</LIBRA>
<SCORPIO>Time to teach yourself something new. The old brain needs some new data - take a bit for reading or research of a topic that sparks curiosity.</SCORPIO>
<SAGITTARIUS>Today is an important day. It's a good thing you're feeling sharp and have that eye of the tiger. You'll blow them away with your charm!</SAGITTARIUS>
<CAPRICORN>Someone is trying to find you. You think you have been forgotten, but they remember you fondly still. Stay open to unexpected reunions.</CAPRICORN>
<AQUARIUS>Be careful about that temper, and take a step back when angry. You will need those who will be alienated, and they actually need you, too.</AQUARIUS>
<PISCES>Today, give the affection you most want to receive. It will come back to you tenfold, and you, more than just about anyone, is craving some TLC.</PISCES>
</date>
- <date ref="20040918">
<ARIES>You don't have to hike the Himalayas, but try to get some fresh air and exercise today. It will improve your outlook considerably.</ARIES>
<TAURUS>You may not be seeing enough sides of an issue eating at you. Take a step back, take a walk, come back to it. It will become clearer.</TAURUS>
<GEMINI>A good belly laugh is the best medicine today. Take a break from your analysis of things and grab a beer or the comics, whatever works.</GEMINI>
<CANCER>Sensuality is your task. Soak up smells, tastes, textures today. And, no need to do this with a partner; you can be on your own this time.</CANCER>
<LEO>When is the last time you cleaned those sock drawers or the frig? Not glamorous chores, but your mood will lift with some added discipline.</LEO>
<VIRGO>Your tenacity is a great attribute. Congratulate yourself today for coming through the storm and landing in an even better situation.</VIRGO>
<LIBRA>For today, stop the perfectionism and allow for surprises. Your tendency to know it all may spoil the fun you could be having.</LIBRA>
<SCORPIO>Time to teach yourself something new. The old brain needs some new data - take a bit for reading or research of a topic that sparks curiosity.</SCORPIO>
<SAGITTARIUS>Today is an important day. It's a good thing you're feeling sharp and have that eye of the tiger. You'll blow them away with your charm!</SAGITTARIUS>
<CAPRICORN>Someone is trying to find you. You think you have been forgotten, but they remember you fondly still. Stay open to unexpected reunions.</CAPRICORN>
<AQUARIUS>Be careful about that temper, and take a step back when angry. You will need those who will be alienated, and they actually need you, too.</AQUARIUS>
<PISCES>Today, give the affection you most want to receive. It will come back to you tenfold, and you, more than just about anyone, is craving some TLC.</PISCES>
</date>

</horoscope>




How can I output the dates after the 15th??? Thanks!!!!
TOPICS
Advanced techniques

Views

998

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
Community Expert ,
May 07, 2006 May 07, 2006

Copy link to clipboard

Copied

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
New Here ,
Nov 12, 2006 Nov 12, 2006

Copy link to clipboard

Copied

hi DettCom
where did u get CFX? it's free or paid?

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
Guest
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

You mean, where did I get the tag? I don't remember. I do not beleive I paid anything for it. If you give me your email address, I'll send it to you.

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
New Here ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

yes pls.. my email is liewsin@gmail.com

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
New Here ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

hi
i need to parse a big xml document and then insert into a DB, it's 60MB.. when i xmlParse it, it get crashes my machine. seem like this function cannot reply? any suggestion?

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
Guest
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

Have you tried placing a requesttime out??

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
New Here ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

tried. what makes another doubt is the xml file itself contains an error or invalid content ;(

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
Engaged ,
Nov 14, 2006 Nov 14, 2006

Copy link to clipboard

Copied

I doubt you will get CF to parse a 60 meg XML file. I suggest you just put it on your DB server and let it accesss it directly!

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
New Here ,
Nov 14, 2006 Nov 14, 2006

Copy link to clipboard

Copied

hi Simon
do u mean use xml as DB? but from what i know, sql query can do sorting while xpath can't. rite?

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
Engaged ,
Nov 14, 2006 Nov 14, 2006

Copy link to clipboard

Copied

No I meant use your databse to read and insert the xml directly. It is going to out perform cf everyday!

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
New Here ,
Nov 14, 2006 Nov 14, 2006

Copy link to clipboard

Copied

LATEST
erm.. i'm using MS Access ... from what i know, it only reads/imports text, html and excel..

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