Help in XML data..(solved)

Hi everyone,
Could someone please help me to solve this..
I have some XML data in the database in a clob column..like this..
XMLDATA 1
==========
<findPatientByNameResponse xmlns="http://service.sdt.tact.company.org">
  <out xmlns="http://service.sdt.tact.company.org">
    <ns1:patient xmlns:ns1="http://model.sdt.tact.company.org">
      <age xmlns="http://model.sdt.tact.company.org">66</age>
      <birthDate xmlns="http://model.sdt.tact.company.org">1949-11-23T00:00:00-07:00</birthDate>
      <empi xmlns="http://model.sdt.tact.company.org">544665</empi>
      <firstName xmlns="http://model.sdt.tact.company.org">A</firstName>
      <isValidPatient xmlns="http://model.sdt.tact.company.org">true</isValidPatient>
      <languageCode xmlns="http://model.sdt.tact.company.org">ENGLISH</languageCode>
      <lastName xmlns="http://model.sdt.tact.company.org">SMITH</lastName>
      <maritalStatusCode xmlns="http://model.sdt.tact.company.org">M</maritalStatusCode>
      <middleName xmlns="http://model.sdt.tact.company.org">MADELINE</middleName>
      <newEmpi xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <newPatient xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <sexCode xmlns="http://model.sdt.tact.company.org">F</sexCode>
    </ns1:patient>
    <ns1:patient xmlns:ns1="http://model.sdt.tact.company.org">
      <age xmlns="http://model.sdt.tact.company.org">47</age>
      <birthDate xmlns="http://model.sdt.tact.company.org">1969-04-15T00:00:00-07:00</birthDate>
      <empi xmlns="http://model.sdt.tact.company.org">540171</empi>
      <firstName xmlns="http://model.sdt.tact.company.org">A</firstName>
      <isValidPatient xmlns="http://model.sdt.tact.company.org">true</isValidPatient>
      <languageCode xmlns="http://model.sdt.tact.company.org">ENGLISH</languageCode>
      <lastName xmlns="http://model.sdt.tact.company.org">SMITH</lastName>
      <maritalStatusCode xmlns="http://model.sdt.tact.company.org">D</maritalStatusCode>
      <middleName xmlns="http://model.sdt.tact.company.org">KELLY</middleName>
      <newEmpi xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <newPatient xmlns="http://model.sdt.tact.company.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <sexCode xmlns="http://model.sdt.tact.company.org">F</sexCode>
    </ns1:patient>
  </out>
</findPatientByNameResponse>I have to parse the above XML...The above XML has 2 records..
i used the following query to parse the above XML
QUERY 1
=======
select extractValue(value(t),'/birthDate/text()') "birthDate"
     , extractValue(value(t),'/empi') "empi"
     , extractValue(value(t),'/firstName') "firstName"
     , extractValue(value(t),'/lastName') "lastName"
     , extractValue(value(t),'/middleName') "middleName"
     , extractValue(value(t),'/sexCode') "sexCode"
from nw_test c,
      table(xmlsequence(extract(xmltype.createxml(c.clob_data),'//findPatientByNameResponse/out/patient'))) t
where c.id = 1;     with the above query ...it is not returing any records....
and just for a TEST i changed the above XML to some thing more clear
XML DATA 2 (Just for test)
==========
<findPatientByNameResponse>
  <out>
    <patient>
      <age>63</age>
      <birthDate>1949-11-23T00:00:00-07:00</birthDate>
      <empi>5446</empi>
      <firstName>A</firstName>
      <isValidPatient>true</isValidPatient>
      <languageCode>ENGLISH</languageCode>
      <lastName>SMITH</lastName>
      <maritalStatusCode>M</maritalStatusCode>
      <middleName>MADELINE</middleName>
      <newEmpi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <newPatient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <sexCode>F</sexCode>
    </patient>
    <patient>
      <age>47</age>
      <birthDate>1967-04-15T00:00:00-07:00</birthDate>
      <empi>540171</empi>
      <firstName>A</firstName>
      <isValidPatient>true</isValidPatient>
      <languageCode>ENGLISH</languageCode>
      <lastName>SMITH</lastName>
      <maritalStatusCode>D</maritalStatusCode>
      <middleName>KELLY</middleName>
      <newEmpi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <newPatient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <sexCode>F</sexCode>
    </patient>
  </out>
</findPatientByNameResponse>
QUERY 2
=======
select extractvalue(value(d),'/patient/age') as age,
    extractvalue(value(d),'/patient/birthDate') as birthddate,
    extractvalue(value(d),'/patient/empi') as empi,
    extractvalue(value(d),'/patient/firstName') as firstName,
    extractvalue(value(d),'/patient/languageCode') as languageCode,
    extractvalue(value(d),'/patient/isValidPatient') as isValidPatient,
    extractvalue(value(d),'/patient/lastName') as lastName,
    extractvalue(value(d),'/patient/middleName') as middleName
    from nw_test x,table(xmlsequence(extract(xmltype.createxml(x.clob_data), '/findPatientByNameResponse/out/patient'))) d where id = 2;with query 2 i am able to get the following output
