Binding very complex XML data in DataGrid

So here is an Xml i retrieve from webservice. And as you can
see it uses namespaces and so on... So there ar some
<q1:StatusOption> tags in here, and i need their props to be
bind in DataGrid with columns OptionValue, Description, State...
I've tried many ways but with no success. Please help! And if it's
possible without arrays. Thanks.
<RetrieveAttributeMetadataResponse xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns="
http://schemas.microsoft.com/crm/2006/WebServices">
<RetrieveAttributeMetadataResult
xsi:type="q1:StatusAttributeMetadata" xmlns:q1="
http://schemas.microsoft.com/crm/2006/Metadata">
<q1:Name>statuscode</q1:Name>
<q1:Type>Status</q1:Type>
<q1:DisplayName>Status</q1:DisplayName>
<q1:Description>Reason for the status of the
contact.</q1:Description>
<q1:IsCustomField>false</q1:IsCustomField>
<q1:RequiredLevel>None</q1:RequiredLevel>
<q1:DefaultValue
xsi:type="xsd:int">-1</q1:DefaultValue>
<q1:ValidForCreate>true</q1:ValidForCreate>
<q1:ValidForRead>true</q1:ValidForRead>
<q1:ValidForUpdate>true</q1:ValidForUpdate>
<q1:DisplayMask>ValidForAdvancedFind ValidForForm
ValidForGrid</q1:DisplayMask>
<q1:NextValue>3</q1:NextValue>
<q1:Options>
<q1:StatusOption>
<q1:OptionValue>1</q1:OptionValue>
<q1:Description>Active</q1:Description>
<q1:State>0</q1:State>
</q1:StatusOption>
<q1:StatusOption>
<q1:OptionValue>2</q1:OptionValue>
<q1:Description>Not active</q1:Description>
<q1:State>1</q1:State>
</q1:StatusOption>
</q1:Options>
</RetrieveAttributeMetadataResult>
</RetrieveAttributeMetadataResponse>

I found an answer on the other forum. Check this out :)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="onCreationComplete()">
<mx:Script>
<![CDATA[
private var myxml:XML =
<RetrieveAttributeMetadataResponse xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns="
http://schemas.microsoft.com/crm/2006/WebServices">
<RetrieveAttributeMetadataResult
xsi:type="q1:StatusAttributeMetadata" xmlns:q1="
http://schemas.microsoft.com/crm/2006/Metadata">
<q1:Name>statuscode</q1:Name>
<q1:Type>Status</q1:Type>
<q1:DisplayName>Status</q1:DisplayName>
<q1:Description>Reason for the status of the
contact.</q1:Description>
<q1:IsCustomField>false</q1:IsCustomField>
<q1:RequiredLevel>None</q1:RequiredLevel>
<q1:DefaultValue
xsi:type="xsd:int">-1</q1:DefaultValue>
<q1:ValidForCreate>true</q1:ValidForCreate>
<q1:ValidForRead>true</q1:ValidForRead>
<q1:ValidForUpdate>true</q1:ValidForUpdate>
<q1:DisplayMask>ValidForAdvancedFind ValidForForm
ValidForGrid</q1:DisplayMask>
<q1:NextValue>3</q1:NextValue>
<q1:Options>
<q1:StatusOption>
<q1:OptionValue>1</q1:OptionValue>
<q1:Description>Active</q1:Description>
<q1:State>0</q1:State>
</q1:StatusOption>
<q1:StatusOption>
<q1:OptionValue>2</q1:OptionValue>
<q1:Description>Not active</q1:Description>
<q1:State>1</q1:State>
</q1:StatusOption>
</q1:Options>
</RetrieveAttributeMetadataResult>
</RetrieveAttributeMetadataResponse>;
private function onCreationComplete():void
var result:XMLList = myxml..*::StatusOption;
dg1.dataProvider = result;
private function getAttributeValue(item:Object,
column:DataGridColumn):String
var xmlList:XMLList = XML(item).child(new QName("
http://schemas.microsoft.com/crm/2006/Metadata",column.dataField));
return xmlList[0].toString();
]]>
</mx:Script>
<mx:DataGrid id="dg1"
labelFunction="getAttributeValue">
<mx:columns>
<mx:DataGridColumn dataField="OptionValue"/>
<mx:DataGridColumn dataField="Description" />
<mx:DataGridColumn dataField="State" />
</mx:columns>
</mx:DataGrid>
</mx:Application>

Similar Messages

  • How do I use the Session State to manage bind variables & download xml data

    I have a Report Query with more than 30 queries; many have bind variables in them. I'd like to create sample xml so that I can develop my word templates. When I try to download the XML data Source for Layout, it doesn't ask for the bind variable values.
    How can I download the XML data without replacing the bind variable values in each of the queries?
    Thank you.

    If you are using the Standalone version, then first of all make sure to UNCHECK (BIP10g 10.1.3.4.1)
    "AUTO RUN" (it is under General Settings when you select your Report Definition)
    Next, you should define the parameters in the corresponding parameter Section.
    Its simplest form is of "Text" type so you will have to enter values at runtime.
    Then these parameters can be used in your query as bind variables.
    When you run the report it will prompt for parameter values. Enter these values
    and you would get a sample of your XML data.
    This should work and you should not find any issues.
    regards
    Jorge

  • Date time field will not bind over into XML data file

    am using the Current Date field in a form that is supposed to give me the current date & time. In the Object, Value, I am using a "calculated - Read Only" , with Run-time property of Date and Time. WHen I view this as a PDF, the current datae & time display on the form as well as when I view the body pages, the {current date/time} is displayed in the actual field of the form. My only problem is I want to bind this so I can export the data to an XML data file, to import to an Access Database. WHen I use these settings, I do not have a "binding" tab to use. WHen I change vaule to "calculation script), it then pops up the binding tab and let's me export the field to the XML data file, but the data in that field is not comming over (the date & time). The field comes into the database inport, but is blank. What am I doing wrong..?? Thanks in advance for any suggestions...

    Well, I'm assuming that when you change it to a calculation script you see the date in the PDF and therefore have the script to set the value written properly. So, if you change the binding from None to Normal or an explicit binding the date will be exported in the data. If all of that is correct, then the most likely problem is the data format you are exporting is not a format that your database will accept.
    Chris
    Adobe Enterprise Developer Support

  • 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

  • XSL for a Pie chart with a very simple XML data file

    Hi All
    Using BI Pub Desktop 10.1.3.2.1 with Oracle Apps R12.1.3.
    I am trying to do a pie chart for the below data in an xml file. Normally this is pretty straight forward but with the below simple data structure I am a bit stuck, maybe thinking about it too much. Appreciate any help on what the xsl should like.
    xml file contains only the below. There is no other data in the file.
    <G2>
    <ITEM>ALL</ITEM>
    <AA>10</AA>
    <BB>20</BB>
    <CC>50</CC>
    <DD>30</DD>
    </G2>
    I want to be able to have a pie chart that shows the labels: AA, BB, CC and DD with the corresponding data values of 10,20,50 and 30.
    Thanks for viewing the question.
    Cheers Cel

    Please disregard. i went back to the original blog code and started over, and figured this out.

  • How to retrieve the xml data into datagrid in vb6.0 using dom method

    <?xml version="1.0" standalone="yes"?>
    <Student_Details>
      <Student>
        <Name>sandeep</Name>
        <Age>12</Age>
        <Mobile>123456789</Mobile>
      </Student>
      <Student>
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student>
        <Name>Sandeep Pr</Name>
        <Age>12</Age>
        <Mobile>9865231870</Mobile>
      </Student>
      <Student>
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student>
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>
      <Student>
        <Name>ololjk</Name>
        <Age>kjlokmo</Age>
        <Mobile>njonojniohuj</Mobile>
      </Student>

    this forum is for vb.net, for vb6 you could try
    http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
    http://forums.codeguru.com/forumdisplay.php?4-Visual-Basic-6-0-Programming
    PS. vb6 is ancient software you might want to consider a language from this century

  • DataGrid does not display XML data

    Hello, and thanks for reading this...
    I am having a problem displaying XMLList data in a DataGrid.
    The data is coming from a Tree control, which is receiving it
    from a database using HTTPService.
    The data is a list of "Job Orders" from a MySQL database,
    being formatted as XML by a PHP page.
    If it would be helpful to see the actual XML, a sample is
    here:
    http://www.anaheimwib.com/_login/get_all_orders_test2.php
    All is going well until I get to the DataGrid, which doesn't
    display the data, although I know it is there as I can see it in
    debug mode. I've checked the dataField property of the appropriate
    DataGrid column, and it appears correct.
    Following is a summary of the relevant code.
    ...An HTTPService named "get_all_job_orders" retrieves
    records from a MySQL database via PHP...
    ...Results are formatted as E4X:
    HTTPService resultFormat="e4x"
    ...An XMLListCollection's source property is set to the
    returned E4X XML results:
    ...The "order" node is what is being used as the top-level of
    the XML data.
    <mx:XMLListCollection id="jobOrdersReviewXMLList"
    source="{get_all_job_orders.lastResult.order}"/>
    ...The "jobOrdersReviewXMLList" collection is assigned to be
    the dataProvider property of a Tree list, using the @name syntax to
    display the nodes correctly, and a change event function is defined
    to add the records to a DataGrid on a separate Component for
    viewing the XML records:
    <mx:Tree dataProvider="{jobOrdersReviewXMLList}"
    labelField="@name"
    change="jobPosForm.addTreePositionsToDG(event)"/>
    ...Here is the relevant "jobPosForm" code (the Job Positions
    Form, a separate Component based on a Form) :
    ...A variable is declared:
    [Bindable]
    public var positionsArray:XMLList;
    ...The variable is initialized on CreationComplete event of
    the Form:
    positionsArray = new XMLList;
    ...The Tree's change event function is defined within the
    "jobPosForm" Component.
    ...Clicking on a Tree node fires the Change event.
    ...This passes an event object to the function.
    ...This event object contains the XML from the selected Tree
    node.
    ...The Tree node's XML data is passed into the positionsArray
    XMLList.
    ...This array is the dataProvider for the DataGrid, as you
    will see in the following block.
    public function addTreePositionsToDG(event:Event):void{
    this.positionsArray = selectedNode.positions.position;
    ...A datagrid has its dataProvider is bound to
    positionsArray.
    ...(I will only show one column defined here for brevity.)
    ...This column has its dataField property set to "POS_TITLE",
    a field in the returned XML record:
    <mx:DataGrid width="100%" variableRowHeight="true"
    height="75%" id="dgPositions"
    dataProvider="{positionsArray}" editable="false">
    <mx:columns>
    <mx:DataGridColumn width="25" headerText="Position Title"
    dataField="POS_TITLE"/>
    </mx:columns>
    </mx:DataGrid>
    In debug mode, I can examine the datagrid's dataProvider
    property, and see that the correct XML data from the Tree control
    is present. However, The datagrid does not display the data in any
    of its 6 columns.
    Does anyone have any advice?
    Thanks for your time.

    Hello again,
    I came up with a method of populating the DataGrid from the
    selected Item of a Tree Control which displays complex XML data and
    XML attributes. After the user clicks on a Tree branch, I call this
    function:
    public function addTreePositionsToDG(event:Event):void{
    //Retrieve all "position" nodes from tree.
    //Loop thru each Position.
    //Add Position data to the positionsArray Array Collection.
    //The DataGrid dataprovider is bound to this array, and will
    be updated.
    positionsArray = new ArrayCollection();
    var selectedNode:Object=event.target.selectedItem;//Contains
    entire branch.
    for each (var position:XML in
    selectedNode.positions.position){
    var posArray:Array = new Array();
    posArray.PK_POSITIONID = position.@PK_POSITIONID;
    posArray.FK_ORDERID = position.@FK_ORDERID;
    posArray.POS_TITLE = position.@POS_TITLE;
    posArray.NUM_YOUTH = position.@NUM_YOUTH;
    posArray.AGE_1617 = position.@AGE_1617;
    posArray.AGE_1821 = position.@AGE_1821;
    posArray.HOURS_WK = position.@HOURS_WK;
    posArray.WAGE_RANGE_FROM = position.@WAGE_RANGE_FROM;
    posArray.WAGE_RANGE_TO = position.@WAGE_RANGE_TO;
    posArray.JOB_DESCR = position.@JOB_DESCR;
    posArray.DES_SKILLS = position.@DES_SKILLS;
    positionsArray.addItem(posArray);
    So, I just had to manually go through the selected Tree node,
    copy each XML attribute into a simple Array, then ADD this Array to
    an ArrayCollection being used as the DataProvider for the DataGrid.
    It's not elegant, but it works and I don't have to use a Label
    Function, which was getting way too complicated. I still think that
    Flex should have an easier way of doing this. There probably is an
    easier way, but the Flex documentation doesn't provide an easy path
    to it.
    I want to thank you, Tracy, for the all the help. I checked
    out the examples you have at www.cflex.net and they are very
    helpful. I bookmarked the site and will be using it as a resource
    from now on.

  • Complex xml with multiple namespaces giving LPX-00601: Invalid token error

    Hi
    Apologies if this is a really simple question.
    I have not worked with xml before and I'm drowning in different ways to do the extract.
    I have a very complex xml, sample below, which I'm trying to do one siple extract to get myself going.
    I have the data in a table in an xmltype column,
    I am trying to extract containernumber first and get the error.
    select xml_column, extract(xml_column,'/env:Envelope/env:Body/ns0:QueryCntrNumberResponse/ns0:QueryResContainerDetail/ns1:ContainerNumber/ns2:ContainerNumber')
    from test_xml;
    Not sure if I should use the namespaces and have tried without but results are always NULL
    I would really appreciate any pointers around these ultiple namespaces.
    Thanks
    Nicki
    XML Sample
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:ns0="http://com.cargosmart.cargotracking.webservice.cntr.dto"
                  xmlns:ns1="http://com.cargosmart.cargotracking.webservice.common.dto"
                  xmlns:ns2="http://com.cargosmart.cargotracking.webservice.basic.dto"
                  xmlns:ns3="http://com.cargosmart.cargotracking.webservice.bl.dto"
                  xmlns:ns4="http://com.cargosmart.cargotracking.webservice.bkg.dto">
      <env:Body>
        <ns0:QueryByCntrNumberResponse>
          <ns0:QueryRes ult="">
            <ns0:QueryCriteria>
              <ns1:CarrierSCACCode>APLU</ns1:CarrierSCACCode>
              <ns1:ContainerNumber>APZU344693-1</ns1:ContainerNumber>
            </ns0:QueryCriteria>
            <ns0:ContainerDetail>
              <ns1:ContainerNumber>
                <ns2:ContainerNumber>APZU344693</ns2:ContainerNumber>
                <ns2:ContainerCheckDigit>1</ns2:ContainerCheckDigit>
                <ns2:GrossWeight>
                  <ns2:Weight>20260.8</ns2:Weight>
                  <ns2:WeightUnit>KGS</ns2:WeightUnit>
                </ns2:GrossWeight>
              </ns1:ContainerNumber>
    NOT THE FULL COLUMN

    Could I just ask you one more question.
    I had already expanded the query to include the repeating sections using xmlsequence.
    Has that been replaced too?
                select extractvalue(xml_column,'/env:Envelope/env:Body/ns0:QueryByCntrNumberResponse/ns0:QueryResult/ns0:ContainerDetail/ns1:ContainerNumber/ns2:ContainerNumber',
                  'xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
                  xmlns:ns0="http://com.cargosmart.cargotracking.webservice.cntr.dto"
                  xmlns:ns1="http://com.cargosmart.cargotracking.webservice.common.dto"
                  xmlns:ns2="http://com.cargosmart.cargotracking.webservice.basic.dto"
                  xmlns:ns3="http://com.cargosmart.cargotracking.webservice.bl.dto"
                  xmlns:ns4="http://com.cargosmart.cargotracking.webservice.bkg.dto"') col1,
                  extractvalue(value(t2),'/ns1:Event/ns1:EventDescription', 'xmlns:ns1="http://com.cargosmart.cargotracking.webservice.common.dto"') Event_Description,
                  extractvalue(value(t2),'/ns1:Event/ns1:EventDT/ns2:LocDT', 'xmlns:ns1="http://com.cargosmart.cargotracking.webservice.common.dto" xmlns:ns2="http://com.cargosmart.cargotracking.webservice.basic.dto"') Event_DT,
                  extractvalue(value(t2),'/ns1:Event/ns1:Location/ns2:LocationName', 'xmlns:ns1="http://com.cargosmart.cargotracking.webservice.common.dto" xmlns:ns2="http://com.cargosmart.cargotracking.webservice.basic.dto"') location
    from test_xml t1,
    table(xmlsequence(extract(t1.xml_column,'/env:Envelope/env:Body/ns0:QueryByCntrNumberResponse/ns0:QueryResult/ns0:ContainerDetail/ns1:Event','xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
                  xmlns:ns0="http://com.cargosmart.cargotracking.webservice.cntr.dto"
                  xmlns:ns1="http://com.cargosmart.cargotracking.webservice.common.dto"
                  xmlns:ns2="http://com.cargosmart.cargotracking.webservice.basic.dto"
                  xmlns:ns3="http://com.cargosmart.cargotracking.webservice.bl.dto"
                  xmlns:ns4="http://com.cargosmart.cargotracking.webservice.bkg.dto"'))) t2;

  • Inserting large xml data into xmltype

    Hi all,
    In my project I need to insert very large XML data into xmltype column.
    My table:
    CREATE TABLE TransDetailstblCLOB ( id number, data_xml XMLType) XmlType data_xml STORE AS CLOB;
    I am using JDBC approach to insert values. It works fine for data less than 4000 bytes when using preparedStatement.setString(1, xmlData). As I have to insert large Xml data >4000 bytes I am now using preparedStatement.setClob() methods.
    My code works fine for table which has column declared as CLOB expicitly. But for TransDetailstblCLOB where the column is declared as XMLTYPE and storage option as CLOB I am getting the error : "ORA-01461: can bind a LONG value only for insert into a LONG column".
    This error means that there is a mismatch between my setClob() and column. which means am I not storing in CLOB column.
    I read in Oracle site that
    When you create an XMLType column without any XML schema specification, a hidden CLOB column is automatically created to store the XML data. The XMLType column itself becomes a virtual column over this hidden CLOB column. It is not possible to directly access the CLOB column; however, you can set the storage characteristics for the column using the XMLType storage clause."
    I dont understand its stated here that it is a hidden CLOB column then why not I use setClob()? It worked fine for pure CLOB column (another table) then Why is it giving such error for XMLTYPE table?
    I am struck up with this since 3 days. Can anyone help me please?
    My code snippet:
    query = "INSERT INTO po_xml_tab VALUES (?,XMLType(?)) ";
              //query = "INSERT INTO test VALUES (?,?) ";
         // Get the statement Object
         pstmt =(OraclePreparedStatement) conn.prepareStatement(query);
         // pstmt = conn.prepareStatement(query);
         //xmlData="test";
    //      If the temporary CLOB has not yet been created, create new
         temporaryClob = oracle.sql.CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
         // Open the temporary CLOB in readwrite mode to enable writing
         temporaryClob.open(CLOB.MODE_READWRITE);
         log.debug("tempClob opened"+"size bef writing data"+"length "+temporaryClob.getLength()+
                   "buffer size "+temporaryClob.getBufferSize()+"chunk size "+temporaryClob.getChunkSize());
         OutputStream out = temporaryClob.getAsciiOutputStream();
         InputStream in = new StringBufferInputStream(xmlData);
    int length = -1;
    int wrote = 0;
    int chunkSize = temporaryClob.getChunkSize();
    chunkSize=xmlData.length();
    byte[] buf = new byte[chunkSize];
    while ((length = in.read(buf)) != -1) {
    out.write(buf, 0, length);
    wrote += length;
    temporaryClob.setBytes(buf);
    log.debug("Wrote lenght"+wrote);
         // Bind this CLOB with the prepared Statement
         pstmt.setInt(1,100);
         pstmt.setStringForClob(2, xmlData);
         int i =pstmt.executeUpdate();
         if (i == 1) {
         log.debug("Record Successfully inserted!");
         }

    try this, in adodb works:
    declare poXML CLOB;
    BEGIN
    poXML := '<OIDS><OID>large text</OID></OIDS>';
    UPDATE a_po_xml_tab set podoc=XMLType(poXML) WHERE poid = 102;
    END;

  • XML Data Load into releational structures

    Hi,
    I am very unexperienced in using XML and have the problem
    to import very large XML data files into existing reletional structures.
    In our production DB we don't use the java engine, so
    that PL/SQL an the SQL Loader are the only available ways to import the data.
    At the moment we get flat files and use the SQL Loader utility. But an interface to a new system send XML data now and I have to fill the same old releational structure with the new data.
    Can anybody give me a hint about the best technic for an high performance import. Are there any existing tools for the relational mapping?
    Regards Ralph

    Thank you for your reply.
    You are right. We only want to break the XML to fill our relational structures. We don't need the XML data further on. But we have to load the data in temporary structures, because we have to transform the data in our own format. (The system which delivers the XML data is external and uses another data model)
    Is there no more elegant way with use of databse built in technics? The XML data we get can be validated against a XML schema.
    So I thought, it could be a way to load the XML in the XDB and register the schema in the database. After that store the XML data in the default generated object relational structures and then programm the data transformation and the data flow between these default structures to our target data structures with PL/SQL.
    I don't know if this way is performant enough.
    If I use an external tool i have to code the relational mapping outside the database and insert the data with use of ODBC in temporary structures which i have to create manualy.
    So I hoped to find a way to load the data in any relational structure using the advantages of XML and XML schema and code the neccasary logic inside the DB.
    Do you have any further hints for my problem?
    Regards Ralph

  • Read/get xml data (string)

    Hi
    I have a XML string that I get from a TCP transfer, I have attached a received string.
    I have no experience in reading XML data, I have tried looking in the forums and some of the examples in LV, but I cannot get it to work, so I hope that someone could help me out. All I need to get from the XML data are the names e.g. Station1 and Station2 perhaps putted into a string array. If so it wouldn't hurt to get all the rest parameters and attributes as well. I thought about doing some string searches to get what I need, but thought again that it might be easier/better in some way to take advantage of the data being arranged as XML.
    Hope that someone can help.
    Thanks in advance
    Best regards
    Simon
    LabVIEW 8.6 / 2009 / 2010
    Vision Development Module 8.6 / 2009 / 2010
    VBAI 3.6 / 2010
    Attachments:
    testmap.txt ‏1 KB

    Hi all
    falkpl wrote:
    The easy way is if you know that this string is not changing much you treat it as a formated string and parse it using simple string functuions
    ie first parse %s and %s The two slashes will cancle the escape clause of the string parser.  Repete this process to get each station and attributes.
    The harder way is to use an activeX or .net XML parser.
    Paul
    I am not sure what you mean about the parser, well I get the concept, but is there a specific string function that can do that for me?
    I got something working with the Match Pattern vi, please the attached. This actually works for my current needs, but I still would be able to get data from more complex XML data.
    Hi A.K. and J.K.
    Thank you for the link.
    EasyXML looks like a nice and handy tool for handling XML data. I ran in too some problems though when running the VI Package Manger. When I check the network for new packages it says that there was an error, please check the network connection or settings. I have internet connection (I am writing this post ) and I am not using a proxy server. What could be wrong and how do I install EasyXML then, is there another way?
    Best regards
    Simon
    LabVIEW 8.6 / 2009 / 2010
    Vision Development Module 8.6 / 2009 / 2010
    VBAI 3.6 / 2010
    Attachments:
    my_get_xml_data.vi ‏15 KB

  • Binding Datagrid XML Data

    Hi,
    Summary: I cannot get my DataGrid binding with XML data.
    Specifically, I cannot bind a DataGridColumn with a child of a
    child using the dataField property. However, I can bind with a
    direct child.
    I'm currently building an application where I retrieve data
    from a XML database and contact it through posting a XQuery to the
    database. I set the resultFormat of my HTTPServer to "e4x".
    quote:
    <mx:HTTPService id="searchRequest" url="
    http://localhost:8080/exist/rest/db/"
    contentType="application/xml" useProxy="false"
    method="POST" resultFormat="e4x" />
    I receive this data:
    quote:
    <exist:result exist:hits="1" exist:start="1"
    exist:count="1" xmlns:exist="
    http://exist.sourceforge.net/NS/exist">
    <schedule>
    <tournament>
    <sport>Testing Our DTD</sport>
    <tname>Well-formed Document</tname>
    <match>
    <mdate>Oct. 12, 2007</mdate>
    <competitor>
    <cname>sd</cname>
    <score>2</score>
    </competitor>
    <competitor>
    <cname>sdgs</cname>
    <score>3</score>
    </competitor>
    <location>
    <city>San Luis Obispo</city>
    <state>CA</state>
    <country>USA</country>
    <stadium>Test Stadium, OPTIONAL</stadium>
    </location>
    <tv>SVN</tv>
    <description>Basic testing...</description>
    </match>
    </tournament>
    </schedule>
    </exist:result>
    I receive the data fine however, I cannot nested
    elements of the XML nodes I retrieve. Here is my data grid.
    quote:
    <mx:DataGrid id="grid" width="446" height="100%"
    dataProvider="{searchRequest.lastResult.schedule.tournament.match}"
    enabled="true">
    <mx:columns>
    <mx:DataGridColumn headerText="Tournament" />
    <mx:DataGridColumn headerText="Match Date"
    dataField="mdate" />
    <mx:DataGridColumn headerText="Sport" />
    <mx:DataGridColumn headerText="City"
    dataField="location.city"/>
    <mx:DataGridColumn headerText="State"
    dataField="location.state"/>
    </mx:columns>
    </mx:DataGrid>
    The 'mdate' shows up however, 'location.city'
    and 'location.state' do not. I am not sure how the dataField works.
    Does it get the 'current' node and allow me to drill down in the
    XML node?
    I will note that I can get it working with a labelFunction
    and an ItemRenderer. I feel that using either of those methods for
    this is a bit verbose.

    The default DGColumn picks up the property value by doing
    data[dataField]. Due to this the nested value would not be picked
    up.
    By extending DGColumn and overriding the itemToLabel function
    it is possible to get the desired functionality by adding code to
    detect "field1.field2" kind of dataField value and returning the
    nested value.
    This custom DGColumn can be used whererever the functionality
    is desired.

  • Binding ADF UI to a complex XML Type – Development Productivity, State Mgmt

    Binding ADF UI to a complex Web Service – Development Productivity, Managing State, Etc.
    For those scenarios when ADF UI has to be bound to a complex XML type, it seems that the direction taken by the ADF development team was to generate data-controls that map to complex XML types.
    The major problem with this approach is the fact that application server does not manage state. For example, If application has to submit a purchase order to a web service then application server has to manage the shopping card state until its ready to be submitted.
    In some previous forum threads it had been suggested that using generated data-controls is a “quick and dirty” solution for accessing web services and that a proper solution is to use generated Java Proxy Interface.
    That implies many manually constructed entity objects, associations and overridden doDML methods, which is far less productive compared to entity objects generated from a database schema.
    Suggestion and a Question for the ADF development team
    From the logical model standpoint, there is no difference in between the XML schema and DB schema. Therefore, it is possible to generate entity objects and associations for XML Types of XML schema the same way it’s done for tables of Database schema. The only difference is serialization of CRUD operations on entity objects.
    One way to handle this is:
    -     Generate Application Module for a complex XML type. This application module should have methods for marshaling to/from corresponding XML type.
    -     Generate entity object for each subtype within the complex XML type. In case of nested subtypes, generate association to a parent type.
    -     Generate data control with actions that are bound to web service operations and code that serializes request message from corresponding AM and de-serializes response message to corresponding AM.
    This way, ADF would offer the same productivity for the SOA development as one its currently offering for the ORM development.
    Until the time when something like this is available, what would be the best approach for binding ADF UI to web services?
    Feedback is greatly appreciated.
    Boro Petrovic
    Edited by: wds12518 on Jan 25, 2010 11:49 AM

    We have similar issues as our big portion of the UI is based on WS. We found that there is no easy way to map entity object structure to complex XML type (one EO can based on one flat type or domain can't be bound to UI directly). Oracle PMs, is there any better solution or future plans to address this issue?

  • Using a datagrid to display XML data

    Hello,
    I'm binding xml to a datagrid but I'm having trouble displaying some of the data.  Here's my example.
    Here's my test data:
    [Bindable]
    private var test:XML =
      <vm:validationMessages xsi:schemaLocation="http://www.location.com/2.0 http://schemas.com/2.0.0/valMessages.xsd" severity="ERROR" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vm="http://www.location.com/2.0" xmlns:zucc="http://www.location.com/results/1.0">
      <vm:validationMessage severity="ERROR" errorCode="ErrorType1" url="www.loc.com">
        <vm:messageDetail>Text I want to return</vm:messageDetail>
      </vm:validationMessage>
    </vm:validationMessages>
    I've set the default namespace here:
    public static const vm:Namespace = new Namespace("http://www.location.com/2.0");
    default xml namespace = vm;
    And here is the datagrid definition:
    <mx:DataGrid x="10" y="30" width="738.5" height="189" id="dgValidation" dataProvider="{test.validationMessage}">
      <mx:columns>
        <mx:DataGridColumn headerText="Severity" dataField="@severity"/>
        <mx:DataGridColumn headerText="Error Code" dataField="@errorCode"/>
        <mx:DataGridColumn headerText="Url" dataField="@url"/>
        <mx:DataGridColumn headerText="Description" dataField="messageDetail"/>
      </mx:columns>
    </mx:DataGrid>
    The attributes "severity, errorCode, url" are being displayed correctly, however "messageDetail" will not display.  I've tried several different ways of calling it with no luck. Is there a way to do this?
    Thanks.

    To solve this problem I had to use labelFunction.  The working line was this:
    <mx:DataGridColumn headerText="Description" labelFunction="dataGrid_labelFunc"  dataField="messageDetail"/>
    The function looks like this:
    private function dataGrid_labelFunc(item:XML, col:DataGridColumn):String {
         var qN:QName = new QName(vm, col.dataField);
         return item[qN].text();

  • Loading xml data into the datagrid

    Hi all,
    I'm trying to learn Flex. I have a small doubt in loading the datagrid from the xml response (from php script)
    mxml code:
    <mx:DataGrid id="dataGrid" x="69" y="250">
    <mx:columns>
    <mx:DataGridColumn headerText="Name" dataField="name"/>
    <mx:DataGridColumn headerText="Age" dataField="age"/>
    <mx:DataGridColumn headerText="Location" dataField="location"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:HTTPService resultFormat="e4x" result="getDataCallback(event)" id="getDataHttp" url="http://localhost/test/getData.php" method="POST"></mx:HTTPService>
    <mx:Button click="getDataHttp.send();" label="Load Data" x="379" y="268"></mx:Button>
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    import mx.controls.Alert;
    [Bindable] public var mydata:XMLList = new XMLList();
    function getDataCallback(event:ResultEvent):void{
    trace(event.result.data.info);
    mydata = event.result.data.info;
    dataGrid.dataProvider = mydata;
    ]]>
    </mx:Script>
    PHP Script
    <?php
    $xml = "<?xml version=\"1.0\" ?><data>";
    $xml .= "<info><name>name1</name><age>26</age><location>location1</location></info>";
    $xml .= "<info><name>name2</name><age>27</age><location>location2</location></info>";
    $xml .= "</data>";
    header("content-type:text/xml");
    echo $xml;
    But the data is not being loaded into the datagrid. Please anyone help me out ..
    Thanks in advance
    -Pavan

    ... and I doubt you are using the word "doubt" in its correct sense.

Maybe you are looking for

  • Is there any way to keep the old mail, phone, calendar format and yet switch to IOS7?

    Is there anyway to keep our old mail, calendar, and phone format and yet use IOS7?  I find the new system so plain that it is difficult to see.  I keep missing new emails because the little numbers are so small they barely show up and the plain white

  • IPhoto needs to be upgraded everytime I open it.  Then it finds consistences. I have rebuilt the database many times

    iPhoto needs to be upgraded everytime I open it.  Then it finds consistences. Then it repairs the database.  I have also rebuilt the database many times useing command + alt.  Now it shows every event three times.  If I delete one version of that eve

  • Official Unlock from ATT Problems

    I have iPhone 4 and have received permission from ATT for unlock. They told me just to restore my phone from iTunes and I would get a message stating phone is unlocked. I have restored 2 or 3 times and have received no such message. Anybody had any e

  • Elements as actions.

    Hey again! Once again after a long while I can't seem to figure this out. Please look at the picture below. http://oi59.tinypic.com/51rhxh.jpg So I'm using the "red-zone" as a separate element, the purpose of it is to trigger a action (mouseover). Th

  • Family Share for less minutes

    Is there a solution that meets my needs.   User 1 needs data and talk about 50 minutes User 2 needs talk for 200 minutes. Prepaid would work great for user 1, but no data. Prepaid could work for user 2, but would not save any money over the family sh