Stepping through a poorly formatted xml file

Hi, this forum worked a charm earlier so I'm hoping it will go 2 for 2.
Through a httpservice I'm reading an XML file into a ArrayCollection. Because the XML is so poorly formatted I'm having to write some very sloppy code just to step through 20 results. I have no control over the XML.
XML Example (can be anywhere from 0 to 20 results):
<results>
    <game>
        <type>game</type>
        <id>321</id>
        <name>gamename</name>
        <image>i34d.png</image>
    </game>
    <character>
        <type>character</type>
        <id>1123</id>
        <name>john</name>
        <image>sds.png/image>
    </character>
    <game>
        <type>game</type>
        <id>432</id>
        <name>examplename</name>
        <image>g2dss.png</image>
    </game>
</results>
Each result can be one of 7 types (I've done only 2, game and character, in my example). The order of them I really want to preserve in my ArrayCollection as it's very relevant.
Here is the (very) sloppy way I'm currently loading each result into my AC:
//container array
var ac2:ArrayCollection = new ArrayCollection;
//I do a block like this for EVERY results type. Meaning 7 in total...
if (service2.lastResult.response.results.character) {
     var characterAC:ArrayCollection = new ArrayCollection;
     if (service2.lastResult.response.results.character is ArrayCollection) {
     //there is more than 1 entry
     characterAC = service2.lastResult.response.results.character as ArrayCollection;
     } else {
          //There is only 1 entry. Need to MAKE it an ArrayColleciton
          characterAC = new ArrayCollection([service2.lastResult.response.results.character]);
        //Add all characters to AC
     ac2.addAll(characterAC);
The two major problems with this code is: 1, it's stupidly bloated and 2, ac2 no longer maintains the order of the XML response. First it puts all <character> into my AC, then it puts all <game> into AC. So on and so forth.
In my head I'm trying to do something like this:
ac2 = service2.lastResult.response.results.* as ArrayCollection;
That would then load all results (regardless of type) into an ArrayCollection. I'm guessing a solution is not that simple...
In an Ideal world, whoever created the XML api would just call each result <result> instead of the stupid type tags it currently uses.
I hope all that makes sense.
Regards,
Zaph.

@Zaph31,
Why not use an XMLListCollection instead of an ArrayCollection?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init();">
    <mx:XML id="iWouldntHaveCodedXMLLikeThat" xmlns="">
        <results>
            <game>
                <type>game</type>
                <id>321</id>
                <name>gamename</name>
                <image>i34d.png</image>
            </game>
            <character>
                <type>character</type>
                <id>1123</id>
                <name>john</name>
                <image>sds.png</image>
            </character>
            <game>
                <type>game</type>
                <id>432</id>
                <name>examplename</name>
                <image>g2dss.png</image>
            </game>
        </results>
    </mx:XML>
    <mx:XMLListCollection id="xmlListColl" />
    <mx:Script>
        <![CDATA[
            private function init():void {
                xmlListColl.source = iWouldntHaveCodedXMLLikeThat.children();
        ]]>
    </mx:Script>
    <mx:DataGrid id="dg" dataProvider="{xmlListColl}">
        <mx:columns>
            <mx:DataGridColumn dataField="type" />
            <mx:DataGridColumn dataField="id" />
            <mx:DataGridColumn dataField="name" />
            <mx:DataGridColumn dataField="image" />
        </mx:columns>
    </mx:DataGrid>
</mx:Application>
Peter

Similar Messages

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • Formatting  XML file to avoid mapping parser error

    Hi,
    We have requirement in our project to process input xml file which is of the below format:
    <message>
    <data>
    <xml version=1.0 code=utf/>
    <test>
    <data>book</data>
    </test>
    </data></message>
    Since <xml>  tag is at the middle it is throwing a exception error in mapping.
    Actual requirment is that we need
    <test>
    <data>book</data>
    </test>
    The xml of the above format is generated by some external system which PI  need to pick it.
    I think  is not possible in XSLT mapping as it is not starting with xml tag .
    So please let me know pointer ot resolve the issue.
    Thanks in advance.

    Hi Yeshwanth,
    If this input XML. Then it is valid XML.
    <message>
      <data>
        <xml version="1.0" code="utf" />
        <test>
          <data>book</data>
        </test>
      </data>
    </message>
    Please paste the error message, input and expected output XML.
    Regards,
    Raghu_Vamsee
    Edited by: Raghu Vamsee on Aug 25, 2011 12:10 PM

  • Data in XML format (XML files) to BW?

    Hi,
    My customer is interested in loading data to BW (from 3rd party system) in XML format. Are there any advantages of doing this (compared to traditional ascii files)? How about disadvantages (BW version is 3.5) ?. How to get started with this one, I noticed there is a possibility to create a XML data source. Is this able to take XML files into BW or what?.
    Any help highly appreciated!

    Hi Jimmy,
       Have a look:
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/821140d72dc442e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/55/014e3c97f6bb3ee10000000a114084/content.htm
    Hope it Helps
    Srini

  • Document to formatted XML file

    I have a question. I have written a sample java program that will create an xml file. The program works properly, but the generated xml is not formatted. How can i format the xml file.
    The java program code is
    package com.spi.xml;
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    public class WriteXML {
    static Document document;
    public static void buildDOM() {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    try {
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.newDocument();
    Element root = (Element) document.createElement("GUI");
    document.appendChild(root);
    Element curElement = document.createElement("Button");
    curElement.appendChild(document.createTextNode("Submit"));
    root.appendChild(curElement);
    curElement = document.createElement("Button");
    curElement.appendChild(document.createTextNode("Cancel"));
    root.appendChild(curElement);
    // Save the document to the disk file
    TransformerFactory tranFactory = TransformerFactory.newInstance();
    Transformer aTransformer = tranFactory.newTransformer();
    Source src = new DOMSource(document);
    Result dest = new StreamResult(new File("C:\\xmlFileName.xml"));
    aTransformer.transform(src, dest);
    } catch (Exception pce) {
    pce.printStackTrace();
    public static void main(String[] args) {
    buildDOM();
    The output (XML file)
    <?xml version="1.0" encoding="UTF-8"?>
    <GUI><Button>Submit</Button><Button>Cancel</Button></GUI>
    How can i format the xml file for multiple lines? I cant't use other libraries (Xerces,JDOM,Xalan) cause they are to big - the application is an applet.

    I don't think the DOM stuff in the core API provides any pretty printing facilities, unless they were added in 5.0.
    I know that jdom does--http://www.jdom.org
    You might also check out apache's XML stuff--http://xml.apache.org/
    Or dom4j--http://www.dom4j.org/

  • Writing a clean, formatted xml file

    Am reworking an xml file with two types entities both with the name "item", one is a base item and the second is an item referred to by the base items.
    My task is to replace the child "<mention_ref item_id=xxx/>" with the actual item that xxx refers to, rename that element to "mention_ref" and delete the element I moved. All this part works well.
    Hoowever, when I write it out it's not formatted and there a empty lines where the missing elements are.
    How can I fix this?
    Jim

    Tried all that and no change in the output, see below:
         <item id="_491" name="$5,000" norm="$_5_,_000" ontology="entity:numeric:money" type="equiv">
              <mention_ref equiv_id="_491" head="2115" id="_317" name="$5,000" norm="$_5_,_000" ontology="entity:numeric:money" tail="2121" type="mention">
              <attribute name="mention_type" value="name"/>
              <attribute name="currency" value="usd"/>
              <attribute name="norm" value="5000"/>
         </mention_ref>
              <attribute name="mention_type" value="name"/>
              <attribute head="2115" name="name" tail="2121" value="$5,000"/>
              <attribute name="currency" value="usd"/>
              <attribute name="norm" value="5000"/>
         </item>
         <item id="_473" name="Associated Press" norm="associated_press" ontology="entity:organization:company" type="equiv">
              <mention_ref equiv_id="_473" head="2330" id="_333" name="Associated Press" norm="associated_press" ontology="entity:organization:company" tail="2346" type="mention">
              <attribute name="confidence" value="4"/>
              <attribute name="mention_type" value="name"/>
         </mention_ref>
              <mention_ref equiv_id="_473" head="1557" id="_337" name="AP" norm="ap" ontology="entity:organization:company" tail="1559" type="mention">
              <attribute name="confidence" value="2"/>
              <attribute name="mention_type" value="name"/>
         </mention_ref>
              <mention_ref equiv_id="_473" head="816" id="_336" name="AP" norm="ap" ontology="entity:organization:company" tail="818" type="mention">
              <attribute name="confidence" value="2"/>
              <attribute name="mention_type" value="name"/>
         </mention_ref>
              <mention_ref equiv_id="_473" head="475" id="_332" name="Associated Press" norm="associated_press" ontology="entity:organization:company" tail="491" type="mention">
              <attribute name="confidence" value="4"/>
              <attribute name="mention_type" value="name"/>
         </mention_ref>
              <mention_ref equiv_id="_473" head="2326" id="_472" name="The Associated Press" norm="the_associated_press" ontology="entity:organization:company" tail="2346" type="mention">
              <attribute name="mention_type" value="extended_name"/>
         </mention_ref>
              <mention_ref equiv_id="_473" head="471" id="_470" name="The Associated Press" norm="the_associated_press" ontology="entity:organization:company" tail="491" type="mention">
              <attribute name="mention_type" value="extended_name"/>
         </mention_ref>
              <attribute name="confidence" value="4"/>
              <attribute name="confidence" value="2"/>
              <attribute head="2326" name="extended_name" tail="2346" value="The Associated Press"/>
              <attribute head="471" name="extended_name" tail="491" value="The Associated Press"/>
              <attribute name="mention_type" value="name"/>
              <attribute name="mention_type" value="extended_name"/>
              <attribute head="2330" name="name" tail="2346" value="Associated Press"/>
              <attribute head="1557" name="name" tail="1559" value="AP"/>
              <attribute head="816" name="name" tail="818" value="AP"/>
              <attribute head="475" name="name" tail="491" value="Associated Press"/>
         </item>it is valid, but not formatted.

  • Best technology to navigate through a very large XML file in a web page

    Hi!
    I have a very large XML file that needs to be displayed in my web page, may be as a tree structure. Visitors should be able to go to any level depth nodes and access the children elements or text element of those nodes.
    I thought about using DOM parser with Java but dropped that idea as DOM would be stored in memory and hence its space consuming. Neither SAX works for me as every time there is a click on any of the nodes, my SAX parser parses the whole document for the node and its time consuming.
    Could anyone please tell me the best technology and best parser to be used for very large XML files?

    Thank you for your suggestion. I have a question,
    though. If I use a relational database and try to
    access it for EACH and EVERY click the user makes,
    wouldn't that take much time to populate the page with
    data?
    Isn't XML store more efficient here? Please reply me.You have the choice of reading a small number of records (10 children per element?) from a database, or parsing multiple megabytes. Reading 10 records from a database should take maybe 100 milliseconds (1/10 of a second). I have written a web application that reads several hundred records and returns them with acceptable response time, and I am no expert. To parse an XML file of many megabytes... you have already tried this, so you know how long it takes, right? If you haven't tried it then you should. It's possible to waste a lot of time considering alternatives -- the term is "analysis paralysis". Speculating on how fast something might be doesn't get you very far.

  • Error parsing ERwin 7.x File when I  tried to IMPORT repository format xml file in SQl Data Modeller

    This is what i got in the log file when i tried to import a relatively large file 1.7 GB xml file
    Import Finished
    Errors:   1
    Warnings: 0
    <<<<< ERRORS >>>>>
    Error parsing ERwin 7.x File:<File path>
    Please help.

    The error information in the External log file is
    ERROR ERwinHandler - ERwinHandler - Unable to parse ERwin 7.x file: <file path>
    java.lang.OutOfMemoryError: Java heap space
      at oracle.dbtools.crest.model.ModelIDObject.<init>(ModelIDObject.java:46)
      at oracle.dbtools.crest.model.design.DesignObject.<init>(DesignObject.java:111)
      at oracle.dbtools.crest.model.design.ContainedObject.<init>(ContainedObject.java:82)
      at oracle.dbtools.crest.model.design.ContainedObjectWithDomain.<init>(ContainedObjectWithDomain.java:76)
      at oracle.dbtools.crest.model.design.relational.FKElement.<init>(FKElement.java:14)
      at oracle.dbtools.crest.model.design.relational.Column.<init>(Column.java:148)
      at oracle.dbtools.crest.model.design.relational.Table.createColumn(Table.java:432)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.parseColumns(ERSAXParserv7x.java:1681)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.parseEntity(ERSAXParserv7x.java:1364)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.endEntitiesAndAttributes(ERSAXParserv7x.java:994)
      at oracle.dbtools.crest.imports.erwin.ERSAXParserv7x.endElement(ERSAXParserv7x.java:428)
      at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1666)
      at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:458)
      at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:404)
      at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:245)
      at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:298)
      at oracle.dbtools.crest.imports.erwin.ERwinHandler.parseFile(ERwinHandler.java:252)
      at oracle.dbtools.crest.imports.erwin.ERwinHandler.access$500(ERwinHandler.java:51)
      at oracle.dbtools.crest.imports.erwin.ERwinHandler$Runner.run(ERwinHandler.java:126)
      at java.lang.Thread.run(Thread.java:745)
    2015-02-11 14:38:12,680 [main] INFO  ApplicationView - Oracle SQL Developer Data Modeler 4.1.0.866
    2015-02-11 16:13:44,218 [Thread-33] ERROR ERwinHandler - ERwinHandler - Unable to parse ERwin 7.x file: <file_Path>
    java.lang.OutOfMemoryError: Java heap space

  • How to format XML file as in JDeveloper's style?

    I'm trying to output XML by using oracle.xml.parser.v2.XMLOutputStream. There are three possible output styles: COMPACT, DEFAULT, PRETTY. I tried all of them, but none of them can give me the exact fromatting style as in JDeveloper. What output style JDeveloper is using? If there's a special XSL is being used by JDeveloper, can anyone give me a link?
    Much thanks
    Charles

    You mean you want to see the XML source?
    You need to replace the characters '<' and '&' with corresponding entities '&lt;' and '&amp;'. You can use replaceAll, but do the ampersands first.
    Then I suggest you probably want to put them in a <PRE> block.

  • Using a CWM format XML as datastore; COM SDK to read the file and create Universe

    Hello everyone
    We are in the process of migrating from a metadata store to BusinessObjects Universe and the plan is to use Java/COM SDK to accomplish that. We have run into limitations with both the SDKs. Java SDK doesn't provide that facility and using COM SDK we are trying to read from a XML file (metadata in CWM format) and create the universe but so far haven't been successful. If the (Universe)Designer can read a CWM format xml file (say created from BODS) we are wondering why can't a customer made COM program do the same.
    Has anyone attempted this and been successful. Please acknowledge.
    Thanks

    I have written C#.NET code to build universes on the fly using the Designer SDK with no problems.  However, I wasn't using CWM formatted data to do this.
    I have two suggestions for you:
    1.  Since not all of the functionality in the Designer tool seems to be available through the SDK, can you parse the CWM xml file in your code and build the universe based on the data instead of trying have Designer build it?
    2.  Since you're using Java, you may get better answers by posting this question in the Java SDK Application Development space here:  http://scn.sap.com/community/bi-platform/java-sdk
    -Dell

  • Parsing .xls(excel) file and creating a .xdat(xml) file out of it

    Hi All,
    need some tips on a task i am trying accomplish for some days now.
    I have a excel file, in which I have 10 columns with 40-50 rows of data.
    I have a xml structure in mind, in which I want to put all these data from excel file. But till now I haven't understood exactly how I should go about it step by step.
    Should I first parse the excel file and save each row (with the column names) in a list, and then read through each row and insert them in the xml format i have planned?
    And how do I open a .xdat data and tell my program to insert the data in the sequence of sets I want them to be saved?
    I know it's a pretty newbie question ... but will appreciate any help and tips provided. Would help me a lot to learn this new type of task.
    Thank you.
    with best regards,
    Newbie

    If you are using JAXB you unmarshall to read the xml. Then you marshall to write.
    So what you do is:
    1) Unmarshall your xml document. This means you now have your xml as Java objects.
    2) Read through the Java objects using loops, etc making any changes to the values. I think here you want to add values, so you can set your values
    3) Now in memory you have your new xml thats been updated, so you can marshall it (save it)
    I'd recommend a JAXB tutorial. But the basic steps are:
    1) Create an xml file and insure its valid
    2) Use a free online utility (http://www.hitsw.com/xml_utilites/) to convert the xml into an xml schema (xsd)
    3) Use xjc from the jaxb jar and run it over the xml schema (the command i use is xjc myxmlfile.xsd -p com.example
    4) Step 3 above creates all the java classes for you to use so then you can unmarshall. Process. Then marshall
    This is just a high level. I might have missed something, but the jaxb tutorial is really good and that's how I learned the process.

  • Dynamically building web content using XML file(s)

    Hello All!
    I was recently tasked with a project to design a monitoring web application for our "in-house" built web applications. There is a certain set of modules and parameters that we need to monitor: GSLB --> Web Tier --> App Tier --> Database.
    Almost all (80%) of our applications share the same parameters that need to be monitored, but there are about a hundred of them. So here is what I'm thinking of doing....
    1. Create an XML document for each application (An example layout is included at the end of this post) and save it in the Applications directory.
    2. Setup a Spring Framework project, and create code to dynamically go through the Applications directory and kick-off the monitoring logic for each <application/> item. Basically, the code will just traverse through all of the xml files (I might even create just 1 xml file with all of the <application/> items in it), read the "metadata" for each application, and start the backend processing, as well as display the data in a dynamically-generated web GUI (based on the XML structure and data).
    Again, most of our applications (80%) have the same modules/parameters, therefore adding an application would only require us adding another <application/> element to the already-existing xml document (or adding an additional XML document). The code would do the rest...In regards to the rest 20% of applications, I would create a customize XML document with additional metadata (the code, in that case, would be able to handle the additional metadata).
    So here are my questions:
    1. What do you think of the idea itself? I'm sure that I'm not the only one who's thought of this, so are there any best-practices in this regard?
    2. The reason I thought of using Spring is that it is XML-based (there are many reasons for me using Spring actually -- Security, ORM integration, etc), and it might facilitate my efforts. I'm thinking that even if reading through the Applications directory isn't such a good idea, I can somehow utilize Spring's dependency injection & AOS to create the appropriate solution. Have anybody tried this before and willing to share ideas, implementation approach, etc?
    3. Other than Spring, what might help me accomplish this task?
    4. Is this feasible (from a time and effort stand-point), or should I just do it the old-fashioned way?
    Thanks in advance!
    Vladimir
    I am including a sample (very rough-draft) XML file of what the input might look like:
         <applications>
              <application name="Remote Application">
                   <vip>somethingUNIQUE.mycompany.com</vip>
                   <sys-level>LAB</sys-level>
                   <lb-type>GTM</lb-type>
                   <farms>
                        <farm name="Farm 1" id="1">
                             <member-name>sslname.mycompany</member-name>
                             <ip-address>34.34.24.242</ip-address>
                             <application-servers>
                                  <application-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                        <farm name="Farm 2" id="2">
                             <member-name>sslvpn01.downingtown</member-name>
                             <ip-address>34.34.24.250</ip-address>
                             <application-servers>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                   </farms>
              </application>
              <application name="Tech Tools">
                   <vip>technicalUNIQUE.tools.mycompany.com</vip>
                   <sys-level>LAB</sys-level>
                   <lb-type>GTM</lb-type>
                   <farms>
                        <farm name="Farm 1" id="1">
                             <member-name>tools.tech</member-name>
                             <ip-address>34.34.24.214</ip-address>
                             <application-servers>
                                  <application-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                        <farm name="Farm 2" id="2">
                             <member-name>tools.tech222</member-name>
                             <ip-address>34.34.24.415</ip-address>
                             <application-servers>
                                  <application-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                   </farms>
              </application>
         </applications>

    Hello jschell!
    Again, the question was more about the overall architecture and design rather than monitoring implementation.
    So here is what I have now:
    1. A spring application that will do the following:
    Read in the "architecture.xml" file (a portion is shown below). This file will dictate not only the type of monitoring but also the layout (explained later).
    The architecture.xml is marshalled to entity objects -- Model (s), with nested Model "children"
    This array of Model(s) is what the server-side application will use to populate the monitoring parameters.
    When the Impl gets a hold of the Model(s), it traverses through all of these entities and does whatever processing it needs to do (Health check, routing check, etc), and produces Item(s) objects, which are similar in structure to the Model(s) entities, but have actual values that need to be displayed on the front-end. Each item might have an array of other, children, Item(s)
    2. A GWT application asks for the Items array, and displays them on the front-end.
    What I did already:
    *1. Created a base Spring project that accepts GWT requests and returns a set of Item(s) (statically-generated, since I don't have the proper Impl yet).*
    *2. Created the GWT project and the layout. GWT communicates with the Spring app (which runs on tomcat for now) and upon retrieving the Item(s) it recursively renders them into displayable items, with different background, borders colors, width, etc (based on the populated values and their nested children, if any) . The last code snippet is the definition of the Item class.*
    Basically, the architecture is setup and the next step is the actual implementation of the monitoring and routing logic -- which wasn't the point of this post, since I already did most of it for a different project :)
    Thanks for the replies though....
    Vladimir
    <serviceView name="YYYYYYYY XXXX">
         <item layout="vertical">
              <!-- The top level application name -->
              <item name="Routing XXXXXXX  (RX)"/>
              <!-- The GSLB name and Active Farms printout -- Work in Progress-->
              <item  name="RX GSLB - xxxxxxx.xx.xxxxxxxx.com" layout="vertical">
                   <dynamicText type="gslb_farms">
                        <param name="vip" value="xxxxxxxx.xx.xxxxxxxxx.com"/>
                   </dynamicText>
              </item>
              <!-- The farms Row -->
              <item layout="horizontal">
                   <!-- The 1st Farm -->
                   <item name="Farm 1" layout="vertical">
                        <operationalState name="xxxxxxx.xx.yyyyyyy.com" type="gslb_farm">
                             <param name="vip" value="activate.g.comcast.com"/>
                             <param name="farmName" value="RX.WT.F1.VIP">
                        </operationalState>
                        <hc name="RX.WT.F1.VIP" type="poller"/>
                        <!-- DataCenter name -->
                        <item name="PDX" value="PDX"/>
                        <!-- Web Tier -->
                        <item layout="horizontal">     
                             <item name="WEB1" description="WEB1" detailedView="someservice_level_xmlname.xml">
                                  <hc name="RE.WT.F1.rdw01" type="poller"/>
                             </item>
                             <item  name="WEB2">
                                  <hc name="RE.WT.F1.rdw02" type="poller"/>
                             </item>
                        </item>
    public class Item implements Serializable{
         private static final long serialVersionUID = 1L;
         public final static String _ROUTING_STATUS_ENABLED = "_ROUTING_STATUS_ENABLED";
         public final static String _ROUTING_STATUS_DISABLED = "_ROUTING_STATUS_DISABLED";
         public final static String _ROUTING_STATUS_UNKNOWN = "_ROUTING_STATUS_UNKNOWN";
         public final static String _HEALTH_STATUS_GOOD = "_HEALTH_STATUS_GOOD";
         public final static String _HEALTH_STATUS_BAD = "_HEALTH_STATUS_BAD";
         public final static String _HEALTH_STATUS_UNKNOWN = "_HEALTH_STATUS_UNKNOWN";
         // This is what will be printed out -- the static text
         private String name = null;
         // If detailedView is not empty, then a link for this item shows up
         // that opens up a Dialogue Box
         private String detailedView = null;
         // If detailedView is not empty, then a link for this item shows up
         // that opens up a completely new Service View
         private String serviceView = null;
         // Layout Information
         private boolean verticalLayout = true; // VERTICAL or HORIZONTAL
         // Coloring Information
         private String routingStatus = _ROUTING_STATUS_UNKNOWN; // ENABLED, DISABLED, UNKNOWN
         private String healthStatus = _HEALTH_STATUS_UNKNOWN; // HEALTHY or NOT-HEALTHY
         // Children
         private Item children[] = null;

  • Reading complex XML file in flex

    I have searched the web but found very primitive xml
    examples. I want to read a complex xml file which through
    httpservice .
    The xml file is ultimately going to become dataProvider of a
    tree. But I have no idea how to traverse this xml file. mentioned
    under are the xml file and HTTPService tag.
    I want to traverse it in the resultHandler function.
    Thank you very much

    Yes, as Greg says, use e4x.
    To do this you must set the HTTPService resultFormat="e4x";
    In you handler, do:
    var xmlResult= XML(event.result);
    trace(xmlResult.toXMLString());
    and away you go.
    Tracy

  • Configuring Mysql database in EJB  xml file for JBoss

    I am using Mysql as database , How to configure JBoss to use Mysql as the database when using ejb's( session beans)
    My ejb-jar.xml is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
         <description>no description</description>
         <display-name>LoginJAR</display-name>
         <enterprise-beans>
         <session>
         <description>no description</description>
         <display-name>loginEJB</display-name>
         <ejb-name>loginEJB</ejb-name>
         <home>com.rfp.Session.loginHome</home>
         <remote>com.rfp.Session.loginObject</remote>
         <ejb-class>com.rfp.Session.loginEJB</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
         <resource-ref>
              <res-ref-name>jdbc/rfptrack</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>
         </session>
         </enterprise-beans>
         <assembly-descriptor>
              <container-transaction>
                   <method>
                   <ejb-name>loginEJB</ejb-name>
                   <method-intf>Remote</method-intf>
                   <method-name>*</method-name>
              </method>
              <trans-attribute>Required</trans-attribute>
         </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    1) My doubts are
    a). there is a username and password to access the database,
    I am mentioning only the database namein the xml file like-
    jdbc/rfptrack. So where should the username and password be
    mentioned or declared.
    b). The server showed the following error when it was started.
    Caused by: java.sql.SQLException: Table 'test.jms_messages' doesn't exist
    11:40:11,687 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.2.3/server/default/deploy/Jlogs.ear
    Incompletely deployed packages:
    [org.jboss.deployment.DeploymentInfo@6522477c { url=file:/C:/jboss-3.2.3/server/default/deploy/Jlogs.ear }
    deployer: org.jboss.deployment.EARDeployer@1e940b
    status: Deployment FAILED reason: Verification of Enterprise Beans failed, see above for error messages.
    state: FAILED
    the server is showing that table "test:" does not exist but I am using rfptrack as the database and not test. how can I configure the server for it.
    PLEASE GO THROUGH THE EJB-JAR.XML FILE AND THE SERVER ERRORS GIVEN ABOVE AND GIVE SUGGESTIONS TO RECTIFY MY ERRORS.

    Hi Svend,
    Please share the xml file.
    I am able to acheive the result by doing the above changes.
    Thanks,
    Dinesh.V
    PS:<SendDataOnNodes>False</SendDataOnNodes 
    replace with case sensitive  <SendDataOnNodes>false</SendDataOnNodes

  • Error in xml file

    I have created a form through screen painter and converted it to xml for accesing it  through asp.net.The xml file gives following error-
    An unhandled exception of type
    'System.Runtime.InteropServices.COMException' occured in Project1.exe
    Additional information:Form -already exists [66000-11].Form Unique Id:
    'SBOFormEditor_16'

    hi dilip,
    As u told, u have two problem..
    1.) error in creating xml.
              do one thing, open srf in any editor, copy all content to a blank notepad file then
              file > save as
               a.) file type to all files
               b.) encoding to unicode
               c.) file name with extension 
    2.) form already exist.
             to overcome this, u have to close the sap business one and restart it.
    hope both will help u.
    if satisfied, rewards points.
    regards
    nirdesh panwar

