Filtering columns in a .csv file v .xml file

Hi everyone,
The following code fragment apparently creates a dataset from an xml file. The first line creates the dsStates dataset from an xml file called states.xm. The second line seems to be pulling in the list of cities into the dsCities dataset from the same xml file. I mean I assume this is what it's doing since it's accessing {dsStates::url} and then "/state/cities/city".
var dsStates = new Spry.Data.XMLDataSet("../../data/states/states.xml", "/states/state");
var dsCities = new Spry.Data.XMLDataSet("../../data/states/{dsStates::url}", "/state/cities/city");
My question is that since I'm not using xml as the source file for the dataset I'm creating but instead I'm using a .csv file, I'm wondering whether I can create two similar constructor functions like the above xml versions. I assumed that the first line would be as follows:
var dsTypes = new Spry.Data.CSVDataSet("data/types.csv");
This would bring in the data from a .csv file called "types.csv".
The question is though how would I access certain columns in this types.csv file so that I can filter them into the second dataset which would be called dsHospitals. I started off with the following line:
var dsHospitals = new Spry.Data.CSVDataSet("    ");
...but then since it's not xml is there are way to target these columns as it's done in the xml version. Or are there limitations with what I can do with a .csv file compared to xml files?
Would really appreciate any advice.

Thanks for the reply,
I've actually ended up using an xml file instead of a .csv due to the limitations.
I'm pulling in some xml files dynamically into a table and have based the code on the information at the following url:
http://labs.adobe.com/technologies/spry/samples/data_region/SpryPagedViewSample.html
My application is identical to the one in the above url except that instead of bringing in state and cities, I'm bringing in categories instead of the states and hospital names and addresses instead of the cities.
The example in the url uses an unordered list to display the names of the cities as in the following code:
<div spry:region="pvFacilities dsFacilities">
      <ul spry:repeatchildren="pvFacilities" spry:choose="choose">
            <li spry:when="{pvFacilities::ds_RowID} == {pvFacilities::ds_CurrentRowID}" spry:select="select" spry:selectgroup="page" spry:selected="selected" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::name}</li>
            <li spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::name}</li>
      </ul>
</div>
I needed to revise this since I'm not only displaying one item, ie. the city name as in the example, but instead I'll be displaying the full hospital details which would require that the information is inserted into a table. So I had to adapt the above code to work with a table and I came up with the following:
   <div id="privRegion" spry:region="pvFacilities dsFacilities">
  <table id="private" cellspacing="0" summary="A list of private hospitals">
<caption>Private Hospitals </caption>
<thead>
  <tr>
    <th id="name" scope="col"><a href="#">Name</a>
      </td>
    <th id="address" scope="col">Address</td>
    <th id="suburb" scope="col"><a href="#">Suburb</a>
      </td>
    <th scope="col">State
      </td>
    <th scope="col">Postcode</td>
    <th scope="col">Phone</td>
    <th scope="col">Fax</td>
  </tr>
  </thead>
  <tbody>
  <tr spry:repeatchildren="pvFacilities" spry:choose="choose">
    <td spry:when="{pvFacilities::ds_RowID} == {pvFacilities::ds_CurrentRowID}" spry:select="select" spry:selectgroup="page" spry:selected="selected" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Name}</td>
    <td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Address}</td>
    <td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Suburb}</td>
    <td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::State}</td>
    <td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Postcode}</td>
    <td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Phone}</td>
    <td spry:default="default" spry:select="select" spry:selectgroup="page" spry:hover="hover" spry:setrow="pvFacilities">{pvFacilities::Fax}</td>
  </tr>
  </tbody>
</table>
</div>
When I test though, it's only bringing in the first row and even then, it's only bringing in the hospital name and then 19 of the phone numbers from other hospitals! Not exactly what I was aiming for?
Are you able to take a look at the following url to see where I may have gone wrong?
http://files.officelinkonline.com.au/spry_test/
Really appreciate any help/advice.

