If I have the following XML file:

<events startDate="2003-01-01" endDate="2004-12-31">
<event id="5" title="Test Event 5" description="every second tuesday"
startDate="2003-01-01" endDate="2003-12-31" allDay="1"
eventType="weekly">
  <pattern sun="0" sat="0" fri="0" thu="0" wed="0" tue="1" mon="0" recur="2" />
</event>
</events>

The pattern node is considered a child of event, is that correct? So
the structure would be:

<events> - Root Element
<event> - Child of <events>
  <pattern> - Child of <event>

I'm trying to display the info from the pattern element but not
receiving any data. I am trying to get at by doing:
<cffunction access="public" name="readXml" output="false" returntype="events">
<cffile action=""> file="C:\cfusionmx\wwwroot\calendar\SparkEventsCalendar_loadXml.xml"
variable="event">
        <cfset variables.calEvents = XmlParse(event) />
<cfset variables.eventChild =
ArrayLen(variables.calEvents.events.event.XmlChildren) />
  
  <cfreturn this />
</cffunction>

I would think that the length of the array in variables.eventChild
would be 1 but it's returning 0. What am I missing when trying to
access the pattern node?

Thanks,
Ben
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to