Search Results

Search found 30815 results on 1233 pages for 'build xml'.

Page 74/1233 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • how to remove empty tags in input xml

    - by SGB
    My java module gets a huge input xml from a mainframe. Unfortunately, the mainframe is unable to skip optional elements when it is not a leaf node, with the result that I get a LOT of empty tags in my input : So, <pre><code><SSN>111111111</SSN> <Employment> <Current> <Address> <line1/> <line2/> <line3/> <city/> <state/> <country/> </Address> <Phone> <phonenumber/> <countryCode/> </Phone> </Current> <Previous> <Address> <line1/> <line2/> <line3/> <city/> <state/> <country/> </Address> <Phone> <phonenumber/> <countryCode/> </Phone> </Previous> </Employment> <MaritalStatus>Single</MaritalStatus> </code></pre> should be <SSN>111111111</SSN> <MaritalStatus>Single</MaritalStatus> I use jaxb to unmarshall the input xml string that the mainframe sends it. Is there a clean/ easy way to remove all the empty group tags, or do I have to do this manuall in the code for each element. I have over 35 elements in my input xml, so I would love to it if jaxb itself had a way of doing this automatically? Thanks, SGB

    Read the article

  • bloated jquery xml requests

    - by Tim Joyce
    Hi, I was wondering if anyone had an alternative to this. $(xml).find("a").each(function(){ $(this).find('b').each(function(){ $(this).find('c').each(function(){ $(this).find('d1').each(function(){ sectionValidation.RegisterTerms.setRegisterTermsArray(this); }); $(this).find('d2').each(function(){ sectionValidation.RegisterTerms.checkValidVariations(this, val); }); }); }); }); It seems really bloated and there has to be a more elegant approach to getting nested xml data. Thank you

    Read the article

  • Parsing XML wont display all items.

    - by Nauman A
    I have this code but the toast wont display any message what is wrong with my code.. I can get the value from link, linknext but title wont bring out any value. ( I am not very bright with writing code so please suggest anything you may feel like. final Button button = (Button) findViewById(R.id.Button01); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Perform action on click try { URL url = new URL( "http://somelink.com=" + Link.setFirst_link); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(new InputSource(url.openStream())); doc.getDocumentElement().normalize(); NodeList nodeList = doc.getElementsByTagName("item"); /** Assign textview array lenght by arraylist size */ for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); Element fstElmnt = (Element) node; NodeList nameList = fstElmnt.getElementsByTagName("link"); Element nameElement = (Element) nameList.item(0); nameList = nameElement.getChildNodes(); String img = (((Node) nameList.item(0)).getNodeValue()); NodeList websiteList = fstElmnt.getElementsByTagName("linknext"); Element websiteElement = (Element) websiteList.item(0); websiteList = websiteElement.getChildNodes(); String nextlink = (((Node) websiteList.item(0)).getNodeValue()); Link.setFirst_link = nextlink; Drawable drawable = LoadImageFromWebOperations(img); imgView.setImageDrawable(drawable); NodeList titleList = fstElmnt.getElementsByTagName("title"); Element titleElement = (Element) titleList.item(0); websiteList = titleElement.getChildNodes(); String title = (((Node) titleList.item(0)).getNodeValue()); Context context = getApplicationContext(); CharSequence text = title; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show(); } } catch (Exception e) { System.out.println("XML Pasing Excpetion = " + e); } } }); /** Set the layout view to display */ } Here is the xml file <?xml version="1.0"?> <maintag> <item> <link>http://image.com/357769.jpg?40</link> <linknext>http://www.image.com</linknext> <title>imagename</title> </item> </maintag>

    Read the article

  • PHP Xml add edit delete

    - by user560411
    Hi there. I am kind of new and I have the following XML structure an I would like to have codes that INSERTS DELETES Delete an entire element based on it's TITLE value. EDIT Replace Publisher's value with another value <Game type="XXX"> <TITLE>XXX</TITLE> <PUBLISHER>XXX</PUBLISHER> </Game> This is my XML structure <Game type="adventure"> <TITLE>Assassin's Creed: Brotherhood</TITLE> <PUBLISHER>Ubisoft</PUBLISHER> </Game> <Game type="adventure"> <TITLE>Batman: Arkham Asylum</TITLE> <PUBLISHER>Eidos</PUBLISHER> </Game> </GameStore> Any help would be great and thank you in avdance!

    Read the article

  • dynamically updating a datagrid from a XML file c# 3.5

    - by Farstucker
    I have a datagrid that is populated via XML file when the form loads. Everything is working great but I would like the datagrid to update dynamically when a new order is received (Separate class receives a data stream and updates the file). Im looking for suggestions on how this should be done. (ie using a timer update every second, or monitor the file using FileSystemWatcher.. etc) Since where here, I might as well mention that in order to update the datagrid Im clearing the whole data set and Re-reading the file using: DataSet.Clear(); DataSet.ReadXml("file.xml"); dataGridView1.DataSource = DataSet; if this is not the proper approach, please offer any alternate suggestions.

    Read the article

  • Search relevance from XML docs (XQuery?) vs MySQL

    - by Marius
    Hello there, I have a website where documents are saved in xml documents, all with the same structure. I need a search engine where I am able to choose documents with the highest relevance according to the key words given by a searching user. I thought it could (?) be a good idea to have one using XQuery rather than having the information stored twice (in XML docs + mysql database) and querying the mysql database for relevance searches. Is XQuery any good for this, and how, and what speed can I expect on +1000 documents of about 7kb each. Thank you for your time. Kind regards

    Read the article

  • Validate an XML File Against Multiple Schema Definitions

    - by Jon
    I'm trying to validate an XML file against a number of different schemas (apologies for the contrived example): a.xsd b.xsd c.xsd c.xsd in particular imports b.xsd and b.xsd imports a.xsd, using: <xs:include schemaLocation="b.xsd"/> I'm trying to do this via Xerces in the following manner: XMLSchemaFactory xmlSchemaFactory = new XMLSchemaFactory(); Schema schema = xmlSchemaFactory.newSchema(new StreamSource[] { new StreamSource(this.getClass().getResourceAsStream("a.xsd"), "a.xsd"), new StreamSource(this.getClass().getResourceAsStream("b.xsd"), "b.xsd"), new StreamSource(this.getClass().getResourceAsStream("c.xsd"), "c.xsd")}); Validator validator = schema.newValidator(); validator.validate(new StreamSource(new StringReader(xmlContent))); but this is failing to import all three of the schemas correctly resulting in cannot resolve the name 'blah' to a(n) 'group' component. I've validated this successfully using Python, but having real problems with Java 6.0 and Xerces 2.8.1. Can anybody suggest what's going wrong here, or an easier approach to validate my XML documents?

    Read the article

  • Validating XML with multiple XSDs in Java

    - by Arian
    Hello! I want to parse an XML file with Java and validate it in the same step against an XSD schema. An XML file may contain content of several schemas, like this: <outer xmlns="my.outer.namespace" xmlns:x="my.third.namespace"> <foo>hello</foo> <inner xmlns="my.inner.namespace"> <bar x:id="bar">world</bar> </inner> </outer> Given a namespace the corresponding xsd file can be provided, but the used namespaces are unknown before parsing. If a schema defines default values for attributes, I also want to know that somehow. I was able to validate a file if the schemas are known, I was able to parse a file without validation and I implemented a LSResourceResolver. However, I can't get all of it working together. How do I have to set up my (SAX) parser?

    Read the article

  • VB.NET looping through XML to store in singleton

    - by rockinthesixstring
    I'm having a problem with looping through an XML file and storing the value in a singleton My XML looks like this <values> <value></value> <value>$1</value> <value>$5,000</value> <value>$10,000</value> <value>$15,000</value> <value>$25,000</value> <value>$50,000</value> <value>$75,000</value> <value>$100,000</value> <value>$250,000</value> <value>$500,000</value> <value>$750,000</value> <value>$1,000,000</value> <value>$1,250,000</value> <value>$1,500,000</value> <value>$1,750,000</value> <value>$2,000,000</value> <value>$2,500,000</value> <value>$3,000,000</value> <value>$4,000,000</value> <value>$5,000,000</value> <value>$7,500,000</value> <value>$10,000,000</value> <value>$15,000,000</value> <value>$25,000,000</value> <value>$50,000,000</value> <value>$100,000,000</value> <value>$100,000,000+</value> </values> And my function looks like this Public Class LoadValues Private Shared SearchValuesInstance As List(Of SearchValues) = Nothing Public Shared ReadOnly Property LoadSearchValues As List(Of SearchValues) Get Dim sv As New List(Of SearchValues) If SearchValuesInstance Is Nothing Then Dim objDoc As XmlDocument = New XmlDataDocument Dim objRdr As XmlTextReader = New XmlTextReader(HttpContext.Current.Server.MapPath("~/App_Data/Search-Values.xml")) objRdr.Read() objDoc.Load(objRdr) Dim root As XmlElement = objDoc.DocumentElement Dim itemNodes As XmlNodeList = root.SelectNodes("/values") For Each n As XmlNode In itemNodes sv.Add(New SearchValues(n("@value").InnerText, n("@value").InnerText)) Next SearchValuesInstance = sv Else : sv = SearchValuesInstance End If Return sv End Get End Property End Class My problem is that I'm getting an object not set to an instance of an object on the sv.Add(New SearchValues(n("@value").InnerText, n("@value").InnerText)) line.

    Read the article

  • Is there a good Open Source xml ide?

    - by Paul Butcher
    I've looked around, and I'm surprised that I can't find an Open Source equivalent to Oxygen or XMLSpy. i.e. A rich XML editor with support for diverse types of validation, XSLT debugging and profiling, and all the other extra bits that make it more than just a text editor with syntax highlighting. I've seen a few (like Jaxe), that that offer different ways to edit xml documents, but nothing that rolls it all up into an IDE-like application. I'm sure this means I've missed some very worthy project. Can anyone point me towards such a thing?

    Read the article

  • Add database to plesk domain account via XML

    - by Ryan French
    Hi All, I'm currently working on trying to integrate a site with Plesk via the XML API and I've run into a bit of an issue. I've managed to get most things working but I'm trying to add a database to a domain and I keep getting an error. When creating the database I extract a list of Domain Accounts associated with the current clients account, and use the domain guid that is returned in the XML to try and create the new database, but Plesk is returning an error stating that the id I am using is not a valid id. I've looked at the documentation and it is saying that the domain ID that I should be sending is an integer, but the only ID I can find for the domain is the guid, which is a string. Anyone done anything like this before and know where I can get the ID from?

    Read the article

  • Using JavaScript to parse an XML file

    - by Chris Clouten
    I am new to Stack OverFlow and coding in general. I am trying to take an XML file and render it in the browser using JavaScript. I have looked around at some sample code of how to do this and came up with the following code: <!DOCTYPE html> <html> <body> <script> 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","social.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; document.write("<table border='1'>"); var x=xmlDoc.getElementsByTagName("CD"); for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x[i].getElementsByTagName("c_id")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x[i].getElementsByTagName("facebook_id")[0].childNodes[0].nodeValue); document.write("</td></tr>"); } document.write("</table>"); </script> </body> </html> Anyway, when I run this on my local server none of the data that I am trying to display in the table appears. My .html file and .xml file are in the same folder, so I believe I have the correct file pathway. I could just be making a rookie mistake here, but I can't for the life of me figure out why a table listing the c_id and facebook_id values is not being created. I looked around for answers and haven't been able to find any. Any help would be greatly appreciated. Thanks!

    Read the article

  • Inheritance in XML Schema definition (XSD) for Java objects

    - by bguiz
    Hi, I need to create an XML schema definition (XSD) that describes Java objects. I was wondering how to do this when the objects in question inherit from a common base class with a type parameter. public abstract class Rule<T> { ... } public abstract class TimeRule extends Rule<XTime> { ... } public abstract class LocationRule extends Rule<Location> { ... } public abstract class IntRule extends Rule<Integer> { ... } .... (where XTime and Location are custom classes define elsewhere) How would I go about constructing an XSD that such that I can have XML nodes that represent each of the subclasses of Rule<T> - without the XSD for each of them repeating their common contents? Thank you!

    Read the article

  • Linq to XML query returining a list of strings

    - by objectsbinding
    Hi all, I have the following class public class CountrySpecificPIIEntity { public string Country { get; set; } public string CreditCardType { get; set; } public String Language { get; set; } public List<String> PIIData { get; set; } } I have the following XML that I want to query using Linq-to-xml and shape in to the class above <?xml version="1.0" encoding="utf-8" ?> <piisettings> <piifilter country="DE" creditcardype="37" language="ALL" > <filters> <filter>FIRSTNAME</filter> <filter>SURNAME</filter> <filter>STREET</filter> <filter>ADDITIONALADDRESSINFO</filter> <filter>ZIP</filter> <filter>CITY</filter> <filter>STATE</filter> <filter>EMAIL</filter> </filters> </piifilter> <piifilter country="DE" creditcardype="37" Language="en" > <filters> <filter>EMAIL</filter> </filters> </piifilter> </piisettings> I'm using the following query but I'm having trouble with the last attribute i.e. PIIList. var query = from pii in xmlDoc.Descendants("piifilter") select new CountrySpecificPIIEntity { Country = pii.Attribut("country").Value, CreditCardType = pii.Attribute("creditcardype").Value, Language = pii.Attribute("Language").Value, PIIList = (List<string>)pii.Elements("filters") }; foreach (var entity in query) { Debug.Write(entity.Country); Debug.Write(entity.CreditCardType); Debug.Write(entity.Language); Debug.Write(entity.PIIList); } How Can I get the query to return a List to be hydrated in to the PIIList property.

    Read the article

  • How cast in XML for aggregate functions

    - by renegm
    In SQL Server 2008. I need execute a query like that: DECLARE @x AS xml SET @x=N'<r><c>First Text</c></r><r><c>Other Text</c></r>' SELECT @x.query('fn:max(r/c)') But return nothing (apparently because convert xdt:untypedAtomic to numeric) How to "cast" r/c to varchar? Something like SELECT @x.query('fn:max(«CAST(r/c «AS varchar(20))»)') Edit: Using Nodes the function MAX is from T-SQL no fn:max function In this code: DECLARE @x xml; SET @x = ''; SELECT @x.query('fn:max((1, 2))'); SELECT @x.query('fn:max(("First Text", "Other Text"))'); both query return expected: 2 and "Other Text" fn:max can evaluate string expression ad hoc. But the first query dont work. How to force string arguments to fn:max?

    Read the article

  • XML cdata tgas being erased when there's input in Russian

    - by Uri
    Hello, I have a very strange problem which I will be very thankful if someone would help me with. I have a form that has a textarea whose content is later transferred to a page that has a line like this (using DOM with php to change data on an XML file): $dom-getElementsByTagName("page")-item($itemNum)-getElementsByTagName("lang")-item(1)-getElementsByTagName("text")-item(0)-firstChild-data=$_POST['rus0']; The XML file in question looks like this: The strange thing happens when I upload it to the server and try to input Russian text, in which case it erases the CDATA completely and results in And, weirdly, the thing works fine on my own server emulator (I'm using MAMP with php 5, the remote server also has php 5) - in my machine inputing Russian works fine. Any ideas what's going on in this?

    Read the article

  • linq to xml and namespaces

    - by scott
    I'm always so excited to get a chance to use linq to xml and then I run into the same PITA issue with namespaces. Not sure what is wrong with me but I can never quite grok what is going on. Basically I just need to get the value of the responseCode element and so far I have had no luck :( <?xml version="1.0" encoding="IBM437"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:ActionResponse xmlns:ns1="http://cbsv.ssa.gov/ws/datatype"> <ns1:responseCode>0000</ns1:responseCode> <ns1:responseDescription>Successful</ns1:responseDescription> </ns1:ActionResponse> </soapenv:Body> </soapenv:Envelope>

    Read the article

  • Select more then one node from XML using LINQ

    - by podeig
    I have such XML <root> <content> .... </content> <index> .... </index> <keywords> .... </keywords> </root> But I need to select just and nodes. <content> .... </content> <index> .... </index> I found out how to select just one node. XElement Content = new XElement("content", from el in xml.Elements() select el.Element("content").Elements()); How can I get both nodes?

    Read the article

  • parsing xml attribute value

    - by vbNewbie
    I have been parsing xml content using the xmlreader and cannot use the xml document but so far it works getting all elementcontent except for the attribute contents. I need to parse the link below found in the following entry; <title>XXXX UUUUUU posted a</title> <category term="NotePosted" label="Note Posted"/> <link rel="alternate" type="html" href="http://www.dfsddsfdsf.com/profile.php?id=sdfdfsfdsdfddfsfd&amp;v=wall&amp;story_dbid=dssdfasdfdasfdsafafafa"/> <source>......... <source> I need the href tag in the link attribute but it keeps coming back null. While ureader.Read If ureader.HasAttributes Then fId = ureader.GetAttribute("href") If fId.Contains("?v=wall&amp") Then fIdList.Add(fId) Exit While End If If String.IsNullOrEmpty(fId) Then fId = "NOTHING" End If End If End While

    Read the article

  • In python writing from XML to CSV, encoding error

    - by user574435
    Hi, I am trying to convert an XML file to CSV, but the encoding of the XML ("ISO-8859-1") apparently contains characters that are not in the ascii codec which Python uses to write rows. I get the error: Traceback (most recent call last): File "convert_folder_to_csv_PLAYER.py", line 139, in <module> xml2csv_PLAYER(filename) File "convert_folder_to_csv_PLAYER.py", line 121, in xml2csv_PLAYER fout.writerow(row) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 4: ordinal not in range(128) I have tried opening the file as follows: dom1 = parse(input_filename.encode( "utf-8" ) ) and I have tried replacing the \xe1 character in each row before it is written. Any suggestions?

    Read the article

  • Replace existing XML file within iPhone app

    - by Chonch
    Hey, I have an .xml file that is going to be shipped within my app. This file contains values that are read from it and saved as an array when the app launches. Each time the app is run, I want to check with the server if there is an internet connection. If so, I want to get the newest version of the .xml file from the server and replace the one that I currently have saved in my app (this way, the next time the user logs in and doesn't have internet access, he/she will be able to use the old (yet most up to date) data). What is the best way to do this? Thanks,

    Read the article

  • representing an XML config file with an IXmlSerializable class

    - by Sarah Vessels
    I'm writing in C# and trying to represent an XML config file through an IXmlSerializable class. I'm unsure how to represent the nested elements in my config file, though, such as logLevel: <?xml version="1.0" encoding="utf-8" ?> <configuration> <logging> <logLevel>Error</logLevel> </logging> <credentials> <user>user123</user> <host>localhost</host> <password>pass123</password> </credentials> <credentials> <user>user456</user> <host>my.other.domain.com</host> <password>pass456</password> </credentials> </configuration> There is an enum called LogLevel that represents all the possible values for the logLevel tag. The tags within credentials should all come out as strings. In my class, called DLLConfigFile, I had the following: [XmlElement(ElementName="logLevel", DataType="LogLevel")] public LogLevel LogLevel; However, this isn't going to work because <logLevel> isn't within the root node of the XML file, it's one node deeper in <logging>. How do I go about doing this? As for the <credentials> nodes, my guess is I will need a second class, say CredentialsSection, and have a property such as the following: [XmlElement(ElementName="credentials", DataType="CredentialsSection")] public CredentialsSection[] AllCredentials; Edit: okay, I tried Robert Love's suggestion and created a LoggingSection class. However, my test fails: var xs = new XmlSerializer(typeof(DLLConfigFile)); using (var stream = new FileStream(_configPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { using (var streamReader = new StreamReader(stream)) { XmlReader reader = new XmlTextReader(streamReader); var file = (DLLConfigFile)xs.Deserialize(reader); Assert.IsNotNull(file); LoggingSection logging = file.Logging; Assert.IsNotNull(logging); // fails here LogLevel logLevel = logging.LogLevel; Assert.IsNotNull(logLevel); Assert.AreEqual(EXPECTED_LOG_LEVEL, logLevel); } } The config file I'm testing with definitely has <logging>. Here's what the classes look like: [Serializable] [XmlRoot("logging")] public class LoggingSection : IXmlSerializable { public XmlSchema GetSchema() { return null; } [XmlElement(ElementName="logLevel", DataType="LogLevel")] public LogLevel LogLevel; public void ReadXml(XmlReader reader) { LogLevel = (LogLevel)Enum.Parse(typeof(LogLevel), reader.ReadString()); } public void WriteXml(XmlWriter writer) { writer.WriteString(Enum.GetName(typeof(LogLevel), LogLevel)); } } [Serializable] [XmlRoot("configuration")] public class DLLConfigFile : IXmlSerializable { [XmlElement(ElementName="logging", DataType="LoggingSection")] public LoggingSection Logging; }

    Read the article

  • Why my WCF Service returns xml serialized objects?

    - by user294554
    Hi, I'm new here and I hope anyonte can help me. I have WCF Service and Windows Forms working with this client written in VB.NET. The Service class started to return xml serialized objects, but all my classes on Service side are DataContract-s and the service class is DataContractFormat. I googled everywhere about serializations and I couldn't find reason why it started to do that. I checked my classes and service, app.config file, but I couldn't find anything. I checked Reference.vb class, and it's System.Xml.Serialization.XmlElementAttribute everywhere. The question may seem dummy, but I really don't know what to do. I just want to know what can cause the service to act like that. Thank you.

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >