2 Replies Latest reply on Jul 9, 2009 12:03 AM by nvdya

    ask about problem when loading external XML

    nvdya

      hi guys,I have learned about flex otodiak, but i have problem when learning about external XML, i want to ccreate simple aplication using repeater in flex. but i always found an actionscript error like this:

      [RPC Fault faultString="Error #1096: XML parser failure: Unterminated element." faultCode="Client.CouldNotDecode" faultDetail="null"]
          at mx.rpc.http::HTTPService/http://www.adobe.com/2006/flex/mx/internal::processResult()[C:\autobuild\3.3.0\frameworks\ projects\rpc\src\mx\rpc\http\HTTPService.as:860]
          at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.3.0\frameworks\ projects\rpc\src\mx\rpc\AbstractInvoker.as:208]
          at mx.rpc::Responder/result()[C:\autobuild\3.3.0\frameworks\projects\rpc\src\mx\rpc\Responde r.as:43]
          at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.3.0\frameworks\projects\rpc\src\mx\rpc\ AsyncRequest.as:74]
          at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.3.0\frameworks\projects\rpc\s rc\mx\messaging\channels\DirectHTTPChannel.as:409]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at flash.net::URLLoader/onComplete()

       

      do you have a solution to this problems, this is the source, both of them in the same folder


      this is dosen.xml file

      <dosen>
          <rAjarNow title="Mata kuliah yang diajarkan semester ini">
              <data thn="2008/2009" semester="Genap" matkul="PROYEK MULTIMEDIA" jurusan="Teknik Informatika D3"/>
              <data thn="2008/2009" semester="Genap" matkul="KOMPUTER GRAFIS" jurusan="Sistem Informasi Reguler"/>
              <data thn="2008/2009" semester="Genap" matkul="KOMPUTER GRAFIS" jurusan="Teknik Informatika S1 Reguler"/>
              <data thn="2008/2009" semester="Genap" matkul="MULTIMEDIA LANJUT" jurusan="Teknik Informatika S1 Reguler"/>
          </rAjarNow>
          <rpend title="Riwayat Pendidikan">
              <data thn="1976-1982" tempat="SD Muhammadyah Sapen Yogyakarta"/>
              <data thn="1982-1985" tempat="SMP 8 Yogyakarta"/>
              <data thn="1985-1988" tempat="SMA 3 Yogyakarta"/>
              <data thn="1988-1997" tempat="Jurusan Teknik Arsitektur FT UGM"/>
              <data thn="2004-2008" tempat="Magister Ilmu Komputer MIPA UGM"/>       
      </dosen>

       

      this is MXML file:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application
          xmlns:mx="http://www.adobe.com/2006/mxml"
           creationComplete="{xmlCurr.send()}">
          <mx:Script>
              <![CDATA[
                  import mx.rpc.events.ResultEvent;
                  import mx.collections.ArrayCollection;
                  [Bindable]
                  private var loadXml:ArrayCollection;
                  private function xmlCurrResult(event:ResultEvent):void{
                      loadXml=event.result.dosen;
                  }
              ]]>
          </mx:Script>
          <mx:HTTPService
              id="xmlCurr"
              url="dosen.xml"
              result="xmlCurrResult(event)"/>
              <mx:Panel
              title="latihan repeater"
              paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
                    <mx:Repeater id="rep" dataProvider="{loadXml}">
                            <mx:TextArea id="teksArea" text="{rep.currentItem.rpend.data.@thn}"/>
                    </mx:Repeater>
              </mx:Panel>
      </mx:Application>

       

      thanks for the solutions