Using JScript to search an XML File

I have an XML file that has three fields in each section like the following:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CapabilityData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <capability>
        <oem>A.I.D</oem>
        <PartNumber>1426-5A-A1</PartNumber>
        <Nomenclature>AIRSPEED</Nomenclature>
    </capability>
    <capability>
        <oem>A.I.D</oem>
        <PartNumber>1426-5A-B1</PartNumber>
        <Nomenclature>AIRSPEED</Nomenclature>
    </capability>
</CapabilityData>
and what i want to do is search the xml file to find if a part number exists.  All this has to do is return a Yes or No response...
The problem I am experiencing is that i can get the script to read the xml and display it on the screen but once i try to add in code to actually do a search it goes all haywire... i don't know if i'm jsut doing something stupid or if i'm doing it all incorrectly.
Please be gentle, this is my first time...
~~~~
<html>
<body>
<h1>OEM Search 2</h1>
<button onclick="myTestFunction()">Try it</button>
<script>
function myTestFunction()
    var sPNSearchFor = "18B331";
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.open("GET","capability.xml",false);
    xmlhttp.send();
    xmlDoc=xmlhttp.responseXML;
    document.write("<table border='1'>");
    var x=xmlDoc.getElementsByTagName("capability");
    for (i=0;i<x.length;i++)
      document.write("<tr><td>");
      var sOEM=xmlDoc.getElementsByTagName("oem")[i].childNodes[0].nodeValue;
        document.write(sOEM);
        document.write("</td><td>");
      var sPN=xmlDoc.getElementsByTagName("PartNumber")[i].childNodes[0].nodeValue;
        document.write(sPN);
        document.write("</td><td>");
      var sNom=xmlDoc.getElementsByTagName("Nomenclature")[i].childNodes[0].nodeValue;
        document.write(sNom);
        document.write("</td><td>");
        document.write(sPNSearchFor);
        document.write("</td><td>");
    document.write("</table>");
</script>
</body>
</html>