Maybe you are looking for

  • Multiple problems with syncing deleting media off iPhone

    The syncing process on the iPhone is very frustrating. As all know, with the iPod, if I wanted to put a song I had in iTunes onto my iPod, all I had to do was connect my iPod, click on the song in iTunes, and drag it on to my iPod. Easy. No more. Wit

  • Looking for a new PDA/Phone

    I'm looking for a new PDA/Phone that is iSync 2.4 compatible for my new AT&T account. I will switch to iPhone early in the new year but need a PDA/Phone now. Appantly AT&T is out of Nokia PDAs' at the moment.

  • Do i have to install new graphics card on my PC? as i will install windows 8.1 with 4GB ddr2 RAM

    My PC name is COMPAQ SG3350IL i have 2   DDR2  RAM slots in which i can install  total 4 GB RAM. I will install windows8.1 on my PC very soon, for that do i have to upgrade my video BIOS also with RAM( as above)? All this i am asking is for installin

  • Videos not showing up in Responsive slider on Mac

    <blockquote>Locking duplicate thread.<br> Please continue here: [[/questions/927393]]</blockquote> Hello. We have an issue with videos on one of our templates. Videos are just black squares and you can listen only sound. It only happens on Mac (it's

  • Magic Mouse and Windows 7

    I recently installed Windows 7 in boot camp on my iMac. I cannot get the mouse to move at all. I installed the drivers from the OS X disk. Any suggestions?