Search Results

Search found 15873 results on 635 pages for 'xml deserialization'.

Page 9/635 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • XML serialization query

    - by David Neale
    I have the following XML which needs deserializing/serializing: <instance> <dog> <items> <item> <label>Spaniel</label> </item> </items> </dog> <cat> <items> <item> <label>Tabby</label> </item> </items> </cat> </instance> I cannot change the XML structure. I need to map this to the following class: [Serializable, XmlRoot("instance")] public class AnimalInstance { public string Dog { get; set; } public string Cat { get; set; } } I'm not really sure where to start on this one without manually parsing the XML. I'd like to keep the code as brief as possible. Any ideas? (and no, my project doesn't actually involve cats and dogs).

    Read the article

  • XML to Type - Quick way?

    - by MRFerocius
    Team; How are you doing? Im breaking my head trying to do this that seems simple but I can't figure it out... Suppose I have this XML as a string: <calles> <calle> <nombre>CALLAO AV.</nombre> <altura>1500</altura> <longitud>-58.3918617027</longitud> <latitud>-34.5916734896</latitud> <barrio>Recoleta</barrio> </calle> </calles> And and have this Type I created to map that XML: public class Ubicacion { public string Latitud { get; set; } public string Longitud { get; set; } public string Nombre { get; set; } public string Altura { get; set; } public string Barrio { get; set; } public Ubicacion() { } } I need to take that XML file and create an object with those values... Does somebody know a quick way to do it? with C#? I have been trying this but is not working at all... XElement dir = XElement.Parse(text); Ubicacion informacion = from d in dir.Elements("calle"). select new Ubicacion { Longitud = d.Element("longitud").Value, Latitud = d.Element("latitud").Value, Altura = d.Element("altura").Value, Nombre = d.Element("nombre").Value, Barrio = d.Element("barrio").Value, }; return informacion.Cast<Ubicacion>(); } Any ideas? Thanks!!!

    Read the article

  • XAML Deserialization problem

    - by mrwayne
    Hi, I have a block of XAML of which i'm trying to deserialize. For arguments sake lets say it looks like below. <NS:SomeObject> <NS:SomeObject.SomeProperty> <NS:SomeDifferentObject SomeOtherProp="a value"/> </NS:SomeObject.SomeProperty> </NS:SomeObject> Of which i deserialise using the following code. XamlReader.Load( File.OpenRead( @"c:\SomeFile.xaml")) I have 2 solutions, one i use Unit Testing, and another i have for my web application. When i'm using the unit testing solution, it deserializes fine and works as expected. However, when i try to deserialize using my other project i keep getting an exception like the following. 'NameSpace.SomeObject' value cannot be assigned to property 'SomeProperty' of object 'NameSpace.SomeObject'. Object of Type 'NameSpace.SomeObject' cannot be converted to type 'NameSpace.SomeObject'. It's as if it is getting confused or instantiating 2 different types of objects? Note, i do not have similarly named classes or any sort of namespace conflict. The same codes executes fine in one solution and not the other. The same project files are referenced in both. Please help!

    Read the article

  • XML Schema and element with type string

    - by svick
    I'm trying to create an XML Schema and I'm stuck. It seems I can't define an element with string content. What am I doing wrong? Schema: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ponderka.wz.cz/MusicLibrary0" targetNamespace="http://ponderka.wz.cz/MusicLibrary0"> <xs:element name="music-library"> <xs:complexType> <xs:sequence> <xs:element name="artist" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Document: <?xml version="1.0"?> <music-library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ponderka.wz.cz/MusicLibrary0 data0.xsd" xmlns="http://ponderka.wz.cz/MusicLibrary0"> <artist>a</artist> </music-library> The validator says: Element <artist> is not allowed under element <music-library>. Reason: The following elements are expected at this location (see below) <artist> Error location: music-library / artist Details cvc-model-group: Element <artist> unexpected by type '{anonymous}' of element <music-library>. cvc-elt.5.2.1: The element <music-library> is not valid with respect to the actual type definition '{anonymous}'.

    Read the article

  • C# LINQ to XML missing space character.

    - by Fossaw
    I write an XML file "by hand", (i.e. not with LINQ to XML), which sometimes includes an open/close tag containing a single space character. Upon viewing the resulting file, all appears correct, example below... <Item> <ItemNumber>3</ItemNumber> <English> </English> <Translation>Ignore this one. Do not remove.</Translation> </Item> ... the reasons for doing this are various and irrelevent, it is done. Later, I use a C# program with LINQ to XML to read the file back and extract the record... XElement X_EnglishE = null; // This is CRAZY foreach (XElement i in Records) { X_EnglishE = i.Element("English"); // There is only one damned record! } string X_English = X_EnglishE.ToString(); ... and test to make sure it is unchanged from the database record. I detect a change, when processing Items where the field had the single space character... +E+ Text[3] English source has been altered: Was: >>> <<< Now: >>><<< ... the and <<< parts I added to see what was happening, (hard to see space characters). I have fiddled around with this but can't see why this is so. It is not absolutely critical, as the field is not used, (yet), but I cannot trust C# or LINQ or whatever is doing this, if I do not understand why it is so. So what is doing that and why?

    Read the article

  • HELP with XML to XML transformation using XSLT.

    - by kaniths
    Am a rookie trying XSLT and XML tranformations for the first time. To start off, i tried a simple sample programs. I expected the Output in Tree format (maintaining the hierarchy) instead i just get " KING" in single line... What could be the problem? PS: I use XMLSpy. Any guideline would be great full. Thanks :) Input XML: <ROWSET> <ROW> <EMPNO>7839</EMPNO> <ENAME>KING</ENAME> </ROW> </ROWSET> XSL used for transformation: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/> <xsl:template match="/"> <Invitation> <To> <xsl:value-of select="ROWSET/ROW/ENAME"/> </To> </Invitation> </xsl:template>

    Read the article

  • how to compare the two xml files and update the one xml file in java?

    - by prasad.gai
    I have created two xml files from those xml file i would like to compare one xml file with another xml file and update the xml file. I have created an xml file as follows: main.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#00BFFF"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:visibility="visible"> </LinearLayout> <LinearLayout android:id="@+id/linearLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:visibility="visible"> </LinearLayout> </LinearLayout> </ScrollView> properties.xml <?xml version='1.0' encoding='utf-8' standalone='yes' ?> <map> <int name="linearLayout1" value="8" /> <int name="linearLayout2" value="0" /> </map> from the above two xml files i would like to compare with LinearLayout android:id ="@id/LinearLayout1" from main.xml with int name ="linearLayout1" from properties.xml. from the above properties.xml file where name ="linearLayout1" and value ="8" then i would like to update the main.xml file where as LinearLayout android:id="@id/linearLayout1" propertie value as android:visibility="gone" From the above xml file how can i update main.xml file by comparing properties.xml? please any body help me.....

    Read the article

  • How to parse a custom XML-style error code response from a website

    - by user1870127
    I'm developing a program that queries and prints out open data from the local transit authority, which is returned in the form of an XML response. Normally, when there are buses scheduled to run in the next few hours (and in other typical situations), the XML response generated by the page is handled correctly by the java.net.URLConnection.getInputStream() function, and I am able to print the individual results afterwards. The problem is when the buses are NOT running, or when some other problem with my queries develops after it is sent to the transit authority's web server. When the authority developed their service, they came up with their own unique error response codes, which are also sent as XMLs. For example, one of these error messages might look like this: <Error xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Code>3005</Code> <Message>Sorry, no stop estimates found for given values.</Message> </Error> (This code and similar is all that I receive from the transit authority in such situations.) However, it appears that URLConnection.getInputStream() and some of its siblings are unable to interpret this custom code as a "valid" response that I can handle and print out as an error message. Instead, they give me a more generic HTTP/1.1 404 Not Found error. This problem cascades into my program which then prints out a java.io.FileNotFoundException error pointing to the offending input stream. My question is therefore two-fold: 1. Is there a way to retrieve, parse, and print a custom XML-formatted error code sent by a web service using the plugins that are available in Java? 2. If the above is not possible, what other tools should I use or develop to handle such custom codes as described?

    Read the article

  • Debug Deserialization on Silverlight Client

    - by Andrew Garrison
    I'm working on a Silverlight client that interacts with a WCF web service. The Silverlight client and the WCF web service are using the same class library for their data entities that they are passing back and forth over the wire. I just added a new entity, and it's not being correctly deserialized on the Silverlight client. My question is, how can I debug the System.ServiceModel.ClientBase as it is deserializing an entity that it received from a WCF web service?

    Read the article

  • windows phone deserialization json

    - by user2042227
    I have a weird issue. so I am making a few calls in my app to a webservice, which replies with data. However I am using a token based login system, so the first time the user enters the app I get a token from the webservice to login for that specific user and that token returns only that users details. The problem I am having is when the user changes I need to make the calls again, to get the new user's details, but using visual studio's breakpoint debugging, it shows the new user's token making the call however the problem is when the json is getting deserialized, it is as if it still reads the old data and deserializes that, when I exit my app with the new user it works fine, so its as if it is reading cached values, but I have no idea how to clear it? I am sure the new calls are being made and the problem lies with the deserializing, but I have tried clearing the values before deserializing them again, however nothing works. am I missing something with the json deserializer, how van I clear its cached values? here I make the call and set it not to cache so it makes a new call everytime: client.Headers[HttpRequestHeader.CacheControl] = "no-cache"; var token_details = await client.DownloadStringTaskAsync(uri); and here I deserialize the result, it is at this section the old data gets shown, so the raw json being shown inside "token_details" is correct, only once I deserialize the token_details, it shows the wrong data. deserialized = JsonConvert.DeserializeObject(token_details); and the class I am deserializing into is a simple class nothing special happening here, I have even tried making the constructor so that it clears the values each time it gets called. public class test { public string status { get; set; } public string name{ get; set; } public string birthday{ get; set; } public string errorDes{ get; set; } public test() { status = ""; name= ""; birthday= ""; errorDes= ""; } } uri's before making the calls: {https://whatever.co.za/token/?code=BEBCg==&id=WP7&junk=121edcd5-ad4d-4185-bef0-22a4d27f2d0c} - old call "UBCg==" - old reply {https://whatever.co.za/token/?code=ABCg==&id=WP7&junk=56cc2285-a5b8-401e-be21-fec8259de6dd} - new call "UBCg==" - new response which is the same response as old call as you can see i did attach a new GUID everytime i make the call, but then the new uri is read before making the downloadstringtaskasync method call, but it returns with the old data

    Read the article

  • Deserialization on client side in Domain Service

    - by ankit
    I have 2 classes: Person and Contact. Person class has a property named ContactNumber which returns the Contact type, and this property is marked as a DataMember for serialization. I have marked Contact type as a DataContract. On the client side I am able to get the values, but when I try to insert a value and then do submit, I get the following exception: Failed to deserialize change-set. Failed to convert value of type 'Dictionary`2' to type 'Contact' Stack Trace is: at System.Web.Ria.DataServiceSubmitRequest.GetChangeSet(DomainService domainService) at System.Web.Ria.DataServiceSubmitRequest.Invoke(DomainService domainService) at System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context) Can anyone give me the solution ?

    Read the article

  • deserialization on client sied in Domain Service

    - by ankit
    i have 2 classes. Person and Contact. Person class has property named "ContactNumber" which returns the Contact type, and this property is marked as "Datamember" for serialization. i have marked Contact type as "DAtaContract". on client side i am able to get the values, but when i try to insert a value and then do submit, i get the below exception. Failed to deserialize change-set. Failed to convert value of type 'Dictionary`2' to type 'Contact' Stack Trace is: at System.Web.Ria.DataServiceSubmitRequest.GetChangeSet(DomainService domainService) at System.Web.Ria.DataServiceSubmitRequest.Invoke(DomainService domainService) at System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context) can anyone give me the solution ?

    Read the article

  • Deserialization error in c#

    - by Lily
    Hi When I am deserializing a hierarchy I get the following error The input stream is not a valid binary format. The starting contents (in bytes) are The input stream is not a valid binary format. The starting contents (in bytes) are: 20-01-20-20-20-FF-FF-FF-FF-01-20-20-20-20-20-20-20 ..." Any help please?

    Read the article

  • Java deserialization speed

    - by celicni
    I am writing a Java application that among other things needs to read a dictionary text file (each line is one word) and store it in a HashSet. Each time I start the application this same file is being read all over again (6 Megabytes unicode file). That seemed expensive, so I decided to serialize resulting HashSet and store it to a binary file. I expected my application to run faster after this. Instead it got slower: from ~2,5 seconds before to ~5 seconds after serialization. Is this expected result? I thought that in similar cases serialization should increase speed.

    Read the article

  • Exporting to XML, including embedded classes

    - by Andy
    I have an object config which has some properties. I can export this ok, however, it also has an ArrayList which relates to embedded classes which I can't get to appear when I export to XML. Any pointers would be helpful. Export Method public String exportXML(config conf, String path) { String success = ""; try { FileOutputStream fstream = new FileOutputStream(path); try { XMLEncoder ostream = new XMLEncoder(fstream); try { ostream.writeObject(conf); ostream.flush(); } finally { ostream.close(); } } finally { fstream.close(); } } catch (Exception ex) { success = ex.getLocalizedMessage(); } return success; } Config Class (some detail stripped to keep size down) public class config { protected String author = ""; protected String website = ""; private ArrayList questions = new ArrayList(); public config(){ } public void addQuestion(String name) { questions.add(new question(questions.size(), name)); } public void removeQuestion(int id) { questions.remove(id); for (int c = 0; c <= questions.size(); c++) { question q = (question) (questions.get(id)); q.setId(c); } questions.trimToSize(); } public config.question getQuestion(int id){ return (question)questions.get(id); } /** * There can be multiple questions per config. * Questions store all the information regarding what questions are * asked of the user, including images, descriptions, and answers. */ public class question { protected int id; protected String title; protected ArrayList answers; public question(int id, String title) { this.id = id; this.title = title; } public int getId() { return id; } public void setId(int id) { this.id = id; } public void addAnswer(String name) { answers.add(new answer(answers.size(), name)); } public void removeAnswer(int id) { answers.remove(id); for (int c = 0; c <= answers.size(); c++) { answer a = (answer) (answers.get(id)); a.setId(c); } answers.trimToSize(); } public config.question.answer getAnswer(int id){ return (answer)answers.get(id); } public class answer { protected int id; protected String title; public answer(int id, String title) { this.id = id; this.title = title; } public int getId() { return id; } public void setId(int id) { this.id = id; } } } } Resultant XML File <?xml version="1.0" encoding="UTF-8"?> <java version="1.6.0_18" class="java.beans.XMLDecoder"> <object class="libConfig.config"> <void property="appName"> <string>xxx</string> </void> <void property="author"> <string>Andy</string> </void> <void property="website"> <string>www.example.com/dsx.xml</string> </void> </object> </java>

    Read the article

  • c++ write own xml parser vs using tinyxml

    - by AdityaGameProgrammer
    Hi , I am currently in a task to generate an XML file for an srt text file containing timestamps and corresponding text. To generate an exe file which accepts file name input and outputs the relevant XML file to be used as part of an automated script. Is it Advisable to use Tinyxml for this? Is this a very simple task that can be done with minimal programming? Is this one of those things which are very basic to c++ programmers? reason i am asking this is I have recently made a shift into c++ programming after over 3 years of action script development. Edit: your comments regarding this are very much appreciated what's the easiest way to generate xml in c++?

    Read the article

  • Do dconf use EXI binary XML?

    - by Hibou57
    A question came to my mind reading an answer to the question What are the differences between gconf and dconf?. In an reply to the above question, Oli said: Binary read access is far faster than parsing XML. However, there exist a W3C recommendation for binary XML, since 2010: Efficient XML Interchange (EXI) Format 1.0. Is this what dconf uses? If Yes, where is it confirmed? If No, was there some investigations toward it at some time, and what was the conclusions? Thanks for any tracks, I'm curious to know.

    Read the article

  • How to Send Custom data in ADF/XML format

    - by Kaidul Islam Sazal
    I have built a lead generator form Here which will send email in ADF/XML format.But all I found in internet about ADF that there are limited tags like contact, customer, vendors, vehicle and their corresponding sub tags.I have to send these information via ADF/XML : Your Company Name App Name Description for iTunes and Google Keywords Image or logo for icon First splash page image Second splash page image About Company work schedule List up to 10 services your company provide Company Email Company Phone Company Website Company Facebook Company Youtube Company Twitter Company Google Comments My question is that, how I can send all this data in ADF/XML ? what will be tags for these ? What will be format? I didn't find any specific answers on it in internet.

    Read the article

  • XML ou JSON? (pt-BR)

    - by srecosta
    Depende.Alguns de nós sentem a necessidade de escolher uma nova técnica / tecnologia em detrimento da que estava antes, como uma negação de identidade ou como se tudo que é novo viesse para substituir o que já existe. Chega a parecer, como foi dito num dos episódios de “This Developer’s Life”, que temos de esquecer algo para termos espaço para novos conteúdos. Que temos de abrir mão.Não é bem assim que as coisas funcionam. Eu vejo os colegas abraçando o ASP.NET MVC e condenando o ASP.NET WebForms como o anticristo. E tenho observado a mesma tendência com o uso do JSON para APIs ao invés de XML, como se o XML não servisse mais para nada. Já vi, inclusive, módulos sendo reescritos para trabalhar com JSON, só porque “JSON é melhor” ™.O post continua no meu blog: http://www.srecosta.com/2012/11/22/xml-ou-json/Grande abraço,Eduardo Costa

    Read the article

  • Is there a very simple XML Editor/Viewer?

    - by Paul Spangle
    Part of our support job is to look at XML documents sent to our systems by our clients that have failed to load correctly. I do this by pasting the file in to Visual Studio as an XML file and VS colours it and adds line-breaks, indenting, etc. and it's then usually quite simple to spot the error and manually fix it and resubmit the document. Do I really have to use Visual Studio to do this? OK, it does the job quite well, but I'd have thought that something like Notepad++ would do the job just as well with a fraction of the machine resource usage. Is there are plugin for Notepad++ or another bit of freeware that can make XML look pretty and let me make simple edits?

    Read the article

  • Tool to convert from XML to CSV and back to XML without losing information?

    - by Lanaru
    I would like to convert an XML file into CSV, and then be able to convert that CSV back into the original XML file. Is there a tool out there that makes this possible? The reason I want to do this is that I want to generate a ton of data to be stored in an xml file that my program will parse. I can easily generate a lot of data with a CSV file through the use of Excel macros, so that's why I'm looking for a tool to convert between these two formats. Any alternative suggestions are greatly appreciated.

    Read the article

  • Writing use cases for XML mapping scenarios between two different systems

    - by deepak_prn
    I am having some trouble writing use cases for XML mapping after a certain trigger invoked by the system. For example, one of the scenarios goes: the store cashier sells an item, the transaction data is sent to Data management system. Now, I am writing a functional design for the scenario which deals with mapping XML fields between our system and the data management system. Question : I was wondering if some one had to deal with writing use cases or extension use cases for mapping XML fields between two systems? (There is no XSLT involved) and if you used a table to represent the fields mapping (example is below) or any other visualization tool which does not break the bank ? I searched many questions on SO and here but nothing came close to my requirement.

    Read the article

  • Passing XML markers to Google Map

    - by djmadscribbler
    I've been creating a V3 Google map based on this example from Mike Williams http://www.geocodezip.com/v3_MW_example_map3.html I've run into a bit of a problem though. If I have no parameters in my URL then I get the error "id is undefined idmarkers [id.toLowerCase()] = marker;" in Firebug and only one marker will show up. If I have a parameter (?id=105 for example) then all the sidebar links say 105 (or whatever the parameter in the URL was) instead of their respective label as listed in the XML file and a random infowindow will be opened instead of the window for the id in the URL. Here is my javascript: var map = null; var lastmarker = null; // ========== Read paramaters that have been passed in ========== // Before we go looking for the passed parameters, set some defaults // in case there are no parameters var id; var index = -1; // these set the initial center, zoom and maptype for the map // if it is not specified in the query string var lat = 42.194741; var lng = -121.700301; var zoom = 18; var maptype = google.maps.MapTypeId.HYBRID; function MapTypeId2UrlValue(maptype) { var urlValue = 'm'; switch (maptype) { case google.maps.MapTypeId.HYBRID: urlValue = 'h'; break; case google.maps.MapTypeId.SATELLITE: urlValue = 'k'; break; case google.maps.MapTypeId.TERRAIN: urlValue = 't'; break; default: case google.maps.MapTypeId.ROADMAP: urlValue = 'm'; break; } return urlValue; } // If there are any parameters at eh end of the URL, they will be in location.search // looking something like "?marker=3" // skip the first character, we are not interested in the "?" var query = location.search.substring(1); // split the rest at each "&" character to give a list of "argname=value" pairs var pairs = query.split("&"); for (var i = 0; i < pairs.length; i++) { // break each pair at the first "=" to obtain the argname and value var pos = pairs[i].indexOf("="); var argname = pairs[i].substring(0, pos).toLowerCase(); var value = pairs[i].substring(pos + 1).toLowerCase(); // process each possible argname - use unescape() if theres any chance of spaces if (argname == "id") { id = unescape(value); } if (argname == "marker") { index = parseFloat(value); } if (argname == "lat") { lat = parseFloat(value); } if (argname == "lng") { lng = parseFloat(value); } if (argname == "zoom") { zoom = parseInt(value); } if (argname == "type") { // from the v3 documentation 8/24/2010 // HYBRID This map type displays a transparent layer of major streets on satellite images. // ROADMAP This map type displays a normal street map. // SATELLITE This map type displays satellite images. // TERRAIN This map type displays maps with physical features such as terrain and vegetation. if (value == "m") { maptype = google.maps.MapTypeId.ROADMAP; } if (value == "k") { maptype = google.maps.MapTypeId.SATELLITE; } if (value == "h") { maptype = google.maps.MapTypeId.HYBRID; } if (value == "t") { maptype = google.maps.MapTypeId.TERRAIN; } } } // this variable will collect the html which will eventually be placed in the side_bar var side_bar_html = ""; // arrays to hold copies of the markers and html used by the side_bar // because the function closure trick doesnt work there var gmarkers = []; var idmarkers = []; // global "map" variable var map = null; // A function to create the marker and set up the event window function function createMarker(point, icon, label, html) { var contentString = html; var marker = new google.maps.Marker({ position: point, map: map, title: label, icon: icon, zIndex: Math.round(point.lat() * -100000) << 5 }); marker.id = id; marker.index = gmarkers.length; google.maps.event.addListener(marker, 'click', function () { lastmarker = new Object; lastmarker.id = marker.id; lastmarker.index = marker.index; infowindow.setContent(contentString); infowindow.open(map, marker); }); // save the info we need to use later for the side_bar gmarkers.push(marker); idmarkers[id.toLowerCase()] = marker; // add a line to the side_bar html side_bar_html += '<a href="javascript:myclick(' + (gmarkers.length - 1) + ')">' + id + '<\/a><br>'; } // This function picks up the click and opens the corresponding info window function myclick(i) { google.maps.event.trigger(gmarkers[i], "click"); } function makeLink() { var mapinfo = "lat=" + map.getCenter().lat().toFixed(6) + "&lng=" + map.getCenter().lng().toFixed(6) + "&zoom=" + map.getZoom() + "&type=" + MapTypeId2UrlValue(map.getMapTypeId()); if (lastmarker) { var a = "/about/map/default.aspx?id=" + lastmarker.id + "&" + mapinfo; var b = "/about/map/default.aspx?marker=" + lastmarker.index + "&" + mapinfo; } else { var a = "/about/map/default.aspx?" + mapinfo; var b = a; } document.getElementById("idlink").innerHTML = '<a href="' + a + '" id=url target=_new>- Link directly to this page by id</a> (id in xml file also entry &quot;name&quot; in sidebar menu)'; document.getElementById("indexlink").innerHTML = '<a href="' + b + '" id=url target=_new>- Link directly to this page by index</a> (position in gmarkers array)'; } function initialize() { // create the map var myOptions = { zoom: zoom, center: new google.maps.LatLng(lat, lng), mapTypeId: maptype, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, navigationControl: true, mapTypeId: google.maps.MapTypeId.HYBRID }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var stylesarray = [ { featureType: "poi", elementType: "labels", stylers: [ { visibility: "off" } ] }, { featureType: "landscape.man_made", elementType: "labels", stylers: [ { visibility: "off" } ] } ]; var options = map.setOptions({ styles: stylesarray }); // Make the link the first time when the page opens makeLink(); // Make the link again whenever the map changes google.maps.event.addListener(map, 'maptypeid_changed', makeLink); google.maps.event.addListener(map, 'center_changed', makeLink); google.maps.event.addListener(map, 'bounds_changed', makeLink); google.maps.event.addListener(map, 'zoom_changed', makeLink); google.maps.event.addListener(map, 'click', function () { lastmarker = null; makeLink(); infowindow.close(); }); // Read the data from example.xml downloadUrl("example.xml", function (doc) { var xmlDoc = xmlParse(doc); var markers = xmlDoc.documentElement.getElementsByTagName("marker"); 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 google.maps.LatLng(lat, lng); var html = markers[i].getAttribute("html"); var label = markers[i].getAttribute("label"); var icon = markers[i].getAttribute("icon"); // create the marker var marker = createMarker(point, icon, label, html); } // put the assembled side_bar_html contents into the side_bar div document.getElementById("side_bar").innerHTML = side_bar_html; // ========= If a parameter was passed, open the info window ========== if (id) { if (idmarkers[id]) { google.maps.event.trigger(idmarkers[id], "click"); } else { alert("id " + id + " does not match any marker"); } } if (index > -1) { if (index < gmarkers.length) { google.maps.event.trigger(gmarkers[index], "click"); } else { alert("marker " + index + " does not exist"); } } }); } var infowindow = new google.maps.InfoWindow( { size: new google.maps.Size(150, 50) }); google.maps.event.addDomListener(window, "load", initialize); And here is an example of my XML formatting <marker lat="42.196175" lng="-121.699224" html="This is the information about 104" iconimage="/about/map/images/104.png" label="104" />

    Read the article

  • XML: Having trouble solving this XML error here..

    - by Capsud
    Hi i'm getting these errors Multiple annotations found at this line: - error: Error parsing XML: not well-formed (invalid token) - Content is not allowed in trailing section. on this XML file... <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:drawable="@drawable/btn_red"> </item> <item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/btn_orange"> </item> <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/btn_orange"> </item> <item android:state_enabled="true" android:drawable="@drawable/btn_black"> </item> probably quite simple for you people who know XML. Can you help me please? Thanks.

    Read the article

  • create and modify xml file using javascript (want to save xml file on client side)

    - by user201478
    Hi , How to save xml file on client side using javascript...? if (window.XMLHttpRequest) { xhttp = new XMLHttpRequest(); } else // Internet Explorer 5/6 { xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET", "User.xml", false); xhttp.send(""); xmlDoc = xhttp.responseXML; xmlDoc.getElementsByTagName("Username")[0].childNodes[0].nodeValue = 'asdasf'; xmlDoc.getElementsByTagName("password")[0].childNodes[0].nodeValue = 'asdAS'; xmlDoc.getElementsByTagName("UserId")[0].childNodes[0].nodeValue = '12'; xmlDoc.save("User.xml"); this is not working.. showing error as save is not a function. Thanks Suneetha.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >