[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

how do I parse an XML file using Coldfusion 8

Asked by Viking46 in ColdFusion Studio, Cold Fusion Markup Language, Adobe Dreamweaver

Tags: Coldfusion, XML

I have an XML file which is located in the same directory as the cfm which is to parse it. The XML file is as shown below.

When I send a query string to the .cfm file, the variables are extracted from the query string as follows:

<!---
      get the values of language and element name from the qs
--->
<cfset language=url.lang>
<cfset textName=url.txtName>

I am then left with the language, which is either en or no ( for English or Norwegian) and the textName which will correspond to the XML tag that contains the text that is to be retrieved for the specified language. For example if the language =en and the textName=enable, I need to be able to parse the XML file and return the string "Would you like to enable speech on this site?".

As previously stated the cfm file and the languages.xml file (shown below) are both located in the same directory on the cold fusion server.

Can somebody please show me how to parse the XML file (languages.xml) using the language and textName variables to retrieve the correct content?

Thank you in advance

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
<?xml version="1.0" encoding="utf-8"?>
<languages>
	<language name="en">
		<enable>Would you like to enable speech on this site?</enable>
		<yes>Yes</yes>
		<no>No</no>
		<buttonYes>Click or press Y to activate speech</buttonYes>
		<buttonNo>Click or press N to deactivate speech</buttonNo>
		<dontShowAgain>Do not show this message again</dontShowAgain>
		<stopSound>To start or stop a sound press the CONTROL key (CTRL)</stopSound>
		<zoomIn>Increase magnification. This will make the text on this page larger.</zoomIn>
		<zoomOut>Decrease magnification. This will make the text on this page smaller.</zoomOut>
		<help>Help button. Click to have the instructions read out.</help>
		<streaming>Streaming</streaming>
		<audioFinished>Ready</audioFinished>>
		<gettingAudio>Requesting audiio</gettingAudio>>
		<noAltTextAvailable>No descriptive text available</noAltTextAvailable>
	</language>
	<language name="no">
		<enable>Vil du bruke tale på denne siden?</enable>
		<yes>Ja</yes>
		<no>Nei</no>
		<buttonYes>Klikk eller trykk J for å aktivere tale</buttonYes>
		<buttonNo>Klikk eller trykk N for å deaktivere tale</buttonNo>
		<dontShowAgain>Ikke vis denne meldingen igjen</dontShowAgain>
		<stopSound>For å starte eller stoppe tale trykk på CONTROL tasten (CTRL)</stopSound>
		<zoomIn>Øk tekststørrelse</zoomIn>
		<zoomOut>Forminsk tekststørrelse</zoomOut>
		<help>Hjelp knapp. Trykk for å høre instruksjoner.</help>
		<streaming>Spiller av</streaming>
		<audioFinished>Klar</audioFinished>>
		<gettingAudio>Henter audio</gettingAudio>>
		<noAltTextAvailable>Ingen tekst beskrivelse tilgjengelig</noAltTextAvailable>
	</language>
</languages>
[+][-]10/16/09 01:24 PM, ID: 25593025Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: ColdFusion Studio, Cold Fusion Markup Language, Adobe Dreamweaver
Tags: Coldfusion, XML
Sign Up Now!
Solution Provided By: _agx_
Participating Experts: 1
Solution Grade: A
 
[+][-]10/16/09 01:26 PM, ID: 25593044Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/16/09 02:56 PM, ID: 25593686Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/16/09 04:07 PM, ID: 25593986Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/16/09 04:11 PM, ID: 25594005Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/17/09 03:58 AM, ID: 25595581Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/17/09 04:50 AM, ID: 25595679Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/17/09 11:44 AM, ID: 25596905Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/17/09 01:20 PM, ID: 25597295Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/17/09 03:22 PM, ID: 25597824Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/17/09 03:42 PM, ID: 25597881Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/17/09 04:14 PM, ID: 25597981Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/17/09 04:15 PM, ID: 25597987Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/17/09 06:09 PM, ID: 25598294Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/17/09 09:13 PM, ID: 25598664Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/18/09 05:10 AM, ID: 25599569Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/18/09 11:06 AM, ID: 25600720Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625