Age Birthdate empi firstname languagecode isvalidpatient lastname
Got 2 records...
Query 2 is working fine..If the change the original XML data..
But actually i have to parse XML DATA 1
Could someone please help me with QRERY 1 to parse XMLDATA1.
Thanks in advance
phani

THose namespaces are really a pain. You should consider to have all "xmlns=" removed that are not really needed.
SQL> r
  1  with x as (select xmltype('<findPatientByNameResponse xmlns="http://service.adt.tactical.intermountain.org"> '
  2                 ||' <out xmlns="http://service.adt.tactical.intermountain.org">'
  3          ||'    <ns1:patient xmlns:ns1="http://model.adt.tactical.intermountain.org">'
  4          ||'      <age xmlns="http://model.adt.tactical.intermountain.org">66</age>'
  5          ||'      <birthDate xmlns="http://model.adt.tactical.intermountain.org">1949-11-23T00:00:00-07:00</birthDate>'
  6          ||'      <empi xmlns="http://model.adt.tactical.intermountain.org">544665</empi>'
  7          ||'      <firstName xmlns="http://model.adt.tactical.intermountain.org">A</firstName>'
  8          ||'      <isValidPatient xmlns="http://model.adt.tactical.intermountain.org">true</isValidPatient>'
  9          ||'      <languageCode xmlns="http://model.adt.tactical.intermountain.org">ENGLISH</languageCode>'
10          ||'      <lastName xmlns="http://model.adt.tactical.intermountain.org">SMITH</lastName>'
11          ||'      <maritalStatusCode xmlns="http://model.adt.tactical.intermountain.org">M</maritalStatusCode>'
12          ||'      <middleName xmlns="http://model.adt.tactical.intermountain.org">MADELINE</middleName>'
13          ||'      <newEmpi xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
14          ||'      <newPatient xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
15          ||'      <sexCode xmlns="http://model.adt.tactical.intermountain.org">F</sexCode>'
16          ||'    </ns1:patient>'
17          ||'    <ns1:patient xmlns:ns1="http://model.adt.tactical.intermountain.org">'
18          ||'      <age xmlns="http://model.adt.tactical.intermountain.org">47</age>'
19          ||'      <birthDate xmlns="http://model.adt.tactical.intermountain.org">1969-04-15T00:00:00-07:00</birthDate>'
20          ||'      <empi xmlns="http://model.adt.tactical.intermountain.org">540171</empi>'
21          ||'      <firstName xmlns="http://model.adt.tactical.intermountain.org">A</firstName>'
22          ||'      <isValidPatient xmlns="http://model.adt.tactical.intermountain.org">true</isValidPatient>'
23          ||'      <languageCode xmlns="http://model.adt.tactical.intermountain.org">ENGLISH</languageCode>'
24          ||'      <lastName xmlns="http://model.adt.tactical.intermountain.org">SMITH</lastName>'
25          ||'      <maritalStatusCode xmlns="http://model.adt.tactical.intermountain.org">D</maritalStatusCode>'
26          ||'      <middleName xmlns="http://model.adt.tactical.intermountain.org">KELLY</middleName>'
27          ||'      <newEmpi xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
28          ||'      <newPatient xmlns="http://model.adt.tactical.intermountain.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>'
29          ||'      <sexCode xmlns="http://model.adt.tactical.intermountain.org">F</sexCode>'
30          ||'    </ns1:patient>'
31          ||'  </out></findPatientByNameResponse>') myXmlCol
32          from dual)
33  select --t.column_value.getClobval(),
34      extractValue(t.column_value,'//birthDate','xmlns="http://model.adt.tactical.intermountain.org"') "birthDate"
35  from x x1,
36*   table(xmlsequence(extract(x1.myXmlcol,'/findPatientByNameResponse/out/ns1:patient','xmlns="http://service.adt.tactical.intermountain.org" xmlns:ns1="http://model.adt.tactical.intermountain.org"'))) t
birthDate
1949-11-23T00:00:00-07:00
1969-04-15T00:00:00-07:00
SQL> Message was edited by: copy&pasted removed some important code. Added this manually.
Sven W.