Hi Tom,
Please post your question in this forum, you could get more helpful answers there:
ASP.NET Forums >
General ASP.NET >
HTML, CSS and JavaScript
Thanks for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Problem in use xmlgen.insertXML to insert XML file to Object Viewse

    I am trying to update XML file to Object View but it failed. Refer to the steps that I was doing.
    1) Use utl_file.get_line to read XML file which I generated (It is no problem)
    2)The xml data is
    <?xml version="1.0" ?>
    - <ROWSET>
    - <ROW num="1">
    <PK_NO>305</PK_NO>
    <ACC_NAME>PAPERS AND CLIPS</ACC_NAME>
    <FROM_NAME>MB METAL PTE LTD</FROM_NAME>
    <MAS_NO>990015</MAS_NO>
    <MAS_DATE>2000-04-07 15:47:52.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>WRFQ</MAS_CODE>
    <REMARK>SADKJAS</REMARK>
    - <LINEITEMLIST_NTAB>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>1</ITEM_NO>
    <STK_C>2506401</STK_C>
    <SP_STK_C>H282828</SP_STK_C>
    <STK_NAME>STICK-ON-NOTES - 11110 1.5, 12 100 SHEET PADS</STK_NAME>
    <UOM>SET</UOM>
    <QTY>10</QTY>
    <SALES_PRICE>95.50</SALES_PRICE>
    <REMARK>SADKJAS</REMARK>
    </LINEITEMLIST_NTAB_ITEM>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>2</ITEM_NO>
    <STK_C>7706001</STK_C>
    <SP_STK_C>H282828</SP_STK_C>
    <STK_NAME>FACESHIELD/EYE PROT CLEAR GLASS WTR PLATE, STANDARD DREW</STK_NAME>
    <UOM>PCS</UOM>
    <QTY>1</QTY>
    <SALES_PRICE>100</SALES_PRICE>
    <REMARK>SADKJAS</REMARK>
    </LINEITEMLIST_NTAB_ITEM>
    </LINEITEMLIST_NTAB>
    </ROW>
    </ROWSET>
    3) From Object View, I generated xml file is
    - <ROWSET>
    - <ROW num="1">
    <PK_NO>2</PK_NO>
    <ACC_NAME>PAPERS AND CLIPS</ACC_NAME>
    <FROM_NAME>MB METAL PTE LTD</FROM_NAME>
    <MAS_NO>990015</MAS_NO>
    <MAS_DATE>2000-06-07 00:00:00.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>WRFQ</MAS_CODE>
    - <LINEITEMLIST_NTAB>
    - <LINEITEMLIST_NTAB_ITEM>
    <ITEM_NO>1</ITEM_NO>
    <STK_C>2506401</STK_C>
    <STK_NAME>STICK-ON-NOTES - 11110 1.5,X2 12 100 SHEET PADS</STK_NAME>
    <UOM>SET</UOM>
    <QTY>1</QTY>
    <SALES_PRICE>10</SALES_PRICE>
    </LINEITEMLIST_NTAB_ITEM>
    </LINEITEMLIST_NTAB>
    </ROW>
    - <ROW num="2">
    <PK_NO>4</PK_NO>
    <ACC_NAME>ABC</ACC_NAME>
    <FROM_NAME>VBF</FROM_NAME>
    <MAS_NO>99200</MAS_NO>
    <MAS_DATE>2000-01-04 00:00:00.0</MAS_DATE>
    <CURR_CODE>SGD</CURR_CODE>
    <MAS_CODE>DSDS</MAS_CODE>
    <REMARK>WRFQ</REMARK>
    <LINEITEMLIST_NTAB />
    </ROW>
    </ROWSET>
    3) I use INSTEAD OF trigger for Object View to insert the data to database.
    I got the message is:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:5.
    Anybody can give me the advise for that.
    null

    If you have the ftp server at 8080 running (9iR2 only) the simples way is to upload it to the database through that server. You can then do whatever you want using the xdburitype() procedure.
    Below is an excerpt of a script I use to register XML schema's (I've got some very long ones, about 150K). It should work with "any" file..
    begin
         dbms_xmlschema.registerSchema (
              schemaURL => 'http://www.agralin.nl/WebQuery/ns/&1',
              schemaDoc => xdburitype('/age/&1..xsd'),
              local => TRUE,
              genTables => FALSE,
              genbean => FALSE,
              genTypes => TRUE,
              force => FALSE,
              owner => 'AGE'
    end;

  • Create a Purchase order using the BAPI using the data in the XML file.

    Hello Gurus,
    here is the scenario can anyone help me how to proceed explaining the procedure?
    Create a Purchase order using the BAPI using the data in the XML file.
    comprehensive explanations are appreciated.
    thanks in advance.

    hi,
      first use fm "bapi_po_create".
      then use fm "BAPI_ACC_GL_POSTING_POST"
    The demo environment was made with real business scenario in mind, but following subjects need to be addressed in a live implementation:
    •     No exceptions and error handling is implemented, except the order rejection (e.g. partly delivery);
    •     In Navision both XML Ports and the XML DOM has been used to integrate with SAP XI, because XML ports has some drawbacks regarding to Namespaces in XML Documents (mandatory in SAP XI);
    •     A minimum of SAP and Navision customization is required to implement this solution. (e.g. user exit in SAP, Navision XML DOM).

  • How to use Xerces to validate an XML file against a DTD

    Hi, can anybody tell me how to use Xerces to validate an XML file against a DTD. its urgent. post some sample code. it would be helpful for my project. isupposed to use SAX parser(Xerces)
    Thanx in advance

    Come on, I googled "xerces validate" and the first link is the Xerces FAQ:
    http://xerces.apache.org/xerces-j/faq-general.html
    And of course "how to validate" is a Xerces FAQ. Help yourself by doing a little research instead of waiting for other people.

  • Searching an XML file and using getNextSibling()

    I apologise if this question has been answered before, but I haven't been able to find a precise answer to my problem.
    Here is a snippet of my XML file:
    <organization...>
    <title>
    <item...>
    <title>
    <adlcp:prerequisites>
    What I want to do is search this file based on item title (org->item->title). When I find the corresponding entry, I want to traverse back up the tree to retrieve an attribute of the <item> tag, the <title> belonging to the organisation, and I also want to record the sibling node <adlcp:prerequisites>.
    I have no trouble obtaining traversing up the tree from the item <title>, but as soon as I try calling getFirstChild() or getNextSibling(), my method throws an exception.
    Here is an excerpt of my (somewhat shoddy) code:
    try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
         docScorm = db.parse(strScorm);
         Element root = docScorm.getDocumentElement();
         NodeList children = root.getChildNodes();
         int n = children.getLength();
         String strTopicName = "";
         int i = 0 ;
         Node genericNode = null ;
         Node topicNode = null ;
         while(i < n)
              NodeList topicList = docScorm.getElementsByTagName("title");
              genericNode = topicList.item(i);
              strTopicName = genericNode.getFirstChild().getNodeValue();
              if (strTopicName.equals(strTopic))
                   topicNode = topicList.item(i) ;
              i++ ;
         //Save the information in the ScormInfo object.
         siItem.setTitle(strTopicName) ;
         //We have the topic name - get the other info.
         if (topicNode != null)
              Node itemNode = topicNode.getParentNode() ;
              NamedNodeMap nnmItemAtt = itemNode.getAttributes() ;
              Node itemIdentifierNode = nnmItemAtt.getNamedItem("identifier") ;
              //Fill in the ScormInfo object details.
              siItem.setIdentifier(itemIdentifierNode.getFirstChild().getNodeValue()) ;
    //I'd given up getting the organisation title, and settled for the identifier attribute instead.
    Node orgNode = itemNode.getParentNode() ;
              NamedNodeMap nnmOrgAtt = orgNode.getAttributes() ;
              Node orgTitleNode = nnmOrgAtt.getNamedItem("identifier") ;
              siItem.setOrganisation(orgTitleNode.getFirstChild().getNodeValue()) ;
              //Try to get the sibling.
              Node preReqNode = topicNode.getNextSibling() ;
    ====================================
    And this is the point where it all goes wrong. Can anyone shed some light on what I am doing wrong? Any help would be greatly appreciated.

    After a little more debugging, I discovered that you are correct - trying to access the Node is throwing a NullPointerException, and admittedly, I was not accounting for that.
    However, while I can easily take care of a NullPointerException, I am still bewildered as to why the getNextSibling function returns null in the first place. A quick snippet of the file in question shows:
    <organisation...>
    __<item identifier="ITEM-4E83F4CA-B846-67E5-48F1-C58732D13615" isvisible="true" identifierref="RES-74A66825-6926-3C1E-5D19-489856C9C280">
    ____<title>Topic_2_parallel_and_serial</title>
    ____<adlcp:prerequisites type="aicc_script">ITEM-5BE1806E-C38C-89A9-F2FC-BB51109259E3</adlcp:prerequisites>
    __</item>
    ====================================
    Considering my Node "topicNode" points to the "<title>Topic_2_parallel_and_serial</title> node, I am confused as to why getNextSibling does not return the <adlcp...> node. Is it not the next direct sibling?

  • Search in XML files

    Hi,
    We have an requirement where our SharePoint intranet site needs to search content in XML files and display the result. The XML file has different attributes associated content nodes and search should allow faceted search using these attributes. The
    XML structure would be as follows
    <contents>
    <content version="" language="" region="" country="" attributeN="" attributeM="">content goes here</content>
    <content version="" language="" region="" country="" attributeN="" attributeM="">content goes here</content>
    <content version="" language="" region="" country="" attributeN="" attributeM="">content goes here</content>
    </contents>
    I would like to know what is best option available to search XML files in SharePoint. These are option that I can think of
    Store the XML files in SharePoint document library or in a shared folder. Write a custom Search Indexing Connector using
    SharePoint Search Connector framework to crawl and index the XML files.
    Parse and store the XML files in SharePoint list and allows SharePoint search engine to crawl and index the SharePoint list content.
    Parse and store the XML files in a custom database (e.g. SQL Database), and use BCS (Business Connectivity Service) external content type feature to crawl and index the content.
    Parse and store the XML files in a custom database (e.g. SQL Database), and use the SQL query and a business layer component to fetch the content from database. And use the custom web part to fetch and display the content. Note, there is no SharePoint
    search feature is used for this approach.
    Thanks,
    Pat

    Hi Patni,
    Thanks for posting your query here, I would suggest you option 2. I have implementation the same thing in one of my solution so its more proven Technic.
    Let me tell you the implementation part of it.
    1. Save your XML files in in SQL Server DATABASE .
    2. Create a WCF or Windows Server to fetch the XML files and segregate the Metadata based on your XML attributes
    3. Use implementation WCF in Custom .NET BCS or SharePoint Designer BCS to get the Data in SharePoint.
    4. Now, you can configure your BCS for crawling in SharePoint Search application.
    5. Check out the Crawl log for verify the Data
    Also, you can test the Search result using Mossman tool that is freely available on below mentioned URL 
    http://fastforsharepoint.codeplex.com/
    I hope this is helpful to you. If this works, Please mark it as Answered. 
    Regards, 
    Dharmendra Singh (MCPD-EA | MCTS) 
    Blog :
    http://sharepoint-community.net/profile/DharmendraSingh

  • Efficient way of searching multiple xml files for multiple entries

    As I�m quite new to using xml in java I can't figure out how to solve my problem.
    I've got about 20 xml files, each about 500-1000kB big. each files contains about 500 questions, each with a unique ID.
    A user had to be capable of entering any number of ',' separated id's, and the program needs to show the user the questions.
    Using a SQL server this would be easy, but in this situation I can't. As this had to be a small program I can't add a 10MB jar file either, nor can I ask the users to install an additional program.
    Creating a brute search will be easy, but searching 20MB of xml files multiple times will be hard even for a modern PC.
    So my question is: What will be the most efficient way of searching these files?
    Hope that someone will be kind enough to respond :)
    Rick

    I'd still go with a database. There are databases that are significantly more light-weight than MS SQL Server.
    More concretely there are databases that run completely in memory. HSQLDB is one, Java DB (formerly Derby) is another one.
    I'd parse the XML files once, add them to the database and query from there later on.
    If even that is to complicated for you, then you could simply parse the XML files once and put the Questions into a HashMap with the ID as the key.

  • How do i use a flash gallery with xml file

    Hi there....
    I am trying to include a flash banner template i have downloaded into my webpage using dreamweaver CS5.
    the template comes with an XML file with it in which you can reference your own images etc..
    I understand how to inclued the Flash object into my webpage by insert-swf- and then navigating to the .swf file...
    what i am having trouble with is understanding how this refereces the XML file in the download pack as i cant find any references to it in the code??
    I am just getting the grey flash box with no images appearing when i hit play etc..
    sorry if this is a really silly question!!
    mart

    If you are using DW to insert the Flash, that could be the problem.  It is not reliable resource in that respect (my opinion, but a shared one). I normally only use Flash to create the code and copy/paste it into my html page.  Did you get an fla file with the set, and do you have Flash?
    What you should do is test the swf file by itself to make sure it works.   Normally you can link directly to the swf file to check that out.  Just type in the url to the swf file and see if it plays.  There may be some other setup required that maybe an accompanying set of instructions might explain.
    Also, if you have a link to the html file you uploaded, providing it here may help in getting things resolved.

  • What Characters Cannot Be Used In Titles In An XML File?

    Forgive me for asking what I feel like should be an easy question to answer on my own.  I am Googling and cannot seem to find it anywhere, though I remember reading it at one time.  I know that if I type an ampersand (&) in one of my podcast titles that the XML file will not function correctly until I remove the ampersand and replace it with the word "and."  I am wondering if this happens with the question mark character (?).  I would like to title one of my podcasts as a question, but would like to avoid the hassle ahead of time.  What symbols can I not use in titles/summaries in my XML file, and is there a way to use these symbols in titles/summaries without confusing the XML file?

    You are fine with question marks, commas, colons and semi colons, underscores, hyphens and exclamation points as long as they are within tage such as 'title' and 'itunes:subtitle'. As you say you must not have an ampersand by itself anywhere because it's used in XML to indicate the start of a code sequence which is then never completed. You can use the code
    &amp;
    instead, or indeed the workd 'and' of course.
    Diacriticals - é, ü etc - are OK as long as you type them directly into the feed or whatever is making it. For more unusual characters see this page:
    http://www.apple.com/itunes/podcasts/specs.html#commonmistakes
    and scroll down to 'Using Named HTML Character Entitities'.
    As Robert says, never construct your text in a word processor and copy it in; this way you may embed invisible control codes; and quote marks are likely to be 'smart quotes' ('curtly quotes'). Either of these will wreck your feed completely.

  • Using web.show_document to open xml file

    I have successfully created an xml file and saved it to a directory on my hard drive. I was tyring to find answers to Client_OLE2 and stumbled upon Web.Show_Document to open this file. Essentially the file is in a spreadsheet format so when I manually open using IE then Excel is launched. Anyway, currently I am running forms locally and have set a virtual-directory virtual-path in my orion-web.xml file. My virtual path is /report_tmp/. So in my form I have issued the following call to launch a browser and display the file:
    Web.Show_Document('/report_tmp/'||v_filename, '_BLANK');
    This call does not produce any errors nor does it display the file. What am I doing wrong?
    Thanks,
    c

    Is the browser launching?
    If it is have you tried a show source on the browser window?
    Sometimes if you open an XML file in a browser you get a blank page but the XML is there. Something to do with the XML format I think. I'm no expert on XML just a behaviour I have observed.

  • Which API can be used to write to an XML file(web.xml) programmatically

    Hi,
    I wish to write to the web.xml file programmatically.Could anyone point me to the
    API that is to be used.
    I am aware of the API to be used for extracting the node and the tag values - com.bea.p13n.xml.util.DomHelper
    but this class has only getters and I wish to know which API should be used to set
    the xml nodes.
    It is important and am looking forward to pointers.
    Thanks in advance!
    Regards,
    Shikha

    S. Bajaj
    org.w3c.dom Api
    Deepak
    shikha wrote:
    Hi,
    I wish to write to the web.xml file programmatically.Could anyone point me to the
    API that is to be used.
    I am aware of the API to be used for extracting the node and the tag values - com.bea.p13n.xml.util.DomHelper
    but this class has only getters and I wish to know which API should be used to set
    the xml nodes.
    I am unable to find answer to this.
    Looking forward to pointers and help.
    Thanks in advance!
    Regards,
    Shikha

  • Dynamic frame building using the contents of an XML file

    Hello,
    My task is to parse an XML file, which contains various profiles of people. Based on what I read, I will then have to make up the GUI dynamically based on which person is selected. I have decided to use CardLayout and I was wondering if there was any way I could build a dynamic frame in netbeans, using the swing palette that is. Is there anyway I could pass in the frame details (based on a person) and is there a way that Netbeans could build the frame for me?
    Could you guys let me know if this is feasible at all?
    Thanks
    Lexus

    >
    Could you guys let me know if this is feasible at all?>It sure is. The SaverBeans settings dialog does just that, for the XScreenSaver style XML used to configure screensavers. It was developed by Mark Roth using NetBeans.
    Some more information on that component can be found in the [Screensaver configuration files|https://screensavers.dev.java.net/config/] page.
    Edited by: AndrewThompson64 on Dec 27, 2008 12:43 PM

  • How to use JAXP to print a xml file?

    I know that in ProjectX, there is a class called XmlDocument, it can print a xml document. But in JAXP , I cannot find a class like XmlDocument, then how to print a xml file?
    Thanks a lot!

    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.transform(new DOMSource(doc), new StreamResult(new FileOutputStream("c:/temp/myJollyDoc.xml", false)));

  • How to use requestScope in faces-config.xml file?

    a managed-bean need get value from request as its property
    so i configure the manged-bean as below:(use requestScope object)
    <managed-bean>
    <description>this is for item test bean.</description>
    <managed-bean-name> item </managed-bean-name>
    <managed-bean-class> test.Item </managed-bean-class>
    <managed-bean-scope> request </managed-bean-scope>
    <managed-property>
    <property-name>id</property-name>
    <value-ref>requestScope.id</value-ref>
    </managed-property>
    </managed-bean>
    but it didnot work.
    after i restart tomcat with above configure file, it report
    HTTP Status 404 error.
    and seemed that the context donot start...
    if i change the line
    <value-ref>requestScope.id</value-ref>
    to:
    <value>7</value>
    then everything will be OK...but this isnot fit my require.
    any body can help me?
    I use JSF 1.0 beta.

    Rather than starting a new thread, I thought I'd just add on to this one, since it already lays the grounds for my question. I'm using the
    I noticed that my setId() method is being called once during the ApplyRequestValuesPhase, and then again in the UpdateModelValuesPhase. The first time, it sets the ID to null, despite the fact that I'm posting an id to the page. When it comes around the second time, it sets the id properly, and the data is loaded from the database and everything works great. If I'm not posting anything to the page, it is only hit once and the value is null.
    Normally I wouldn't fuss over such small things like this, but there's a bit of a probelm. I have a few buttons which are rendered based on this id. If the id is zero (i.e. null or empty string is passed into the setId() method), I want the add button to appear, else I want the update/delete/cancel buttons to appear. If any of these buttons are false after the ApplyRequestValuesPhase, the button's action will not be executed. In other words, when I'm editing an entry and I press the update button the life cycle goes a little like this...
    Object constructed
    ApplyRequestValuesPhase calls setId(null),add button to be rendered, update/delete/cancel to not be rendered
    // the call to save() is not queued up! (save() is the method associated with the action of my update button)
    UpdateModelValuesPhase calls setId("34"), data loaded from database, add button is not to be rendered, update/delete/cancel are to be rendered
    Since save() is never called, it renders the data loaded from the database, and the update/delete/cancel buttons are shown. So, from the user's perspective... nothing happened other than a page refresh. A.k.a. the update button is broken!
    I can, of course, choose to not update the boolean flags which determine if the buttons are rendered or not when setId() is called with a null. Since the default is to render everything (which was a decision specifically to avoid the buttons not being rendered in the early stages of the JSF life cycle, and the action not being executed). That works when I post an id to the page because it's called a second time and the correct buttons are rendered. The problem is when no parameters are given... it isn't called a second time, so it renders all buttons when I only want it to render the add button.
    So how can I get the values to post during the ApplyRequestValuesPhase? I thought that would be how it would work, but apparently not. Anyone know why it explicitly sets the id to null the first time aroud?
    Here's all you should need...
        <managed-bean>
            <managed-bean-name>dropdownEntry</managed-bean-name>
            <managed-bean-class>org.dc949.bugTrack.DropdownEntry</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
            <managed-property>
                <property-name>id</property-name>
                <value>#{param.id}</value>
            </managed-property>
        </managed-bean>
        public void setId(String id) {
            try {
                this.id = Long.parseLong(id);
                load();  // loads data from DB
            } catch(Exception e) {
                if(id != null && !id.equals(""))
                    log.warn("Unable to convert id from String to long ("+id+")", e);
            if(id != null) {  // this was my solution while I was frusterated that my save method wasn't being called
                if(this.getIdAsLong() == 0) {
                    this.showAdd = true;
                    this.showUpdate = false;
                    this.showDelete = false;
                } else {
                    this.showAdd = false;
                    this.showUpdate = true;
                    this.showDelete = true;
                        <t:div>
                            <h:commandButton id="add" value="Add dropdown entry"
                                             rendered="#{dropdownEntry.showAddButton}"
                                             action="#{dropdownEntry.save}" />
                            <h:commandButton id="update" value="Update dropdown entry"
                                             rendered="#{dropdownEntry.showUpdateButton}"
                                             action="#{dropdownEntry.save}" />
                            <h:commandButton id="delete" value="Delete dropdown entry"
                                             rendered="#{dropdownEntry.showDeleteButton}"
                                             action="#{dropdownEntry.deleteDropdownEntry}" />
                            <h:commandButton id="cancel" value="Cancel"
                                             rendered="#{dropdownEntry.showUpdateButton}"
                                             action="#{dropdownEntry.reset}" immediate="true" />
                        </t:div>I could, and probably will get rid of the showDeleteButton flag and isShowDeleteButton() method and make it like the cancel button since these update/delete/cancel will always be shown/hidden together.
    Edit: Now I feel like a fool. A little clean and build, and it's working perfectly. If any one of the above people read this, I thank you for your help from years past. <img class="emoticon" src="images/emoticons/happy.gif" border="0" alt="" />
    Edited by: AdamNichols on Apr 18, 2008 9:57 PM

  • Using XML file in Java script to create Google Map

    Hello,
    I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have had to explore the internet in order to discover various tutorials and examples that have led me on a positive path.
    Right now I am working on a Google Mash-Up that will incorporate over 14,000 records, which will appear as separate markers that will have pop-up info bubbles with additional info inside (using html), once the marker is clicked.
    Here is the XML script example that is used in the tutorial I am following:
    <markers>
    <marker lat="43.65654" lng="-79.90138" html="Some stuff to display in the<br>First Info Window"
    label="Marker One" />
    <marker lat="43.91892" lng="-78.89231" html="Some stuff to display in the<br>Second Info Window"
    label="Marker Two" />
    <marker lat="43.82589" lng="-79.10040" html="Some stuff to display in the<br>Third Info Window"
    label="Marker Three" />
    </markers>
    ...and this is how it looks when the file is retrieved by the java script and mapped: http://econym.googlepages.com/example_map3.htm
    This is the java script that creates the Google Map. I have emboldened the section of the script that retrieves the data and parses it to create the markers:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA6GoL8P5zqjQlG5A5uM1ETBSUPozAscB0cY3RG8xEGnZyeom4axRySak889rVpvHYRsV4f9OZZzbboA"
    type="text/javascript"></script>
    </head>
    <body onunload="GUnload()">
    <!-- you can use tables or divs for the overall layout -->
    <table border=1>
    <tr>
    <td>
    <div id="map" style="width: 800px; height: 1200px"></div>
    </td>
    <td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
    <div id="side_bar"></div>
    </td>
    </tr>
    </table>
    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
    However, it seems JavaScript is either disabled or not supported by your browser.
    To view Google Maps, enable JavaScript by changing your browser options, and then
    try again.
    </noscript>
    <script type="text/javascript">
    //<![CDATA[
    if (GBrowserIsCompatible()) {
    // this variable will collect the html which will eventualkly be placed in the side_bar
    var side_bar_html = "";
    // arrays to hold copies of the markers used by the side_bar
    // because the function closure trick doesnt work there
    var gmarkers = [];
    var i = 0;
    // A function to create the marker and set up the event window
    function createMarker(point,name,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    // save the info we need to use later for the side_bar
    gmarkers[i] = marker;
    // add a line to the side_bar html
    side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
    i++;
    return marker;
    // This function picks up the click and opens the corresponding info window
    function myclick(i) {
    GEvent.trigger(gmarkers, "click");
    // create the map
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng( 37.251699,-119.604315), 7);
    *// Read the data from testXML2blackpoolformat.xml*
    var request = GXmlHttp.create();
    request.open("GET", "testXML2blackpoolformat.xml", true);
    *request.onreadystatechange = function() {*
    *if (request.readyState == 4) {*
    var xmlDoc = GXml.parse(request.responseText);
    *// obtain the array of markers and loop through it*
    var markers = xmlDoc.documentElement.getElementsByTagName("ConnectoryRecord");
    *for (var i = 0; i < markers.length; i++) {*
    *// obtain the attribues of each marker*
    *var lat = parseFloat(markers[i].getAttribute("lat"));*
    *var lng = parseFloat(markers[i].getAttribute("lng"));*
    var point = new GLatLng(lat,lng);
    *var html = markers[i].getAttribute("html");*
    *var label = markers[i].getAttribute("label");*
    *// create the marker*
    var marker = createMarker(point,label,html);
    map.addOverlay(marker);
    // put the assembled side_bar_html contents into the side_bar div
    document.getElementById("side_bar").innerHTML = side_bar_html;
    request.send(null);
    else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/
    // http://econym.googlepages.com/index.htm
    //]]>
    </script>
    </body>
    </html>
    Here is my delima--
    This is the xml format that I need to use because it can accept the rest of my excel file and loop it through the 14,000+ records to create a functioning xml file. This is just a sample (2 records) of the larger file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <ConnectoryAug2008>
    <ConnectoryRecord>
         <lng>-117.03683</lng>
         <lat>32.944505</lat>
         <ConnectoryID>1</ConnectoryID>
         <Name>$2.95 Guys</Name>
         <StreetAddress>13750 Stowe Drive</StreetAddress>
         <City>Poway</City>
         <State>CA</State>
         <Zip>92064</Zip>
    <Marker>White</Marker>
         <IndustryGroup>Technical Services</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=1</ConnectoryProfileLink>
    </ConnectoryRecord>
    <ConnectoryRecord>
         <lng>-117.272843</lng>
         <lat>33.13337</lat>
         <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <Marker>Orange</Marker>
         <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    </ConnectoryRecord>
    </ConnectoryAug2008>
    This is the tutorial where I found the formatting techniques to successfully create the large xml file that will format/convert my excel file properly: http://www.mrexcel.com/tip064.shtml
    These variables should appear as html in the info bubble:
    <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    The "Marker" variable instructs Google Maps to label the marker with a particular color. I will be so grateful to the person(s) that helps me get through this wall that I have been hitting for a long time. It's very difficult without having the luxury of peers who know about these types of issues.
    Thank you!!

    Here is the relationship: They both contain geographic coordinates that produce a point on a map. I will use the rest of the information in the second xml file (company name, address, link, etc.) to produce the information for the bubble that will pop up once the marker is clicked.
    My problem is that I need to try to keep the second xml file in a relatively similar format, so the rest of my records will still be accepted. If I had a smaller amount of records I could place them directly into the javascript, but because there are so many records, I need to use an xml file that can be retrieved by the java script. I chose to use the second type of xml file because I can easily copy and past the 14,000+ records that are now in excel document.
    After the xml issue is corrected I need to rework the javascript that is now emboldened so that it will read the new xml file correctly. I included the first xml file so that the readers will understand what type of xml format is currently being used to produce the markers in the tutorial map.

Maybe you are looking for

  • Migration assisstant mishap?

    i recently transferred files from my ibook g4, to my new macbook pro. now i have noticed the following problems 1. spotlight is not working properly: i cannot locate music files located in itunes, however spotlight will find other files. i can locate

  • How can you change data on a SQL 2012 application database that uses availability groups from BizTalk server?

    If you use the WCF-SQL adapter it is recommend that you set UseAmbientTransaction to true if you are changing data. I think this requires MSDTC to be enabled on the SQL server that you are changing the data on. (http://msdn.microsoft.com/en-us/librar

  • Parsing Date Problem

    I have date problem that I am finding hard to resolve. Please suggest me what I could do. I want to parse String Date values of formats like "19 Jun 2003" and "19/06/2003" to a Date object. Can I Do it. Thanking in Advance.

  • REP 501 Error

    I'm receiving Oracle report error : "Unable to connect to the specified database", as I want to run a report via the J2EE. While I'm able to retrieve date records with other parts of the application. I think I'm missing a client file which associates

  • Hiding and Unhiding Control Objects

    Is there a way to hide/unhide a dropdown listbox based off the selection of another dropdown listbox?  For example, I have a timeframe dropdownlistbox that contains the values Yearly, Quarterly, Monthly.  To the right of the timeframe listbox are the