Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2009
    Location
    Worcester
    Posts
    172
    Thanks
    13
    Thanked 6 Times in 6 Posts

    number/pound sign in XML through dynamic ColdFusion?

    Hi all,

    I am trying to deeplink to a state in my Flex application using a dynamic output from CF.

    Here's what i'm trying to do, i have a ColdFusion script that takes my database items and turns them into XML

    Code:
    <cfquery name="qGetList" datasource="#dsn#">
        select *
        from myTable
        where xmlOutput = 'true'
        </cfquery>
    
        <cfset tempxml = "<?xml version =""1.0""?>
    	<STOCK>
        ">
        
        <cfloop query="qGetList">
        	<cfset tempxml = "#tempxml#
    		<ITEM>
        	<COLUMN1>#Trim("#XMLFormat(myColumnName1)#")#</COLUMN1>
        	<COLUMN2>#Trim("#XMLFormat(myColumnName2)#")#</COLUMN2>
        	<COLUMN3>#Trim("#XMLFormat(commercial)#")#</COLUMN3>
        	<DEEPLINK>http://localhost:8500/mySite-debug/index.html#view=13;column1=#Trim("#XMLFormat(myColumnName1)#")#;column2=#Trim("#XMLFormat(myColumnName2)#")#;column3=#Trim("#XMLFormat(myColumnName3)#")#</DEEPLINK>
    		</ITEM>
    		">
        </cfloop>
        <cfset tempxml = "#tempxml# 
    	</STOCK>">
    
        <cfoutput>
        <xmp>
        #tempxml#
        </xmp>
        </cfoutput>
    
        <cfset writePath=#ExpandPath("myXMLlist.xml")#>
        <cfoutput>
        #writePath#<br />
        <cffile action = "Write" file="#writePath#" output="#tempxml#">
        </cfoutput>
    The problem comes at the end of: localhost:8500/mySite-debug/index.html#view=13 where the pound/number symbol at the end of the 'index.html' (highlighted in red), so CF is going to think it's the start of a dynamic output from the db, i've tried using & # 3 5 ; (without the spaces ) too, but again this contains a # sign, so i've tried looking for an answer for an XML symbol code for # but i'm not having much joy

    Does anyone know if i can use the # sign in dynamic XML output coz i kinda need it for my Flex browser fragment

    Really at a loss here...

    Many thanks in advance all!


    (edited for spelling lol)
    Last edited by loki421; 06-29-2009 at 10:08 PM.

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Not that I know of. Isn't there an escape character in CF? Usually it is a backslash.

  • Users who have thanked Apostropartheid for this post:

    loki421 (06-30-2009)

  • #3
    Regular Coder
    Join Date
    Feb 2009
    Location
    Worcester
    Posts
    172
    Thanks
    13
    Thanked 6 Times in 6 Posts
    Yes there is, found it about ten mins ago! lol

    I've used:

    Code:
    <cfset poundSign = "##" >
    Then in the link where i wanted then pound/number sign to display i used:

    Code:
    http://www.........index.html#poundSign#views=13.....etc
    Worked a treat

    Thanks anyway, was going to post the answer tonight too! lol

    Anyway, hope this helps someone, cheers


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •