That would work, but xmlparse and xmlSearch are costly in performance. The tag cfsavecontent gives you a string, whereas you need an XML document object in the suggestions we gave you. & BKBK CF server is throwing an error like "You have attempted toÄereference a scalar variable of type class as a I try to use the above mentioned solutions that are suggested by Ian However the URL provided by Ian Skinner was useful & I was able to read the value properly.Ä«elow you can find the code for reference. I've set force-struct-lowercase to true so that the struct keys I use in my Flex/CF apps are all lower case, but Flash may not have the same (or any) server options.When I try to use the above mentioned solutions that are suggested by Ian & BKBK CF server is throwing an error like "You have attempted to dereference a scalar variable of type class as a structure with members" I was thinking of the setup in remoting-config.xml for Flex (in the ColdFusion destination, there is a property-case element that contains child elements to force CFC properties, query columns, and struct keys to lower case if you like (force-XXX-lowercase). Okay, never mind, what I found is not quite what you were looking for. There may also be a way to address this from the server side, if you have access to the configuration files, but right now the particular solution escapes me. I have been doing a bit of Flex work recently, and this question rings a faint bell with me. so when you need to retrieve them for something that is case-sensitive, you get back CF's interpretation of what you gave it. I believe this is happening because by default, XML attributes are case-insensitive (like pretty much everything else in CF), and it just happens that CF stores them in uppercase. Titillating read by - Ask Ben: Maintaining Case Of XML Attributes In Manually Created ColdFusion XML Documents Notice that the case of the XML attributes isbn and title is the same in the output as it was in your CFSet statements. And, we run the above code, we do get a case-maintained output: By doing so, we are letting ColdFusion know exactly how we want to index the given value. Tove Jani Reminder.XmlAttributes.title), we are setting explicit variable lables (ex. I have to read the encoding and version from xml document. Notice that this time, instead of setting a case-insensitive variable (ex. Think about it like this, if you are in a regular ColdFusion page and set a variable: It's hard to explain exactly why this happens as I don't know how ColdFusion works under the hood but, I rationalize it as such: when you use dot-notation, you are really just setting a variable in the context of the parent struct. This is the issue you are experiencing when you pass the XML document off to your Flash movie. Notice that the ISBN and TITLE XML attributes have all been converted to uppercase. But, when we run the code above, we get the following output: XmlAttributes.title) we are using all lowercase labels. Notice here that when we set the attributes (ex. From your question, what I gather is that you are setting your XML attributes using CFSet tags and the XmlAttributes node collection as in this example: Now, because your attributes are not being maintained, I know that you are not building your XML documents in this manner. As such, when we run the code above, we get the following case-maintained output: Here, the entire ColdFusion XML document is explicit ColdFusion doesn't have to make any guesses about case since it's all been spelled out. First, I will build a ColdFusion XML document entirely with an explicit string using ColdFusion's CFXML tag: I'm sure that wasn't explained well, so I'll demonstrate the issue when it comes to XML. To get around this with structs, use explicit strings. Remember, ColdFusion is not case sensitive, so when you give it a variable name, the case has no meaning. By that, I mean that you have to use more of an array-type notation rather than a struct-type notation if you want the case of your attribute variables to carry through. The trick is to use explicit strings when settings struct values rather than attribute variables. Yes, there is some voodoo magic in ColdFusion to help you maintain the given case of XML attributes. But out of curiosity is there any voodoo magic lurking in the guts of CF to make XMLAttributes comply with my lust for lowercase markup? Why is it that the CF XMLAttributes default to uppercase? Obviously it takes me about 5 seconds to do a RegEx replace when doing a ToString before saving it to file. CF's default behavior breaks the component. Now for whatever reason this black-box Flash is highly case sensitive when it comes to XML. I am querying a database and using the data to build an XML file used with some Flash component. Just a really standard dumb "why?" question.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |