Need to chart attribute value of just one child node of XML document

I have a XML document with (for example) 7 parent nodes, each
parent node has 5 child nodes. The parent nodes have an attribute
@EarlierDTS (DateTime type) that is the x-axis category of a chart.
Each child node has an attribute @eventid which specifies the id of
the event, and another atttribute @NumOccurs which specifies how
many times that event occured in that period.
How do I tell Flex I want a simple line chart of the eventID
= 215? What if I want two lines, for both eventID=215 and
eventid=307?
I have studied the posts and blogs for over a week now, and
have seen this question or similar come up quite a few places, with
no answer.
1) Should I focus on learning how to create a filterfunction
for the XMLList that underlies my XMLListCollection so that the
filtered data view is just one child node per parent node ( or two
child nodes for the second case)? And set the filtered data view as
the dataprovider of my chart's vertical series?
2) Should I focus on learning how to create a XML Filter
query that selects just one or two child nodes for each parent
node, and set the charts' series' dataprovider to this filter
expression? (I don't think this is allowed - but I'm checking with
the forum members...)
3) Should I focus on learning how to convert the
XMLListCollection into a HierarchicalData object, and then learning
how to filter this object so there is only one (or two) childs per
parent? This seems like a lot of coding - I almost have to create a
pair of classes - one for the parent and one for the child - so I
can create nested ArrayObjects.
4) Should I create a brand new XMLList by walking the
original XML list, and inserting Parent nodes and just the child
nodes that match the eventID(s) I want to chart, into the new
XMLList?
I believe that the easiest way would be to create a
Filterfunction for the XMLList, and bind the chart series to the
(filtered) XML List. But the problem with this approach is that I
have seen more than 2 posts asking how to accomplish filtering that
removes specific children from the view, with no solutions posted.
Help! What is the best way to get just one child for each
parent, from an XMLList?

"whertzing" <[email protected]> wrote in
message
news:[email protected]...
>I have a XML document with (for example) 7 parent nodes,
each parent node
>has 5
> child nodes. The parent nodes have an attribute
@EarlierDTS (DateTime
> type)
> that is the x-axis category of a chart. Each child node
has an attribute
> @eventid which specifies the id of the event, and
another atttribute
> @NumOccurs
> which specifies how many times that event occured in
that period.
>
> How do I tell Flex I want a simple line chart of the
eventID = 215? What
> if I
> want two lines, for both eventID=215 and eventid=307?
>
> I have studied the posts and blogs for over a week now,
and have seen this
> question or similar come up quite a few places, with no
answer.
>
> 1) Should I focus on learning how to create a
filterfunction for the
> XMLList
> that underlies my XMLListCollection so that the filtered
data view is just
> one
> child node per parent node ( or two child nodes for the
second case)? And
> set
> the filtered data view as the dataprovider of my chart's
vertical series?
>
> 2) Should I focus on learning how to create a XML Filter
query that
> selects
> just one or two child nodes for each parent node, and
set the charts'
> series'
> dataprovider to this filter expression? (I don't think
this is allowed -
> but
> I'm checking with the forum members...)
>
> 3) Should I focus on learning how to convert the
XMLListCollection into a
> HierarchicalData object, and then learning how to filter
this object so
> there
> is only one (or two) childs per parent? This seems like
a lot of coding -
> I
> almost have to create a pair of classes - one for the
parent and one for
> the
> child - so I can create nested ArrayObjects.
>
> 4) Should I create a brand new XMLList by walking the
original XML list,
> and
> inserting Parent nodes and just the child nodes that
match the eventID(s)
> I
> want to chart, into the new XMLList?
>
> I believe that the easiest way would be to create a
Filterfunction for the
> XMLList, and bind the chart series to the (filtered) XML
List. But the
> problem
> with this approach is that I have seen more than 2 posts
asking how to
> accomplish filtering that removes specific children from
the view, with no
> solutions posted.
>
> Help! What is the best way to get just one child for
each parent, from an
> XMLList?
I'd just look at a dataFunction. There's an example here that
may point you
in the right direction:
http://flexdiary.blogspot.com/2008/08/charting-example.html
HTH;
Amy

Similar Messages

  • Percentage pie chart whose query return just one value

    Hi,
    I have a requirement which is to display a pie chart that shows the relative percentage of based on a particular row's values.
    Here the SQL query return just one value to generate the chart, however Apex is creating its own seemingly random value to draw the rest of the chart and dividing the region.
    Is there any way for Apex to take the single value that the query returns as a percentage and generate the chart by calculating the other value to be as (100 - queried value) and split the region in the chart accordingly.
    Of course one method is to store both the value that the query returns as well as 100 - that value in a table and then write the query in the chart that references both these values.. but I'd like to know if there is a way to go about it without storing this extra bit of information in a table
    Thanks!

    you create a hidden page item and populate with total value and percentile calculated value and use it in dial chart as querry.

  • Need to show attributes value in the F4 help

    Hello All
       I am Having 0customer has a main characteristics and its attributes is 0city. In the selection screen of the report for 0customer i am able to view all the customer name. but as per the user requirement i need to display 0customer with city name so the user will select exact customer in the particular city.
    Please tell me how to add 0city attributes value in the F4 help of 0customer.

    Hi Kamal,
    Refer to Search help /BI0/OCUSTOMER , 0Customer uses it internally.
    SE11 -> Select Search Help -> /BI0/OCUSTOMER -> Change .
    Here you can delete / add more fields as per requirement .
    Hope it helps.
    Regards
    Mr Kapadia

  • Can I just setup my pages for just one page not the whole document?

    I want to change my page to landscape but just one page not all document how can I do it.
    thank you

    May you take time to search for the keyword 'landscape' in the existing threads ?
    This question was asked and responded many times.
    Yvan KOENIG (VALLAURIS, France) dimanche 20 juin 2010 20:39:31

  • Need hierarchical chart that support multi-parent multi-child for each node

    I'm looking for a charting solution to display the parent-child relationships between jobs in our job schedule. A given job may have 0 or more parent jobs and may have 0 or more child jobs. Similar to org chart but allowing child node(s) to link to more than 1 parent node. Any ideas...?

    Correct; our job scheduler is InControl and I can pull the schedule data from there into our database for reporting. Ultimately my goal is to get the data from InControl into our database for reporting/visualization, and build an Apex application that will allow us to make changes to the schedule (add/remove/modify jobs and their dependencies) and then generate a report to serve as the job documentation for our team and for the schedulers to make the corresponding changes in InControl, and so the data center operators have up-to-date information for overnight support in the event of job failures. It's just that visualization piece that seems elusive, the rest is just writing queries designing the app, writing the report, etc.

  • Again and Again. Set Value to node of XML document

    I've read many topics about how to set value in XML, but nothing works. Please, help
    My xml file:
    <TempEditData>
         <parameter userId="testUserId">
              <connectUrl>http://cognoslink</connectUrl>
              <connectUser>cognosTestUser</connectUser>
              <connectPwd>cognosPassword</connectPwd>
              <connectNamespace>cognosNamespace</connectNamespace>
              <reportStorePath>reportStorePath</reportStorePath>
              <reportUrlPath>reportUrlPath</reportUrlPath>
              <reportLifeLength>reportLifeLength</reportLifeLength>
         </parameter>
    </TempEditData>My code:
    private static void storeChartDataBeanParameters( String inputUserId) throws Exception{
              boolean isUserIdInFile = false;
              //create object
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse (new File("src/tempCognosEditData.xml"));
            //normalize
            doc.getDocumentElement().normalize ();
            //get all Nodes
            NodeList listOfParameters = doc.getElementsByTagName("parameter");
            for(int i=0; i< listOfParameters.getLength(); i++){
                 Node firstParameterNode = listOfParameters.item(i);
                 //if first element is NODE
                if(firstParameterNode.getNodeType() == Node.ELEMENT_NODE){
                    Element firstParameterElement = (Element)firstParameterNode;
                    String userId = firstParameterElement.getAttribute("userId");
                    //if !inputUserId
                    if(!inputUserId.equals(userId)){
                         continue;
                    //if userId was found in file
                    else{
                         isUserIdInFile = true;
                         System.out.println("((Element)firstParameterElement).getElementsByTagName('connectUrl').item(0).getNodeName = " + ((Element)firstParameterElement).getElementsByTagName("connectUrl").item(0).getNodeName());
                         System.out.println("((Element)firstParameterElement).getElementsByTagName('connectUrl').item(0).getNodeValue = " + ((Element)firstParameterElement).getElementsByTagName("connectUrl").item(0).getNodeValue());
                         ((Element)firstParameterElement).getElementsByTagName("connectUrl").item(0).appendChild(doc.createTextNode("dzfgsdfgsdgf"));
                         /*NodeList insideList = firstParameterElement.getElementsByTagName("connectUrl");
                         Element element = (Element)insideList.item(0);
                         System.out.println ( "element.getNodeName() = " + element.getNodeName() );
                         element.setNodeValue("new TT");
                         System.out.println ("element.getNodeValue() = " + element.getNodeValue() );
                         //element.appendChild(doc.createTextNode("rrr"));
                         NodeList nl = element.getChildNodes();
                         System.out.println ("nl.item(0).getFirstChild().getNodeValue() = " + nl.item(0).getFirstChild().getNodeValue());
                         nl.item(0).getFirstChild().appendChild(doc.createTextNode("rrr"));*/
                                    break;
                }//if ELEMENT_NODE
            }//for go through all nodes
         }Edited by: Holod on 03.03.2008 8:58

    So, the solution is pretty easy:
    storeChartDataBeanParameters( String inputUserId) searches for nodes named "+parameter+" in xml file with attribute "+userDd+".
    If method parameter equals to xml data, I perform some operations and save new data.
    The only thing, that saveFile(Document doc) must be syncronized.
    Two users can't write to fie at the same time.
    [This link|http://www.aviransplace.com/2005/03/20/working-with-xml-files-in-java-using-dom/5/] helped me alot.
    Also Dr. Clap posts in different topics brought evidence to my mind.
    private static void storeChartDataBeanParameters( String inputUserId) throws Exception{
              //create object
              boolean isUserIdWasFound = false;
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse (new File("src/tempCognosEditData.xml"));
            //normalize
            doc.getDocumentElement().normalize ();
            //get all Nodes
            NodeList listOfParameters = doc.getElementsByTagName("parameter");
            for(int i=0; i< listOfParameters.getLength(); i++){
                 Node firstParameterNode = listOfParameters.item(i);
                 //if first element is NODE
                if(firstParameterNode.getNodeType() == Node.ELEMENT_NODE){
                    Element firstParameterElement = (Element)firstParameterNode;
                    String userId = firstParameterElement.getAttribute("userId");
                    //if !inputUserId
                    if(!inputUserId.equals(userId)){
                         continue;
                    //if userId was found in file
                    else{
                         isUserIdWasFound = true;
                         NodeList parameterNode = firstParameterElement.getElementsByTagName("connectUrl");
                         Element connectUrlElement = (Element)parameterNode.item(0);
                         System.out.println("connectUrlElement name = " + connectUrlElement.getNodeName());
                         System.out.println("connectUrlElement value = " + connectUrlElement.getNodeValue());
                         System.out.println("((Node)connectUrlElement) value = "+((Node)connectUrlElement).getNodeValue());
                         ((Node)connectUrlElement.getFirstChild()).setNodeValue("normalized");
                         saveFile(doc);
                         break;
                }//if ELEMENT_NODE
            }//for go through all nodes
         public static void main(String[] args) throws Exception{
              storeChartDataBeanParameters("testUserId");
         public static void saveFile(Document doc) throws Exception{
              Transformer transformer;
              transformer = TransformerFactory.newInstance().newTransformer();
              transformer.transform(new DOMSource(doc), new StreamResult(new File("src/tempCognosEditData.xml")));
         }Edited by: Holod on 03.03.2008 15:52

  • To read xsl values of subsequent nodes in xml document

    Hi,
    I have a xml document which looks something like this
    <report>
    <prelist>
    <row>
    <field name="learning" value="Internet basics"/>
    </row>
    <row>
    <field name="learning" value="General Knowlege"/>
    </row>
    </prelist>
    <list>
    <row>
    <field name="learning" value="Internet basics"/>
    <field name="tool" value="xml"/>
    </row>
    <row>
    <field name="learning" value="Internet basics"/>
    <field name="tool" value="xmlxsl"/>
    </row>
    <row>
    <field name="learning" value="General Knowledge"/>
    <field name="tool" value="xmltool"/>
    </row>
    </list>
    </report>
    What i would like to do is
    I read the prelist structure and retrieve the value of "learning"
    For each value i retrieve i would like to read the list structure for similar values
    e .g in first iteration i get the value = "Internet Basics" from prelist node then from list node i would like tool node with value = "xml" and value="xmlxsl"
    Please let me know if this is possible and nay help would be appreciated..
    Thanks.

    I don't see how you go from the prelist to the list but I guess that doesn't matter.
    You can load the XML into a DOM document then use the Document method:
    getElementsByTagName
    public NodeList getElementsByTagName(String tagname)
    Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
    Parameters:
    tagname - The name of the tag to match on. The special value "*" matches all tags. Returns:
    A new NodeList object containing all the matched Elements.

  • Parsing the return value from a http request into a xml document?

    suppose a url "http;//abc.com/index.asp" that return a string like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <bbsend>
    <title>xml testing</title>
    - <record>
    <sender>111111</sender>
    <date>2004-01-05 04:11:44</date>
    <message>yes!</message>
    </record>
    - <record>
    <sender>22222222</sender>
    <date>2004-01-14 01:06:31</date>
    <message>A</message>
    </record>
    </bbsend>
    how can i parsing this return value into a xml document???
    i try something like this:
    URL url = new URL("http://abc.com/index.asp");
    HttpURLConnection http = (HttpURLConnection)url.openConnection();
    DataInputStream in = new DataInputStream(http.getInputStream());               
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(in);
    System.out.println(document.getNodeValue());
    But fail , can anyone help

    do u mean get the xml content??
    i am doing a project with BBSend
    [email protected]

  • Invoking BPEL partnerlink each for one child node

    Hi
    I have a requirement for invoking partnerlink (DB Adapter) for each child node of input message of BPEL service! E.g. I have to update or insert an employee! I received list of of employees in input message like below.
    <employee_list>
         <employee>
              <name> Ram </name>
              <Age> 21 </Age>
              <dept> IT </dept>
              <isNew>N</isNew>
         </employee>
         <employee>
              <name> Hari </name>
              <Age> 21 </Age>
              <dept> IT </dept>
              <isNew>Y</isNew>
         </employee>
    </employee_list>
    So the requirement is to call DB_Call partnerlink for each employee node in above!
    Is this possible in BPEL? If yes, how?
    Thanks In Advance
    Priyadarshi

    Yes you can, use a fo reach loop in bpel, loop for the count of employee, then have an if condition to check whether you want to update or insert for and use invoke node to call the appropriate operation.I hope you have gone through the upsert operation in database adpater which automatically supports insert or update. If a record is present it updates else inserts a new one.

  • Change a attribute value with XSLT before importing an XML

    I need change the attribute value with XSLT before importing an XML
    <table class="x" style="width="50pt">...
    I have to divide by 200 the value of "width", and the result multiplied by 100:
    (50/200) * 100
    It's possible with a XLST?

    Hi,
    Yes you can do this via XSLT.
    You can try similar to the one below:
    <table>
       <xsl:attribute name="width">
         <xsl:value-of select="((./width) div 200)*(100)" />
       </xsl:attribute>
    </table>
    I have not tested yet... Try it....
    Green4ever
    (I am back after long time)....

  • How can I transfer JUST ONE IWeb site to another computer?

    I am new to making IWeb sites and am now making them for
    other people. I have about 10 sites in my IWeb folder and need to
    be able to give a person's site to them.
    I need to be able to transfer JUST ONE site to another computer.
    Right now, I am only able to transfer ALL the sites I have made to
    another mac and then, it wipes out all their sites! How can I prevent
    the ultimate wipe out of all their iweb sites yet give them JUST ONE
    of mine?
    thank you in advance,
    Beth http://www.yourzensite.com

    First, read Wyodor's post about changing the publishing settings HERE.
    You can create the extra folders in Home Folder/Library/Application Support/iWeb or, as I do, in a folder named iWeb in the Home folder.
    Create a folder for each website, give it a suitable name and paste the Domain.sites2 file with all the websites into each.
    Open each one in turn, double click the Domain.sites2 file to launch it in iWeb, delete all the sites except the one whose name is the same as the folder name, save and quit.
    Now you can launch any site individually in iWeb and sent a copy of the appropriate folder to the client.

  • How to store multiple values associated to one key

    hello all
    In my program I need to store "multiple values associated to one key".
    for example : key would be ="T"
                             Values are    = 2,4,5,1,2Plz tell me which data structure I can use for this purpose.
    I have tried Hashtable for it, unfortunately it does not support duplicate keys in one Hashtable.
    Thanx.
    Rakesh

    The easiest thing to do, is store another data structure as your value for a
    particular key. So "T" being your your key, you would associate the value
    to be an int[] (if you know the number of sub values) or create a new Vector
    for each key, then you don't have to worry about the number of values at
    compile time. All the while still using the Hashtable for constant time
    look up. So like this:
    public void storeMultValues(int[] arr)
      Vector v = new Vector();
      v.add(new Integer(1));
      v.add(new Integer(2));
      v.add(new Integer(3));
      this.hashtable.put("T", v);
    }See if you can work with that.
    -Cludge

  • Attributes value in Organizational Model

    HI,
    Iu2019ve created a new attribute for a org unit in scenario service. Itu2019s attribute REGIOGROUP based on values of this field of table ADRC.
    Now, I need to maintain attribute values for this attribute for each OU to get BP determination.
    The problem is that I need to have many different values in each OU for this attribute; for a several value entries, I need to automatically determine a OU for each BP.
    Is there any way to set this values from a pre-created  table or do I need to set this manually (all values in tx PPOSA_CRM for eah OU) ?
    EX: OU 1 values 100101, 100102, 100103u2026 100999
          OU 2 values 010110, 010111, 010112, u2026010199     
    Best Regards,
    Teresa Lopea

    check this link for [attributes values in organizational model|http://sapcrmlearn.blogspot.com/2009/02/organization-model.html]

  • How to stop just one item being reset when sumbit is pressed?

    How can i keep the value of just one item when the submit button is pressed. This field will always be the user id of the user logged on so i dont want it to be reset. I have tired doing a simple query to select the id everytime the page loads but the value then appears null when i do an insert statement to create a particular record for the user in a table.
    Anyone any ideas?

    Right I could see how the APP_USER would work but it wouldn’t work in this situation.
    To be more specific I want the id of the user which is called student id to stay the same all the way through the application as there id refers to them. What I have is that when a user logs on it takes them to their details and a menu part. One of the options is to enter some documents relevant to them. So when they click this option a new page opens showing a report of all the current documents as well as a form where you can update, insert new and delete documents.
    When you load the page the report and form work fine with the correct student id being passed form the pervious page. If however you create a document all the fields in the form get reset. I therefore want a way of stopping the student id from being reset when you create or delete a document. Basically if the page refreshes.
    I can run an sql query that gets the correct student id if the field is null and displays it correctly in the form but for some reasons (im guessing cos its a result of a query) when it tries to process this when I submit the field is null.
    Any ideas as this one has got me

  • Read attribute value of a master data object's master data object

    Hi Guys,
    I have a peculiar condition where I need to read attribute value of a master data object's master data.
    Requisition (ZREQUI) is linked to Candidacy (ZCDCY) by object called Recquisition.
    Candidacy  (ZCDCY) is linked to Candidacy Activity (0CDCY_ACT) by object called Candidacy.
    I want to populate attribute called due date in ZREQUI by reading lowest value of due date value of 0CDCY_ACT. There can be multiple hits.
    If I can get the code to do this, I would really appreciate it.

    Here is the outline of the code ,as per my understanding..chk if it can help u
    In start routine write a select statement to pick all the data from 0cdcy_act.
    select 0CDcY_ACT ZCDCY  DuE_DATE from /BiC/P0CDCY_ACT
    into table itab1
    for all entries in source_package
    where ZCDCY = source_package-ZCDCY.
    as you need the lowest due date, sort the iTAB1
    sort itab1 by due_date  ZCDCY.   (default is acending order)
    In the field routine of your due date
    Read table itab1tnto wa_itab1 where
    ZCDCy = source_fields -ZcDcY.
    now duedate = wa_itab1-duedate.

Maybe you are looking for