Skip to main content
nikos101
Inspiring
November 10, 2010
Question

having parsing xml like below into a struct.

  • November 10, 2010
  • 2 replies
  • 853 views

I'm having parsing xml like below into a struct. I tried this function but that just gives me the 1st <Condition's attribute in a resultant struct

<taskConditions>
  <Condition name="TUESDAY" conditionEnabled="1" />
  <Condition name="THURSDAY" conditionEnabled="1" />
</taskConditions>

ASTR   

    Condition    [, ]   

        [1]   

        [2]   

    Condition_attributes   

        conditionEnabled    1   

        name    TUESDAY   


What happend tp the thursday attributes   ?

thanks

    This topic has been closed for replies.

    2 replies

    Inspiring
    November 10, 2010

    Just a quick question: why are you trying to convert your XML into a struct?

    --

    Adam

    Legend
    November 10, 2010

    Did you try doing a CFDUMP of the xmlParse result? Thursday is contained in the name attribute within the xmlAttributes element of each "condition" element. CFDUMP is your friend.

    nikos101
    nikos101Author
    Inspiring
    November 11, 2010

    Just a quick question: why are you trying to convert your XML into a struct?

    because I will be looping through each row and be performing some code

    Legend
    November 10, 2010

    Did you try xmlParse()? It is not a CF structure per se., but very similar (you can walk the arrays but you can't StructCopy or StructAppend).

    nikos101
    nikos101Author
    Inspiring
    November 10, 2010

    still gives me the same xml string, no arrays