Similar Messages

  • Excel file to XML file

    Hi Expets!
    I have a requirement to convert  Excel file to XML file. This is new to me . When i serach in SDN i came to know that we want to create an EJB Module. I am not having much knowledge in Java bean. we are using the PI7.1 version.
    I need to know what is the basic requirements for creating this EJB Module and also some inputs for how to start with this scenario.
    Thanks and Regard's
    Preethi.

    u have to create a adapter module for the same...
    /people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives
    http://wiki.sdn.sap.com/wiki/display/ABAP/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns
    /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter
    Libraries for adapter module development:
    http://wiki.sdn.sap.com/wiki/display/XI/Where%20to%20get%20the%20libraries%20for%20XI%20development
    how to create adapter module in PI7.1:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa

  • Is there any way to use the iTunes .itl file or .xml file to see what files I had previously to re-download songs?

    I recently had to restore my computer and in the process of backing up my music library, half of my library from the letter 'm' onward was deleted.
    I want to see if I could use the existing .itl file or .xml file that was automatically saved by iTunes in the iTunes folder previously (which I backed-up in my external drive) to view my past library.
    I tried importing the library by going to File > Library > Import Playlist, but I got an error that said:
    "Some of the songs in the "iTunes Music Library.xml" were not imported because they could not be found.
    The .itl file was no help either in this case.
    IS THERE ANYTHING I CAN DO?

    How did you try to make use of the .itl file? Double-clicking on .itl files doesn't switch libraries but opens whatever is currently the default library. To switch between library files either press and hold down shift as you launch iTunes until prompted to choose or create a library, or swap out one library file with another as described in Empty/corrupt library after upgrade/crash.
    There is also a link there to tips on recovering media from your device or account history. You may also be able to undelete media from the drive if the space it occupied has not yet been reused.
    tt2

  • Message Mapping Error in Text File to XML file Scenario

    Hi Gurus,
    This is Sudheer...I am New to SAP-PI......
    Below link is File to File Scenario(Text File to XML File)...
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/basicFileAdapterContentConversion
    I am facing Message Mapping Error....I am not able to map the fileds...
    Please help me.
    -Sudheer

    Thanks Shabarish & Manisha for your reply....
    Ya I am getting error while I am testing in IR....
    I dont know how to map the fields that shown given below...
           Message Type         ---         Message Type
                 Record                              Employee
                     Header                                 EmployeeID
                         Key                              Name
                         EmpID                          Company
                         Name                            Phone
                         Company                       Prior_Employer
                         Phone                               Company         
                      Detail                                   Location
                          Key
                          Company
                          Location

  • PeopleCode to "Save As" - convert an excel file to XML file

    All,
    Is there any way to convert an excel file to XML file via PeopleCode? I can manually "Save As" an excel file to be an XML file, but is there anyway of doing it via PeopleCode? I guess it would be a little possible via VBScript, but since by App server resides on a Unix box, that would not work.
    Any help would be really appreciated.
    Thanks,
    Mani

    The attached zip file contains several VI's to read and write directly to Excel using ActiveX. There are several example VI showing how to use everything. This set is saved in LabVIEW 6.0.2.
    I suggest you unzip these to your user.lib directory so you'll be able to easily access them from the functions palette.
    I have not actually used these, but others that have say they have worked well for them.
    Good Luck
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    excel_lv6i.zip ‏898 KB

  • Fixed length file to xml file

    Hi,
    Fixed length file to xml files.
    i have to generate 2 xml files based on a field in the incoming file. structures of both xml files are same.
    I want to know how many target data type ,target msg interfaces have to be created?
    Thanks.

    Ok got you. Best thing would be to use  a simple OS command copy in your receiver communication channel. So do one mapping and generate one file and then use the OS command in receiver comm. channel after message processing then it should work for you.
    Regards,
    ---Satish

  • Flat file to xml file

    hello
    I am having a scenario a flat file to XML file. in the comm. channel of the sender I made a content conversion to the file and I see in the SXMB MONI and it looks ok. the output file, is declared as a file and I recieve an empty xml file.
    what am I missing?
    why it doesnt go out through the mapping that I declared so I will get a valid XML with its data?
    Kfir

    Hi,
    Please can you take the Sender side Payload from SXMB_MONI and try to test the mapping in Message Mapping ---> Test Tab.
    See if you are getting the same results. Even check if you have properly map the Header nodes in Mapping.
    Thanks
    Swarup
    Edited by: Swarup Sawant on Aug 4, 2008 8:08 AM

  • How to convert a Form to a Text file and XML file?

    Hi:
    I want to convert a Form to a Text file and XML file,but I don't know how convert?
    Please help!
    Oracle Form Builder V10.1.2.0.2
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    Thanks in advance!

    ..or follow the steps in Mtalink note; Doc ID: Note:196924.1
    Forms XML Conversion Feature ( Converting Forms To XML)

  • XML file 2 XML file

    Hi all,
    I have low experience with XI but I have created a scenario XML file to XML file (reference wiki.sdn.sap.com) where sender e receiver files are located into XI folders . The steps defined are :
    product;
    software component;
    technical system (thirdy-part);
    business system;
    import sofware component into integration repository;
    namespaces;
    data type (sender/receiver);
    message type;
    message interface;
    message mapping;
    interface mapping;
    configuration scenario into integration config.;
    assign business system;
    communication channel;
    file adapter with source e destination directory (folder XI), file name e processing parameters;
    receiver and interface determination
    sender and receiver agreement.
    When put the input file into sender folder I don't have output file and sxmb_moni is empty for XML message.
    Thanks in advance.
    Miki

    Hi Maurizio,
    you don't see anything entering inside your sxmb_monitoring: do you mean that the payload is empty or that you don't see any messages in the overview table?
    If you don't see any messages, this means that in the message is not send from your adapter engine towards your integration engine.
    Check wether:
    1) your communication is set up properly and is active
    2) your communication channel is functioning correctly via communication channel monitoring in the runtime workbench (goto the integration builder --> runtime workbench --> Component monitoring --> click on display --> click on adapter engine --> click on communication channel monitoring --> search for you communication channel and check for errors.
    3) check your sender agreement
    If you have an empty payload, check your payload in the first step of your message pipeline and check wether the payload has the expected layout.
    Kind regards
    Joris

  • How can convert HTML file into xml file?

    Hi,
    I am receving one HTML file as an input and i want to convert that receiving(html file) into .xml file.Is there any converter (tools)to do this.Pls if any give me the details with regard.
    Regards,
    mahesh.

    Use the HTMLEditorKit to parse the html file.
    this kit is having the callback methods which
    are called wenever the tag appears in the HTML
    stream.

  • How to convert Xls file into Xml file

    Hi,
    I am trying to convert Xls file into Xml  but there  is no any direct procedure for it
    Pls help me out to convert Xls file into Xml file
    Thanks
    Anushree

    you will require to write a module in your file adapter for the same.
    ref: /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter as mentioned in the earlier post.
    Else you can also use Conversion Agent to read the same.
    Ref: http://help.sap.com/saphelp_nw04/helpdata/en/43/4c38c4cf105f85e10000000a1553f6/content.htm

  • 403 Error Transmitting the message to endpoint for XML file to XML file

    Friends,
    This is my 4th day learning XI and getting below issue.
    I'm trying to follow the steps to transfer XML file to XML file scenario and when I drop the sender XML file, it seems the file has been picked-up but it does not generate the output file.
    I checked in RWB for the message and found below error:
    2008-01-04 13:09:48 Error Transmitting the message to endpoint http://sappc:8000/sap/xi/engine?type=entry using connection AFW failed, due to: Received HTTP response code 403
    I tried to access http://sappc:8000/sap/xi/engine?type=entry from new browser window and I get the same error "403".
    I'm able to access http://sappc:8000 fine.
    I would appreciate help on this.
    Thanks in advance.
    Hetal

    Sorry! you were correct I was looking at wrong file adapter. The message is error: (It gives 401 error during XICACHE update)
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Receiver Identification
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="XICACHE">UPDATE</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>HTTP status code401 Unauthorized</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>An error occurred when refreshing the XI runtime cache</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

  • Java code for converting EDI file to XML file

    Dear friends,
                     Can you please help me in getting the java code for converting to EDI file to XML file.

    Hi,
    You can convert the EDI file to XML in any of the ways
    1) Using third party seeburger adapters
    2) Conversion agent
    3) Stylus studio.
    I think using java code it will be very difficult.
    Thnx
    Chirag

  • Conversion of xls file into xml file

    Hi,
    i want to convert xls file into xml
    pls let me know the procedure for it
    Thanks

    Hi Anu,
    U can use FM <b>SAP_CONVERT_TO_XML_FORMAT</b> to convert data to XML.
    Or u can use some threads related to this FM. So that u can get better idea about this.
    Check this link also
    conversion of xls file into xml file
    regards,
    raghu

  • How to get the column name and table name from xml file

    I have one XML file, I generated xsd file from that xml file but the problem is i dont know table name and column name. So my question is how can I retrieve the data from that xml file?

    Here's an example using binary XML storage (instead of Object-Relational storage as described in the article).
    begin
      dbms_xmlschema.registerSchema(
        schemaURL       => 'my_schema.xsd'
      , schemaDoc       => xmltype(bfilename('TEST_DIR','my_schema.xsd'), nls_charset_id('AL32UTF8'))
      , local           => true
      , genTypes        => false
      , genTables       => true
      , enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS
      , options         => dbms_xmlschema.REGISTER_BINARYXML
    end;
    genTables => true : means that a default schema-based XMLType table will be created during registration.
    enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS : indicates that a repository resource conforming to the schema will be automatically stored in the default table.
    If the schema is not annotated, the name of the default table is system-generated but derived from the root element name :
    SQL> select table_name
      2  from user_xml_tables
      3  where xmlschema = 'my_schema.xsd'
      4  and element_name = 'employee';
    TABLE_NAME
    employee1121_TAB
    (warning : the name is case-sensitive)
    To annotate the schema and control the naming, modify the content to :
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
      <xs:element name="employee" xdb:defaultTable="EMPLOYEE_XML">
        <xs:complexType>
    Next step : create a resource, or just directly insert an XML document into the table.
    Example of creating a resource :
    declare
      res  boolean;
      doc  xmltype := xmltype(
    '<employee>
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>'
    begin
      res := dbms_xdb.CreateResource(
               abspath   => '/public/test.xml'
             , data      => doc
             , schemaurl => 'my_schema.xsd'
             , elem      => 'employee'
    end;
    The resource has to be schema-based so that the default storage mechanism is triggered.
    It could also be achieved if the document possesses an xsi:noNamespaceSchemaLocation attribute :
    SQL> declare
      2 
      3    res  boolean;
      4    doc  xmltype := xmltype(
      5  '<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6             xsi:noNamespaceSchemaLocation="my_schema.xsd">
      7    <details>
      8      <emp_id>1</emp_id>
      9      <emp_name>SMITH</emp_name>
    10      <emp_age>40</emp_age>
    11      <emp_dept>10</emp_dept>
    12    </details>
    13   </employee>'
    14   );
    15 
    16  begin
    17    res := dbms_xdb.CreateResource(
    18             abspath   => '/public/test.xml'
    19           , data      => doc
    20           );
    21  end;
    22  /
    PL/SQL procedure successfully completed
    SQL> set long 5000
    SQL> select * from "employee1121_TAB";
    SYS_NC_ROWINFO$
    <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceS
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>
    Then use XMLTABLE to shred the XML into relational format :
    SQL> select x.*
      2  from "employee1121_TAB" t
      3     , xmltable('/employee/details'
      4         passing t.object_value
      5         columns emp_id   integer      path 'emp_id'
      6               , emp_name varchar2(30) path 'emp_name'
      7       ) x
      8  ;
                                     EMP_ID EMP_NAME
                                          1 SMITH

Maybe you are looking for