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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XML Entities not working

    Hi,

    I am trying to add variables into my xml, the final outcome would be to have the ENTITIES in an external file, but for now I just want the variables to take and they aren't. what I have is very simple, but when run the value "&test;" is used instead of "XXXX". ideas???
    Code:
    <?xml version="1.0" ?>
    <!DOCTYPE configuration [
    <!ENTITY  test "XXXX">
    ]>
    
    <configuration>
    	<WebServices>		
    		<Designation>&test;</Designation>		
    	</WebServices>
    </configuration>
    thanks,
    Last edited by Alex Vincent; 05-29-2013 at 08:14 PM. Reason: adding code tags

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    That looks right to me - what browsers are you testing in? What content-type are you serving this XML as?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #3
    New to the CF scene
    Join Date
    May 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    sorry, your reply went into my junk mail so I missed it. I will try to give more context to this issue. I have code in ActionScript that reads variables from xml files that are basically used as config files. I would like the xml file to be able to take ENTITIES because it would be easier to change when moving through our different environments ie Test -> Prod. this runs on all browsers so that is not the issue.
    I can get the ENTITY to display when I show the xml in my browser, the values are replaced perfectly, BUT when running the application the values aren't replaced, it uses the literal of the ENTITY name.

    To make it even stranger I can get this to work with 1 example but no others, I will show you both below.

    THIS ONE WORKS FINE.

    <?xml version="1.0" ?>
    <!DOCTYPE configuration [
    <!ENTITY test "http://SomeAmazingServerAddress">
    ]>


    <configuration>
    <querytaskurl>&test;</querytaskurl>
    <zoomtolayers>Roads,Cities,Centres</zoomtolayers>
    <zoomtofields>NAME,PLACE,TITLE</zoomtofields>
    </configuration>


    THIS ONE DOES NOT WORK.

    <?xml version="1.0" ?>
    <!DOCTYPE configuration [
    <!ENTITY test "http://SomeAmazingServerAddress">
    ]>

    <configuration>
    <LayerUrl>&test;</LayerUrl>
    <HULayers>Local Network (LHIN),Public Boundary (PHU)</HULayers>

    <LayerID>24,32</LayerID>
    <IDField>LHIN_IDENT,PHU_ID</IDField>
    <NameField>LHIN_NAME_ENG,PHU_NAME_ENG</NameField>

    <settings>
    <retainGraphics>true</retainGraphics>
    </settings>
    </configuration>

    thanks so much for any help

  • #4
    New to the CF scene
    Join Date
    May 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Sorry I missed your response, it went to junk. I hope to put some context into this issue. I have Actionscript code that accesses xml files as config files for web service information. Since this is going thru environments, test -> Prod, it would be great to have the variables changed in one spot, I was thinking of these ENTITIES.
    But, I haven't been able to get the ENTITIES to be recognized while running the application, it shows fine in my browser, which we use ie and FF.

    this is a simple small sample of what I am trying to do, maybe it isn't possible

    <?xml version="1.0" ?>
    <!DOCTYPE configuration [
    <!ENTITY test "http://SomeAmazingServerAddress">
    ]>

    thanks for any help
    <configuration>
    <querytaskurl>&test;</querytaskurl>
    <zoomtolayers>ROADS,TOWNS</zoomtolayers>
    <zoomtofields>NAME,TITLE</zoomtofields>
    </configuration>


  •  

    Posting Permissions

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