Similar Messages

  • HELP RETRIVEING XML DATA

    Hello,
    i have a field which stores IP and Domain data in XML format. The field data type is BLOB.
    here is the XML data sample stored in the field.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <DOMAIN Name="DOMAIN_NAME HERE">
    <IPADDRESS Address="X.X.X.X1"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X2"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X3"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X4"></IPADDRESS>
    ... ETC
    Is it possible to run SELECT against this field and retrieve the data in the table format, so the output will have two fields and look like
    domain IPADDRESS
    DOMAIN_NAME HERE X.X.X.X1
    DOMAIN_NAME HERE X.X.X.X2
    DOMAIN_NAME HERE X.X.X.X3
    DOMAIN_NAME HERE X.X.X.X4
    I have tried many option with Extract, extractvalue and XMLQuery, not luck.
    Thank you very much!
    Sergei

    Use the extractValue() function to extract the node values.
    Refer example 4-3.
    http://www.lc.leidenuniv.nl/awcourse/oracle/appdev.920/a96620/xdb04cre.htm#1024805

  • Help retreiving XML data in table format

    Hello,
    i have a field which stores IP and Domain data in XML format. The field data type is BLOB.
    here is the XML data sample stored in the field.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <DOMAIN Name="DOMAIN_NAME HERE">
    <IPADDRESS Address="X.X.X.X1"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X2"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X3"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X4"></IPADDRESS>
    ... ETC
    Is it possible to run SELECT against this field and retrieve the data in the table format, so the output will have two fields and look like
    domain IPADDRESS
    DOMAIN_NAME HERE X.X.X.X1
    DOMAIN_NAME HERE X.X.X.X2
    DOMAIN_NAME HERE X.X.X.X3
    DOMAIN_NAME HERE X.X.X.X4
    I have tried many option with Extract, extractvalue and XMLQuery, not luck.
    Thank you very much!
    Sergei

    Try...
    xp20:format-dateTime(string($dateFromDatabase), '[D01]-[MN,*-3]-[Y0001] [H01]:[m01] P')Ref
    http://www.w3.org/TR/xslt20/#function-format-dateTime
    Cheers,
    Vlad

  • Need help in XML data processing

    Hi All,
    I have to process a stored procedure's input parameter which comes as a string in the XML format.
    Ex:
    <Search>
    <Row1>
    <Table1>Tab1</Table1>
    <Column1>col1</Column1>
    <Operator1>op1</Operator1>
    <Value1>val1</Value1>
    </Row1>
    <Row2>
    <Table2>Tab2</Table2>
    <Column2>col2</Column2>
    <Operator2>op2</Operator2>
    <Value2>val2</Value2>
    </Row2>
    </search>
    I should process the above parameter and build a select query from each row.
    Ex: select * from Tab1 where col1 op1 val1;
    How can i achieve this?
    i am using oracle 11g version.
    Thanks in advance to all.

    Your xml is not "well-formed" as every tag has a separate name (the numbering part in Row1, Row2 etc.), i would expect it as
    <Search>
      <Row>
        <Table>Tab1</Table>
        <Column>col1</Column>
        <Operator>op1</Operator>
        <Value>val1</Value>
      </Row>
      <Row>
        <Table>Tab2</Table>
        <Column>col2</Column>
        <Operator>op2</Operator>
        <Value>val2</Value>
      </Row>
    </Search>Anyway, this would do what you want:
    WITH DATA AS (SELECT XMLTYPE('<Search>
                                  <Row1>
                                  <Table1>Tab1</Table1>
                                  <Column1>col1</Column1>
                                  <Operator1>op1</Operator1>
                                  <Value1>val1</Value1>
                                  </Row1>
                                  <Row2>
                                  <Table2>Tab2</Table2>
                                  <Column2>col2</Column2>
                                  <Operator2>op2</Operator2>
                                  <Value2>val2</Value2>
                                  </Row2>
                                  </Search>') xml
                    FROM DUAL
    SELECT 'SELECT * FROM ' || TAB || ' WHERE ' ||COL || ' ' || OPER || ' ' || VALUE
      FROM (SELECT EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Table' || LEVEL) TAB,
                   EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Column' || LEVEL) COL,
                   EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Operator' || LEVEL) OPER,
                   EXTRACTVALUE(xml, '/Search/Row' || LEVEL || '/Value' || LEVEL) VALUE
              FROM DATA
              CONNECT BY LEVEL<100
    WHERE TAB IS NOT NULL

  • Read/write xml data from/to adobe livecycle forms (pdf)

    Hello,
    I need some help reading xml data from pdfs created by Adobe LiveCycle and also writing xml data back to the form.
    The forms have been created using PROD LC 8.2 and in the future they will be created using PROD LC 9.5.
    I am using Visual Basic .NET to access the data programatically.
    Can anyone help me with some hints? A library, SDK? Any information would be very helpful.
    I am quite new with this Electronic Forms issue and I do not even know where to start.
    Thank you,
    Ionel

    Hi lonel,
    Do you want an online solution?
    I mean, it follows this workflow:
    1. The user will open the PDF by clicking a link, and a server-side program will generate the PDF and prepopulate it with data from some data sources, and render the PDF to the client (Browser),
    2. The user will fill the PDF.
    3. The user will click a Submit button and save the PDF and Data on the server.
    4. If the user wants to edit the Submitted Form, he will click a link to open the save PDF and possibly prepopulate some fields with data from other data sources, and complete the cycle of filling and saved the PDF and Data on the server.
    5. While the user is filling the PDF (inside a Browser), there might be a need to perform some lookup on the server, and update the form parts accordingly as a result of the lookup process.
    For 1-4 above, I have developed a complete base library using ASP.NET which helps you to perform the above.
    You can goto my Google Workspace and you will find a bunch of documents, sample PDFs, collections and VB Classes. To best view them, login using some Google Account.
    For point 4 above, one way to perform this effect, is to regenerate the required XML Data (which has the saved data before and the new lookup data), remerge the entire XML result with and empty PDF Form, and render the XFA (PDF Form) back to the client. But, if the PDF has one or more signatures, it will not work. So, in this case, you can update the Form Fields of a Saved PDF Form with new Data from the server, but the net effect is that you will have to loose all the signatures that were added on the PDF before.
    For 5 (above) there are 3 methods:
    1. Using a Web Service as a Data Connection. This is very easy if you have a traditional Web Service. I have used this method several times and will use it again if the need be. But, there is a problem. If the result of the Web Service is an Array of some Data, and you want to remerge the XFA to get the required effect after executing the web service ... and ... if there are some Drop-Down-List (DDL) fields, the bindings of the DDL Items of those fields will be lost. But, you can rebuild them (on enter event of the DDL Field)  if you have saved them in the embedded XML Data.
    2. You can update few (not many) fields while the PDF is opened (under the Browser via IFRAME) by passing the new field values using the URL Query String method. I have not done this, but I like this method, and I think it is cool. You need to write a server side code to ensure the the new filed values are passed back to the client using the correct URL with the Query String, and you need to write some javascript code inside the PDF to parse the URL and get the new field values and update them accordingly. See this as an example:
    http://www.halnesbitt.com/pages/pdfqs.php
    3. This method is very advanced and uses message communication ques between the Browser and the PDF (which is opened inside IFRAME element) using HostContainer object. This method will enable 2-way communication between the Browser and the PDF on the client side using javascript. I'd love to use this method one day. See example here:
    http://www.windjack.com/WindJack/Browser2PDF/brwsr2acroJS.htm
    I hope this will be of help to you.
    Tarek.

  • Help needed with sending XML data out of Dashboard design/ Xcelsius

    Hi All,
    I did this a year back and got it right, but now am not able to get it, probably Ive made a small mistake which I have been overlooking.
    I selcted Enable XML send in my XML data connection and dfined the connection name as "Range_1" and Range name also as "Range_1"
    Now I worte this servlet in Java:
    public class PostTestServlet extends HttpServlet{
         protected void doPost(HttpServletRequest request, HttpServletResponse response){
         String param1=request.getParameter("Range_1");
         System.out.println(param1);
         protected void doGet(HttpServletRequest request, HttpServletResponse response){
         System.out.println("Get Called");
         doPost(request,response);
         System.out.println("abcd");
    Deployed it to Apache Tomcat 6.
    Also selected the required usage options in Xcelsius for sending data every 10 seconds.
    Now the servlet gets called, I see it in the console.
    But the request.getParameter("Range_1") is returning null.
    Tried many things, not able to figure it out. Any help?
    Thanks
    Nikhil

    Hi,
    Xcelsius/Dashboards will convert the range of values that you want to send into XML.
    It then will POST the XML when it calls the web page.
    For example, if you had created three ranges to send to your web page:
    A (a single cell)
    B (a single cell)
    C (a row of three cells)
    The data in the POST input stream for the web page will look something like this:
    <data>
      <variable name="A">
        <row>
          <column>10</column>
        </row>
      </variable>
      <variable name="B">
        <row>
          <column>15</column>
        </row>
      </variable>
      <variable name="C">
        <row>
          <column>1</column>
          <column>2</column>
          <column>3</column>
        </row>
      </variable>
    </data>
    I don't have an example for ASP, but I do for a JSP (attached).
    Regards
    Matt

  • XML Data Set with Spry Slides - Please Help

    Hi, I'm trying to combine XML Data Set with sliding tabs.
    I've created two keys responsible for sliding the tabs:
    <a id="previous" href="#"
    onclick="sp1.showPreviousPanel();">Previous</a>
    <a id="next" href="#"
    onclick="sp1.showNextPanel();">Next</a>
    Then XML Data Set is used to populate the tabs, but only a
    single tab remains visible, and a "Next/Previous" buttons are used
    to move to the next tab. And this is where the problem arises.
    The problem is that, every time I refreash the gallery or
    load it for the first time, I have to press TWICE the "Next" button
    to move to the next image. After that, its all fine, and slides
    well. It's only the FIRST time when loaded.
    Please help.
    Here's the full code:
    <div id="images_gal" >
    ///////////////////////////////////////// The menu - the
    culprit///////////////////////////////////////////
    <div id="menu_next">
    <a id="previous" href="#"
    onclick="sp1.showPreviousPanel();">Previous</a>
    <a id="next" href="#"
    onclick="sp1.showNextPanel();">Next</a>
    </div>
    //////////////////////////////////////// The Sliding Panels
    Gallery ////////////////////////////////////////////////////
    <div id="example2" class="SlidingPanels" tabindex="0" >
    <div class="SlidingPanelsContentGroup"
    spry:region="dsSpecials">
    <div spry:repeat="dsSpecials" id="{first}"
    class="SlidingPanelsContent{second}"><div class="top_gal"
    ></div><div class="main_gal"><img
    src="images/Galery/{third}" alt="Digital_Signage" width="600"
    height="304" />
    <p class="screen_gal"><a href="#"
    onclick="MM_openBrWindow('film1.html','Coloris','width=340,height=260,
    top=250, left=250')">CLICK TO VIEW</a></p>
    </div><div
    class="bottom_gal"></div></div>
    </div>
    </div>

    Anyone has any idea why I need a DOUBLE Click to start moving
    the sliding panels?
    I've just completed two tutorials by Don Booth.
    1/Building a Spry Sliding Panels widget
    2/Building a photo album with the Spry framework
    But what I try to COMBINE them - display the photos in
    sliding panels, I also need to DOUBLE click the "next" buton before
    it starts scrolling.
    Why is that Double Click needed? Help Please.
    Here's my code for the combined version:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    a {
    position:relative;
    left:23px;
    top:127px;
    z-index:10000;
    color: #FF0000;
    </style>
    <script type="text/javascript"
    src="photo_album_samples/includes/xpath.js"></script>
    <script type="text/javascript"
    src="photo_album_samples/includes/sprydata.js"></script>
    <script type="text/javascript"
    src="Spry/SprySlidingPanels.js"></script>
    <link type="text/css" rel="stylesheet"
    href="Spry/SprySlidingPanels.css">
    </head>
    <body>
    <div >
    <a href="#" onclick="sp1.showPreviousPanel();">Previous
    Panel</a>
    <a href="#" onclick="sp1.showNextPanel();" >Next
    Panel</a>
    </div>
    <div id="panelwidget" class="SlidingPanels" >
    <div class="SlidingPanelsContentGroup"
    spry:region="dsGallery" >
    <div spry:repeat="dsGallery" class="SlidingPanelsContent"
    id="p1"><img
    src="photo_album_samples/thumbnails/{@thumbpath}"/></div>
    </div>
    </div>
    <script type="text/javascript">
    var dsGallery = new
    Spry.Data.XMLDataSet("photo_album_samples/photos.xml",
    "gallery/photos/photo");
    </script>
    <script type="text/javascript">
    var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
    </script>
    </body>
    </html>

  • Help with XML, display data on swipe/click

    Hello.
    I am trying to create a moibile app that displays XML data. It's basically a phone book. I want the data to change when swiped. I can get the data in just fine. I can get it to display fine. I am not seeing the correct image first, however. I think it's a problem with my imagenum variable.
    Then, I want to change what is displayed when the user clicks/swipes on the screen. How do I do that?
    stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();
    var imageNum:Number=0;
    var totalImages:Number;
    //Load XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("recbook.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void {
    var theXMLData:XML = new XML(XMLURLLoader.data);
    totalImages=theXMLData.name.length();
    for (var i:Number =0; i < totalImages; i++){
      //push xml data into the arrays
      nameArray.push(theXMLData.name[i]);
      countryArray.push(theXMLData.country[i]);
      portraitArray.push(theXMLData.portrait[i]);
      flagArray.push(theXMLData.flag[i]);
      jobtitleArray.push(theXMLData.jobtitle[i]);
    //data is processed
    loadData();
    function loadData():void {
    var thisPortrait:String = portraitArray[imageNum];
    var thisCountry:String = countryArray[imageNum];
    var thisName:String = nameArray[imageNum];
    var thisJobtitle:String = jobtitleArray[imageNum];
    var thisFlag:String = flagArray[imageNum];
    var dataLoader:Loader = new Loader();
    dataLoader.load(new URLRequest(portraitArray[imageNum]));
    dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
    function dataLoaded(event:Event):void {
      //I want to start with image 0 (img1.jpg) and cycle through with a mouse click (finger swipe on iOS)
      stage.addEventListener(MouseEvent.CLICK, loadMainImage1);
      function loadMainImage1(event:MouseEvent):void {
       portraitUILoader.source=thisPortrait;
       flagUILoader.source=thisFlag;
       selectedName.text=thisName;
       selectedCountry.text=thisCountry;
       selectedJobtitle.text=thisJobtitle;
    //add to imageNum (1);
    imageNum++;
    if (imageNum < totalImages) {//stopping at img2
      trace("imageNum " + imageNum);
      trace("image name (thisPortrait) " + thisPortrait);//losing image 4 somewhere
      loadData();
      trace("Total Images " + totalImages);
    //click to move past the home screenI'd like to ditch this. don't know how.
    homeScreen_mc.addEventListener(MouseEvent.CLICK, goNext);
    function goNext(event:MouseEvent):void
    nextFrame();
    */here's the output:
    imageNum 1
    image name (thisPortrait) images/img1.jpg
    imageNum 2
    image name (thisPortrait) images/img2.jpg
    imageNum 3
    image name (thisPortrait) images/img3.jpg
    Total Images 4
    Total Images 4
    Total Images 4
    Total Images 4
    It starts the display on image 1 (the second in the series img2.jpg)*/

    Thank you.
    That helped. I get the correct images in the output, but not in the display. I also get the following error. Any chance you could help with that?
    new output after moving the increment:
    imageNum 0
    image name (thisPortrait) images/img1.jpg
    imageNum 1
    image name (thisPortrait) images/img2.jpg
    imageNum 2
    image name (thisPortrait) images/img3.jpg
    imageNum 3
    image name (thisPortrait) images/img4.jpg
    TypeError: Error #2007: Parameter url must be non-null.
    at flash.display::Loader/_load()
    at flash.display::Loader/load()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/processXML()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

  • Spry XML Data won't diplay - Help

    Here is my code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xmlns:spry="
    http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    #apDiv1 {
    position:absolute;
    left:8px;
    top:27px;
    width:266px;
    height:115px;
    z-index:1;
    -->
    </style>
    <script language="JavaScript" src="SpryAssets/xpath.js"
    type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js"
    type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var dsEvent = new Spry.Data.XMLDataSet("events.xml",
    "events/event");
    //-->
    </script>
    </head>
    <body>
    <div id="apDiv1">
    <div spry:region="dsEvent">
    <table width="278" >
    <tr>
    <th>Name</th>
    <th spry:sort="location">Location</th>
    </tr>
    <tr spry:repeat="dsEvent" spry:setrow="dsEvent">
    <td>{name}{date}</td>
    <td>{location}</td>
    </tr>
    </table>
    </div>
    </div>
    </body>
    </html>
    Here is my problem:
    If I use UNC path it display the data.
    If I use IIS --- such as http:\\testServer\devhome\test.cfm
    it will give me a blank white page. No xml data.
    Can any one point me out what I am doing wrong?
    Thanks in advance.

    Here is my new finding : After I changed ".cfm" to ".html"
    --- it work's !!!!!!!!!!
    My new question is why it is not working in coldfusion. I
    tried in two diffrent server --- same result.
    Need some help here.
    Thanks in Advance.

  • XML Data Server and model help

    All,
    I have the following files
    1) travel.dtd
    2) travel.xml.
    I've set up a XML data server with JDBC driver com.sunopsis.jdbc.driver.xml.SnpsXmlDriver and URL = jdbc:snps:xml?d=c:/XML/travel.dtd. I have created a model in designer and have successfully reversed the datastores generated from the dtd.
    The travel.xml file has data populated within it, but when I right click on the datastores, there is nothing displayed. This makes sense because the xml server is configured to point at the .dtd. Do I need to change my topology connection to connect to the xml document as opposed to the dtd. Can someone tell me what i'm missing?
    thanks for your help.

    Since its not displaying anything as you are saying you just change the property to "f" and check.
    Example
    jdbc:snps:xml?f=/xml/myxml.xml&d=/xml/myxcd.xsd&s=MYSCHEMANAME
    ("s=MYSCHEMANAME": This schema will be selected when creating the physical schema under the XML data server.)
    Hope it helps.
    Thanks

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • Little help with complex XML data as data provider for chart and adg

    Hi all,
    I've been trying to think through a problem and Im hoping for
    a little help. Here's the scenario:
    I have complex nested XML data that is wrapped by subsequent
    groupings for efficiency, but I need to determine if each inner
    item belongs in the data collection for view in a data grid and
    charts.
    I've posted an example at the bottom.
    So the goal here is to first be able to select a single
    inspector and then chart out their reports. I can get the data to
    filter from the XMLListCollection using a filter on the first layer
    (ie the name of the inspector) but then can't get a filter to go
    deeper into the structure in order to determine if the individual
    item should be contained inside the collection. In other words, I
    want to filter by inspector, then time and then tag name in order
    to be able to use this data as the basis for individual series
    inside my advanced data grid and column chart.
    I've made it work with creating a new collection and then
    looping through each time there is a change to the original
    collection and updating the new collection, but that just feels so
    bloated and inefficient. The user is going to have some buttons to
    allow them to change their view. I'm wondering if there is a
    cleaner way to approach this? I even tried chaining filter
    functions together, but that didn't work cause the collection is
    reset whenever the .refresh() is called.
    If anyone has experience in efficiently dealing with complex
    XML for charting purposes and tabular display purposes, I would
    greatly appreciate your assistance. I know I can get this to work
    with a bunch of overhead, but I'm seeking something elegant.
    Thank you.

    Hi,
    Please use the code similar to below:
    SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
    SORT IT_DO_NOT_LOAD by WBS_Key.
        IF SOURCE_PACKAGE IS NOT INITIAL.
          IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
    LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
            V_SYTABIX = SY-TABIX.
            READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
            WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
            BINARY SEARCH.
            IF SY-SUBRC = 0.
              IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )     
              DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
            ENDIF.
    ENDIF.
          ENDLOOP.
          SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
        ENDIF.
    -Vikram

  • Help Secure your XML data - Solution-ish

    Note: Possibly posting this in the wrong forum, Mods feel free to remove or correct.
    This should add a small amount of deterance to someone stealing your data by
    bypassing your flash .swf and just grabbing your xml file to parse themselves.
    File name and variable names of course can be changed, simply keeping
    with the example I'll keep them all what they should be for this
    example to actually work.
    ** Description: This will let your change your secretValue for your
    secretVariable on your flash program and not give you any downtime
    when you upload your flash file with the new secretValue.
    Just remember to change the values stored in your php file after
    you uplaod your flash doc with the new secretValue. As people can
    see the value you send to get your xml file it's not safe for long, if you
    use this idea you'll have to keep up with changing your secretValue to
    make it less desirable for pirates to get your info. In essance this solution
    is designed to bring the end users of the data into the fold helping you decide
    which ip's to potentially block or whatever action you see fit.
    $current_check_value - should always be what your password for the live
    flash doc is.
    $when_updateFlash_check_value - should always be what your next password
    will be next time you upload your flash doc.
    Hope you like it.
    By: Chuck Mongillo
    // PHP File: The XML responder - sends out the xml data
    <?PHP
    File Name: MyXMLfile.php and it would be held in
    Path: http://www.MyServer.com/MyPath/
    // If your server requires you to specify your incoming variables
    // Uncomment this next line.
    // $secretVar = $_GET['secretVar'];
    // Tell your PHP file which passwords it will accept for right now
    // and the password it will accept after you update your flash .swf
    // so there is no downtime for your real project. Downside - your
    // always allowing 2 possible ways in, ie: 2 passwords.
    $current_check_value = "PiratesAreBad";
    $when_updateFlash_check_value = "AreUaPirate";
    if(($current_check_value != $secretVar)&&($when_updateFlash_check_value != $secretVar)){
         // My current .swf secretValue and my updated .swf secretValue failed
         // Give the pirate a slap
         echo("
         <?xml version=\"1.0\" encoding=\"utf-8\"?>
         <myRoot>
              <myXMLValues>
                   <happyData>This data was stolen from MyServer.Com</happyData>
                   <happyData>Please report it. Bad Pirate No Donut!!</happyData>
              </myXMLValues>
         </myRoot>
         // Stop further execution of this file
         exit;
    } // End bad password check
    else{
         // Yay, its (seems to be) my .swf calling the program
         // Give the proper data
         echo("
         <?xml version=\"1.0\" encoding=\"utf-8\"?>
         <myRoot>
              <myXMLValues>
                   <happyData>Tomorrows Winning Lotto Number is:</happyData>
                   <happyData>1 - 2 - 3 - 4 - 5 - 6</happyData>
              </myXMLValues>
         </myRoot>
    } // End good passsword check
    ?>
    // Flash AS3 code: The data request
    // In your flash document you should have something like this to pull your xml file:
    // Set a string to hold your xml path and secret value to check against
    secretValue:String = "PiratesAreBad";
    myXMLurl:String = "http://www.MyServer.com/MyPath/MyXMLfile.php?secretVar=" + secretValue;
    // Set xml and loader variables
    var MyXMLloader:URLLoader = new URLLoader();
    var MyXMLData:XML;
    // Get your XML
    MyXMLloader.load(new URLRequest(myXMLurl));
    MyXMLloader.addEventListener(Event.COMPLETE, gotMyXMLData);
    function gotMyXMLData(e:Event):void
         MyXMLData = new XML(e.target.data);
         MyXMLloader.removeEventListener(Event.COMPLETE, gotMyXMLData);
         // Still not sure why removing a listener requires a call to a function.
         // Expecially why people use it in the same funciton it sits in.
         // But, now you have your xml data.
         If you have other ideas or want to expand on this one feel free, thanks.

    {forum:id=34} is the correct forum to this, and as I see you have already double-posted to there, I suggest that you close this thread.

  • Help required in building up the Java Bean for an XML data

    Hi ,
    I want to build a Java bean which will actually represent an xml data . The class will be named as User and it will typically represent the data in the follwing xml:
    <user>
    <cwsId>barbete</cwsId>
    <firstName>William</firstName>
    <lastName>Barber</lastName>
    <status>true</status>
    <role>
    <roleCode>1000000177</roleCode>
    <roleName>Customer Administrator</roleName>
    </role>
    <language>en</language>
    <country>US</country>
    <preferences>
    <equipmentGroup>2717</equipmentGroup>
    <dateFormat>MON-dd-yyyy</dateFormat>
    <timeFormat>HH:MI AM</timeFormat>
    <timeZone>-12:00</timeZone>
    <daylightSavings>Y</daylightSavings>
    <location>NC</location>
    <recordsPerPage>10</recordsPerPage>
    <historyPeriod>3</historyPeriod>
    <distanceUnit>MILE</distanceUnit>
    <fuelUnit>G</fuelUnit>
    <unitIdDisplay>E</unitIdDisplay>
    <smuUpdate>W</smuUpdate>
    <countries>
    <country>
    <countryCode>GB</countryCode>
    <countryName>UNITED KINGDOM</countryName>
    </country>
    <country>
    <countryCode>US</countryCode>
    <countryName>UNITED STATES</countryName>
    </country></countries>
    </preferences>
    </user>
    Now for single child nodes like cwsId of the main user node i have kept properties like
    private String cwsId;
    But i am not sure as to how to represent the nodes which contain subnodes like "preferences"node. Any ideas?What is the standard practice?

    One thing you could do is create an object model first, which will contain all the data for your user.
    then all you need in the bean is a Hashtable with the name of the user as a key, and the user-object (which is actually the complete object model) as a value.
    with the XML stated by you, you would get an object model something like this:
    Class User
        String cwsid;
        String firstName;
        ArrayList<Role> roles = new ArrayList<Role>(); //I'm assuming a user can have more then one role.
        ArrayList<Country> countries = new ArrayList<Country>();
    class Role {
        String code;
        String name;
    class Country {
        String code;
        String name;
    }And so on for all the varioous elemets of your XML.

  • Please help. Text fields launch email for XML data

    Let me start by saying I have only been using LiveCycle for two days. I did buy a book and have exhaustuvley searched for a solution....with that said....
    After completing almost the entire form, somehow or other I managed to make all the text fields but one initiate email of xml data as soon as you try to type in them in PDF preview or reader or pro.
    I added a new text field for test and it does NOT do the same thing. I can't for the life of me figure out how to turn this off.
    Issue:
    When checking pdf preview, if I click inside a text field to type, it stops the preview and launches an email window with a blank XML file. It does the same thing if I open the file in Reader or Pro.
    Solution I am looking for:
    My form is nearly complete and i would hate to have to start all over. Basically, I do NOT want the text fields to initiate an email of the form data. I just want the user to be able to type in them as required. In my opinion this should only happen with the "email form" button.
    Thanks,
    Joe
    [email protected]

    funny, i found a workaround. after nearly 3 hours and finally posting here, in 15 minutes i found something. I still would like to know
    what caused this if anyone knows.....
    Fix:
    By selecting the text field and changing object type to "Text" then changing it back to "TextField" then save, it now works fine. Of course I had to do it on all 25 fields but way better than redoing all the custom fields i created.

Maybe you are looking for

  • Help on searching file in a directory ??????????????????

    hi there let's say i have a directory C:/myFolder and in the folder there are several files, i need to find if "test.txt" is in this folder. should i use File class to create an instance first like the following File f = new File("C:/myFolder"); Stri

  • OSB 11g - Clustered - Email protocol not available in transport config page

    Hi, We have a clustered environment of Oracle SOA suite and OSB server on OEL 5/Solaris-64 Bit. While trying to create a business service with protocol as Email, we do not get email in the drop down. Whereas in standalone environment we got it and we

  • Delete serial number in adobe master collection cs5 the install again in Windows 7

    Hi, I  have a huge problem, when I formatting my pc (windows 7) and when i re-install the adobe master collection cs5 original, and the serial number what i have don´t serve Can i do something about this?   Greetings from Chile

  • Galati francesco

    Hello, I am an Italian student and I am using bdb xml. It seems that it works but when I close the container and xmlManager, bdb xml gives me the following situation: "run: 3 results returned for query ' collection('container1.dbxml')'. Database hand

  • Ipod click wheel does not work at all..

    I gave a friend of mine my 4g photo. It worked for him for a few days and then stopped. He brought it back to me and I restored it twice back to factory settings. Still nothing. The other weird thing is when you cycle between hold and on, it starts t