Contact Doug!
Learn About Doug!
View Doug Boude's online resume
updated 11/18/2009

View Doug Boude's profile on LinkedIn
Link to me!

Follow Doug Boude on Twitter
Follow me!

Be Doug's friend on Facebook
Befriend me!
(I promise not to follow you home)
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...
Florida web site design



Czech your Page Rank!
Check Page Rank of any web site pages instantly:
This free page rank checking tool is powered by Page Rank Checker service
Surf's Up!
Visit Egosurf.org and massage YOUR web ego!
My Score: 9,001
Doug's Books

Read (and recommend)

  • Men are from Mars, Women are from Venus
  • The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies and Nations
  • Blink: The Power of Thinking Without Thinking
  • Head First Design Patterns
  • Transact-SQL Programming
  • What's So Amazing About Grace?
  • Just So Stories (Rudyard Kipling collection)

Reading

  • Prayer: Does it Make Any Difference?
  • Data Mining (Practical Machine Learning Tools and Techniques)
<< June, 2006 >>
SMTWTFS
123
45678910
11121314151617
18192021222324
252627282930
Search Blog

Recent Comments
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

Powered by
BlogCFM v1.11

24 July 2008
Using Special Characters within Coldspring.XML

Just because a person uses Model Glue and has learned enough about XML to know how to create basic settings doesn't necessarily mean that they have a strong command of XML, right? Well, I needed to put a funky, "special character filled" value into my global config object for use later, and through some experimentation found that using XML's 'CDATA' allowed me to do this so I thought I'd share it since I hadn't seen it used in Coldspring.xml before. Allow the picture to speak volumes:

  <bean id="GlobalConfig" class="ModelGlue.Bean.CommonBeans.SimpleConfig">
    <property name="Config">
      <map>
        <entry key="DNS"><value>myDNS</value></entry>
  <entry key="FusionMapDir"><value>/FusionMaps</value></entry>
  <entry key="FusionJS"><value>/js/FusionMaps.js</value></entry>
  <entry key="FusionChartDir"><value>/FusionCharts</value></entry>
  <entry key="FusionChartJS"><value>/js/FusionCharts.js</value></entry>
  <entry key="PDFRoot"><value>/images/PDFMaps</value></entry>
  <entry key="adminEvents"><value>page.admin,page.datamgmt,page.entityadmin,page.dataadmin</value></entry>
       <entry key="chartSubCaption"><value><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Asia Matters for America\nwww.asiamattersforamerica.org\n]]></value></entry>
   </map>     
    </property>
  </bean>

I am using a third party Flash-based charting tool and needed to apply a global sub caption to all charts produced, so decided to store it in my Coldspring.xml as part of my global config bean.

Now, I will say that I first attempted to pass in that subcaption value within my modelglue.xml file as an argument, like so:

 

 <event-handler name="getChart">
   <broadcasts>
    <message name="getChartData">
     <argument name="qryName" value="qryChartData" />
     <argument name="entityTypeID" value="3" />
    </message>
    <message name="getChartXML">
     <argument name="subcaption" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Asia Matters for America\nwww.asiamattersforamerica.org\n" />
    </message>
   </broadcasts>
   <results />
   <views>
    <include name="returnChart" template="dspBigChart.cfm" />
   </views>
  </event-handler>

Of course, that turned my xml invalid. So I tried doing it like this:

 

  <event-handler name="getChart">
   <broadcasts>
    <message name="getChartData">
     <argument name="qryName" value="qryChartData" />
     <argument name="entityTypeID" value="3" />
    </message>
    <message name="getChartXML">
     <argument name="subcaption" value="<![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Asia Matters for America\nwww.asiamattersforamerica.org\n]]>" />
    </message>
   </broadcasts>
   <results />
   <views>
    <include name="returnChart" template="dspBigChart.cfm" />
   </views>
  </event-handler>

Still invalid, so i just gave up and went with the coldspring.xml approach for time's sake. Does anybody know the correct way (if there is one) to utilize CDATA within an XML attribute value like I tried to do? I probably won't stray from the way I'm doing it now in my global config, but I am curious.




Posted by dougboude at 12:09 AM | PRINT THIS POST! |Link | 0 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

No comments found.

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

18 plus 18 equals
Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!