Search Results

Search found 58802 results on 2353 pages for 'system xml'.

Page 76/2353 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • Convert XML to TCL Object

    - by pws5068
    Greetings, I'm new to TCL scripting, and I have a very very basic xml file which I need to import information from into tcl. Example of XML Document Structure: <object> <type>Hardware</type> <name>System Name</name> <description>Basic Description of System.</description> <attributes> <vendor>Dell</vendor> <contract>MM/DD/YY</contract> <supportExpiration>MM/DD/YY</supportExpiration> <location>Building 123</location> <serial>xxx-xxx-xxxx</serial> <mac>some-mac-address</mac> </attributes> </object> Etc... I've seen something called TCLXML but I'm not sure if this is the best route or even how to create the package to use it.. Any help will be greatly appreciated.

    Read the article

  • Java: Ignoring escapes when parsing XML

    - by Personman
    I'm using a DocumentBuilder to parse XML files. However, the specification for the project requires that within text nodes, strings like " and < be returned literally, and not turned into the corresponding ASCII values. A previous similar question, http://stackoverflow.com/questions/1979785/read-escaped-quote-as-escaped-quote-from-xml, received one answer that seems to be specific to Apache, and another that appears to simply not not do what it says it does. I'd love to be proven wrong on either count, however :) For reference, here is some code: file = new File(fileName); DocBderFac = DocumentBuilderFactory.newInstance(); DocBder = DocBderFac.newDocumentBuilder(); doc = DocBder.parse(file); NodeList textElmntLst = doc.getElementsByTagName(text); Element textElmnt = (Element) textElmntLst.item(0); NodeList txts = textElmnt.getChildNodes(); String txt = ((Node) txts.item(0)).getNodeValue(); System.out.println(txt); I would like that println() to produce things like &quot;3&gt;2&quot; instead of "3>2" which is what currently happens. Thanks!

    Read the article

  • Validating and filling default values in XML based on XSD in Python

    - by PoltoS
    I have an XML like <a> <b/> <b c="2"/> </a> I have my XSD <xs:element name="a"> <xs:complexType> <xs:sequence> <xs:element name="b" maxOccurs="unbounded"> <xs:attribute name="c" default="1"/> </xs:element> </xs:sequence> </xs:complexType> </xs:element> I want to use my XSD to validate my original XML and fill all default values: <a> <b c="1"/> <b c="2"/> </a> How do I get it in Python? With validation there is no problem (e.g. XMLSchema). The problem are the default values.

    Read the article

  • How do I make a serialization class for this?

    - by chobo2
    I have something like this (sorry for the bad names) <root xmlns="http://www.domain.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.Domain.com Schema.xsd> <product></product> <SomeHighLevelElement> <anotherElment> <lowestElement> </lowestElement> </anotherElment> </SomeHighLevelElement> </root> I have something like this for my class public class MyClass { public MyClass() { ListWrapper= new List<UserInfo>(); } public string product{ get; set; } public List<SomeHighLevelElement> ListWrapper{ get; set; } } public class SomeHighLevelElement { public string lowestElement{ get; set; } } But I don't know how to write the code for the "anotherElement" not sure if I have to make another wrapper around it. Edit I know get a error in my actual xml file. I have this in my tag xmlns="http://www.domain.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.Domain.com Schema.xsd Throws an exception on the root line saying there was a error with this stuff. So I don't know if it is mad at the schemaLocation since I am using local host right now or what.

    Read the article

  • Send SOAP XML via curl, PHP

    - by danrichardson
    Hi. This has been bugging me for days, i'm trying to send a SOAP post via curl but i just keep getting a 'couldn't connect to host' error but i really cant see how. I have an asp version which works fine with the same url and data, i think it's just a php/curl thing...? I currently have the following code (the CURLOPT_POSTFIELDS data is a valid soap envelope string) $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "https://xxx.yyy.com:517/zzz.asmx" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, '<soap:Envelope>...</soap:Envelope>'); curl_setopt($soap_do, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length: '.strlen('<soap:Envelope>...</soap:Envelope>') )); if(curl_exec($soap_do) === false) { $err = 'Curl error: ' . curl_error($soap_do); curl_close($soap_do); return $err; } else { curl_close($soap_do); return 'Operation completed without any errors'; } So any ideas why it just errors all the time? The asp version works fine! The code is; Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP") xmlhttp.Open "POST","https://xxx.yyy.com:517/zzz.asmx" xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8" xmlhttp.Send('<soap:Envelope>...</soap:Envelope>')

    Read the article

  • PHP/XPath: Iterating through ancestor nodes in XML using SimpleXML

    - by StackOverflowNewbie
    I need to loop through the Ancestors nodes in order to get corresponding BrowseNodeId and Name values. How do I do this using XPath? I'm trying something like the the following, but it's not working: //BrowseNode[1]//Ancestors[1]/BrowseNode/BrowseNodeId/text() //BrowseNode[1]//Ancestors[1]/BrowseNode/Name/text() I think the //Ancestors part of the XPath is actually searching the entire XML tree. What I need to do is visit each node to get the needed values. How do I do this? In the example below, I want: Europe - History - Subjects - Books. Example XML: <BrowseNode> <BrowseNodeId>4952</BrowseNodeId> <Name>France</Name> <Ancestors> <BrowseNode> <BrowseNodeId>4935</BrowseNodeId> <Name>Europe</Name> <Ancestors> <BrowseNode> <BrowseNodeId>9</BrowseNodeId> <Name>History</Name> <Ancestors> <BrowseNode> <BrowseNodeId>1000</BrowseNodeId> <Name>Subjects</Name> <IsCategoryRoot>1</IsCategoryRoot> <Ancestors> <BrowseNode> <BrowseNodeId>283155</BrowseNodeId> <Name>Books</Name> </BrowseNode> </Ancestors> </BrowseNode> </Ancestors> </BrowseNode> </Ancestors> </BrowseNode> </Ancestors> </BrowseNode>

    Read the article

  • first data global gateway API - invalid XML problem

    - by B.Georg
    Hello, i am implementing the First Data Global Gateway API into a Java E-Commerce Web application. The problem that i have is that I get an error message SGS-020003: Invalid XML returned from the staging.linkpt.net server. By switching the optional entities off, I managed to locate the problematic entity. It is the Shipping entity. I have the following data inside it: <shipping> <zip>10105</zip> <phone>123456789</phone> <email>[email protected]</email> <name>DJBla</name> <state>NY</state> <address1>some city</address1> <address2>suite 6</address2> <city>New York</city> <country>US</country> </shipping> According to the First Data Global Gateway User Manual Version 1.1 everything is correct with my XML. Would anyone have an idea where the error could be? Kind Regards, B.Georg

    Read the article

  • XSD, restrictions and code generation

    - by bob
    Hello, I'm working on some code generation for an existing project and I want to start from a xsd. So I can use tools as Xsd2Code / xsd.exe to generate the code and also the use the xsd to validate the xml. That part works without any problems. I also want to translate some of the restrictions to DataAnnotations (enrich Xsd2Code). For example xs:minInclusive / xs:maxInclusive I can translate to a RangeAttribute. But what to do with custom validation attributes that we created? Can I add custom facets / restrictions? And how? Or is there another solution / best practice. I would like to collect everything in a single (xsd) file so that one file contains the structure of the class (model) including the validation (attributes) that has to be added. <xs:element name="CertainValue"> <xs:simpleType> <xs:restriction base="xs:double"> <xs:minInclusive value="1" /> <xs:maxInclusive value="100" /> <xs_custom:customRule attribute="value" /> </xs:restriction> </xs:simpleType> </xs:element>

    Read the article

  • Deserialize xml which uses attribute name/value pairs

    - by Bodyloss
    My application receives a constant stream of xml files which are more or less a direct copy of the database record <record type="update"> <field name="id">987654321</field> <field name="user_id">4321</field> <field name="updated">2011-11-24 13:43:23</field> </record> And I need to deserialize this into a class which provides nullable property's for all columns class Record { public long? Id { get; set; } public long? UserId { get; set; } public DateTime? Updated { get; set; } } I just cant seem to work out a method of doing this without having to parse the xml file manually and switch on the field's name attribute to store the values. Is their a way this can be achieved quickly using an XmlSerializer? And if not is their a more efficient way of parsing it manually? Regards and thanks My main problem is that the attribute name needs to have its value set to a property name and its value as the contents of a <field>..</field> element

    Read the article

  • Process xml-like log file queue

    - by Zsolt Botykai
    Hi all, first of all: I'm not a programmer, never was, although had learn a lot during my professional carreer as a support consultant. Now my task is to process - and create some statistics about a constantly written and rapidly growing XML like log file. It's not valid XML, because it does not have a proper <root> element, e.g. the log looks like this: <log itemdate="somedate"> <field id="0" /> ... </log> <log itemdate="somedate+1"> <field id="0" /> ... </log> <log itemdate="somedate+n"> <field id="0" /> ... </log> E.g. I have to count all the items with field id=0. But most of the solutions I had found (e.g. using XPath) reports an error about the garbage after the first closing </log>. Most probably I can use python (2.6, although I can compile 3.x as well), or some really old perl version (5.6.x), and recently compiled xmlstarlet which really looks promising - I was able to create the statistics for a certain period after copying the file, and pre- & appending the opening and closing root element. But this is a huge file and copying takes time as well. Isn't there a better solution? Thanks in advance!

    Read the article

  • Adding integer value to a list from XML file

    - by Pramodh
    I've an Xml file like <SampleFile> <Data> <Element Val="8" /> <Element Val="10" /> <Element Val="12" /> <Element Val="14" /> <Element Val="16" /> <Element Val="9" /> <Element Val="11" /> <Element Val="13" /> <Element Val="15" /> <Element Val="17" /> </Data> </SampleFile> i need to read the attribute value of" Val" and convert it to Int32 , then sort and then add to the list now i'm using like: List<Int32> lst = (XDocument.Load("\\Sample.xml").Descendants("Element").Select(l_Temp => l_Temp.Attribute("Val").Value.ToString()).Cast<Int32>().OrderBy(nTemp => nTemp)).ToList(); but its not working properly please give me a better solution

    Read the article

  • LINQ-to-XML Error "is not a member of 'String'"

    - by mmcglynn
    The following code returns the error from the For Each loop. I have similar code that does not return the error. 'DisplayTitle' is not a member of 'Sting' Dim evXML As XDocument = XDocument.Load(Server.MapPath("~/App_Data/event.xml")) Dim sbEventDetail As New StringBuilder() Dim summary = _ From sum In evXML.<root>.Elements() _ Select sum...<DisplayTitle>.Value For Each item In summary sbEventDetail.Append("<h4>" & item.DisplayTitle & "</h4>") Next The XML: <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <StartTime>2010-03-05T16:00:00</StartTime> <EndTime>2010-03-06T02:00:00</EndTime> <Duration>10:00:00</Duration> <DisplayTitle>MARCH MADNESS</DisplayTitle> <Location>565 Main St</Location> <IsAllDay>False</IsAllDay> <Recurrence> <OriginatingTimeZone>Eastern Standard Time</OriginatingTimeZone> <RecurrenceType>0</RecurrenceType> <RecurrenceEndDate>9999-12-31T23:59:59</RecurrenceEndDate> </Recurrence> <IsVariance>False</IsVariance> <IsCancelled>False</IsCancelled> <OriginalStart>0001-01-01T00:00:00</OriginalStart> </root>

    Read the article

  • How to specify schema location in an xsd file?

    - by Manoj
    I have an xsd file Foo.xsd. I tried following ways to refer it in a WSDL file but it doesnt work. 1) placed the xsd file in local file system and imported it as <xsd:import namespace="http://ws.test.com/" schemaLocation="file:///D:/wsdl/Foo.xsd"></xsd:import> 2) Placed the xsd file in web root folder and imported as <xsd:import namespace="http://ws.test.com/" schemaLocation="http://localhost:8080/Xfire/Foo.xsd"></xsd:import> When I run the client I get null for the fields of response object. But this works when I embed the type definition inside the WSDL itself. How do we specify the path to external xsds? I am using xFire 1.2.6 for generating webservices. Client is generated using xFire WSGen ant task.

    Read the article

  • Syntax Error? When parsing XML value

    - by Ace Munim
    I don't know if I'm having a syntax error but the compiler is giving me TypeError: 'undefined' is not an object (evaluating 'xmlDoc.getElementsByTagName("icon")[i].childNodes') Its me giving me this problem when im parsing the XML from my server, my actual javascript code is like this var xmlDoc = Obj.responseXML; var count = 0; if(xmlDoc){ while(count <= xmlDoc.getElementsByTagName("item").length){ document.getElementById("flow").innerHTML += "<div class='item'><img class='content' src='" + xmlDoc.getElementsByTagName("icon")[i].childNodes[0].nodeValue.replace(/\s+$/g,' ') +"' /></div>"; count++; } }else{ alert("Unable to parse!"); } and my XML goes like this. <feed> <item> <title>Given Title</title> <icon> http://i178.photobucket.com/albums/w255/ace003_album/Logo-ETC-RGB-e1353503652739.jpg </icon> </item> <item>...</item> <item>...</item> <item>...</item> <item>...</item> <item>...</item> <item>...</item> </feed> i just want to parse the image link and to show it.

    Read the article

  • Multimedia content in REST responce(XML/JSON)

    - by Koushik
    In my thesis I need to test different architectures. A request to a REST web service developed using Apache CXF and Spring MVC with MySQL as back end serving references(a field in database) to images,audio and video files stored in file system. In the response message, what is the best method to send the content to the client(another application using the service which I developed). URI: http://www.filmservices.com/film/{id} A client here is not the end user. Send the encoded hyperlink's(where the content is stored in the file system) to the client, so that the client renders the response and displays it to the browser. Use Base64 to encode the message(image,audio,video) and send it to the client. Main concern is performance.

    Read the article

  • XML Serialization and Deserialization in C#

    - by SOF User
    <job id="ID00004" name="PeakValCalcO"> <uses file="Seismogram_FFI_0_1_ID00003.grm" link="input" /> <uses file="PeakVals_FFI_0_1_ID00003.bsa" link="output" /> </job> <job id="ID00005" name="SeismogramSynthesis" > <uses file="FFI_0_1_txt.variation-s07930-h00000" link="input" /> <uses file="Seismogram_FFI_0_1_ID00005.grm" link="output" /> </job> Let say I have this XML I want to convert into .net Object how can do this i tried it but it doesn't work correct... public class jobs : List<job> { } public class job { public string id { get; set; } public string name { get; set; } public List<uses> Files { get; set; } } public class uses { public string file { get; set; } public string link { get; set; } } private void Form1_Load(object sender, EventArgs e) { XmlSerializer serializer = new XmlSerializer(typeof(jobs)); TextReader tr = new StreamReader("CyberShake_100.xml"); job b = (job)serializer.Deserialize(tr); tr.Close(); }

    Read the article

  • Is this XML file correct for RSS feeding?

    - by Hermet
    Hi guys I am generating a XML-RSS type file from PHP. The output for example is like this <?xml version="1.0" encoding="iso-8859-1"?> <rss version="2.0"> <channel> <title>Mi web mola</title> <link>http://www.dominio.com/blog.php</link> <language>es-ES</language> <description>Mallas y eso</description> <generator>Autor</generator> <item> <title>Articulo de prueba</title> <link>http://www.midominio.com/2342</link> <pubDate>14/06/2010</pubDate> <description><![CDATA[Descripcion de prueba bla bla bla]]></description> <content:encoded><![CDATA[Contenido prueba]]></content:encoded> </item> </channel> </rss> ... and all I can see in the Firefox preview is the title and the description of the blog, not the items, but in the source it appears correctly, so I've thought it must be a parse error or something like that.. What could be wrong? Again, excuse me for my bad english, and thank you very much.

    Read the article

  • remove a duplicate element(with specific value) from xml using linq

    - by Q8Y
    If I have this xml <?xml version="1.0" encoding="utf-8"?> <super> <A value="1234"> <a1 xx="000" yy="dddddd" /> <a1 xx="111" yy="eeeeee" /> <a1 xx="222" yy="ffffff"/> </A> </super> and I need to remove a1 element (that have xx=222) completely. why this won't happen using my code?? i realized that it will delete it only if it was placed the first element(i.e, if i want to delete a1 that have x=000 , it will delete it since its the first one), why is that?? what wrong with the code ?? var employee = from emp in element.Elements("A") where (string)emp.Element("a1").Attribute("xx") == "222" select emp.Element("a1"); foreach (var empployee_1 in employee) { empployee_1.Remove(); } element.Save(@"TheLocation"); thanks alot

    Read the article

  • linq to xml enumerating over descendants

    - by gh9
    Hi trying to write a simple linq query from a tutorial I read. But i cannot seem to get it to work. I am trying to display both the address in the attached xml document, but can only display the first one. Can someone help me figure out why both aren't being printed. Thank you very much <?xml version="1.0" encoding="utf-8" ?> <Emails> <Email group="FooBar"> <Subject>Test subject</Subject> <Content>Test Content</Content> <EmailTo> <Address>[email protected]</Address> <Address>[email protected]</Address> </EmailTo> </Email> </Emails> Dim steve = (From email In emailList.Descendants("Email") _ Where (email.Attribute("group").Value.Equals("FooBar")) _ Select content = email.Element("EmailTo").Descendants("Address")).ToList() If Not steve Is Nothing Then For Each addr In steve Console.WriteLine(addr.Value) Next Console.ReadLine() End If

    Read the article

  • C# xml read, show error

    - by gloris
    Whats wrong with my code? XmlTextReader textReader = new XmlTextReader(@"D:\xml_file.xml"); textReader.Read(); // If the node has value while (textReader.Read()) { // Move to fist element textReader.MoveToElement(); Console.WriteLine("XmlTextReader Properties Test"); Console.WriteLine("==================="); // Read this element's properties and display them on console Console.WriteLine("id:" + textReader.id.ToString()); Console.WriteLine("name:" + textReader.name.ToString()); Console.WriteLine("time:" + textReader.time.ToString()); } Console.ReadLine() show erron on: id, name, time My XML file: <students> <student> <id>1</id> <name>Rikko Nora</name> <time>2010-03-12</time> </student> <student> <id>2</id> <name>Rikko Nora2</name> <time>2010-05-15</time> </student> </students>

    Read the article

  • Uploading an xml direct to ftp

    - by Joshua Maerten
    i put this direct below a button: XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement("Login"); XmlElement id = doc.CreateElement("id"); id.SetAttribute("userName", usernameTxb.Text); id.SetAttribute("passWord", passwordTxb.Text); XmlElement name = doc.CreateElement("Name"); name.InnerText = nameTxb.Text; XmlElement age = doc.CreateElement("Age"); age.InnerText = ageTxb.Text; XmlElement Country = doc.CreateElement("Country"); Country.InnerText = countryTxb.Text; id.AppendChild(name); id.AppendChild(age); id.AppendChild(Country); root.AppendChild(id); doc.AppendChild(root); // Get the object used to communicate with the server. FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://users.skynet.be"); request.Method = WebRequestMethods.Ftp.UploadFile; request.UsePassive = false; // This example assumes the FTP site uses anonymous logon. request.Credentials = new NetworkCredential("fa490002", "password"); // Copy the contents of the file to the request stream. StreamReader sourceStream = new StreamReader(); byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd()); sourceStream.Close(); request.ContentLength = fileContents.Length; Stream requestStream = request.GetRequestStream(); requestStream.Write(fileContents, 0, fileContents.Length); requestStream.Close(); FtpWebResponse response = (FtpWebResponse)request.GetResponse(); response.Close(); MessageBox.Show("Created SuccesFully!"); this.Close(); but i always get an error of the streamreader path, what do i need to place there ? the meening is, creating an account and when i press the button, an xml file is saved to, ftp://users.skynet.be/testxml/ the filename is from usernameTxb.Text + ".xml".

    Read the article

  • How to search within an xml data set?

    - by user187580
    Hi, I have some xml data and I am trying to keyword search data. For example, if I search "some" for the following data it returns me the <id> and <title>. <resource> <id>101</id> <title>Test Environment</title> <description><b>Some</b> description. </description> <type>classroom</type> </resource> <resource> <id>102</id> <title>ABC Test Environment</title> <description><b>Some</b> another description. </description> <type>classroom</type> </resource> ... I had a look on on xpath e.g. $xml->xpath('//title') but looks for elements only. Basically what I need to do is to create a functionality where users can keyword search within the above data set which I receive from third party api in the above format. Any ideas how I can achieve this? using PHP/ Javascript etc. Thanks.

    Read the article

  • Storing Data as XML BLOB

    - by NBrowne
    Hi, At the moment the team i am working with is looking into the possibility of storing data which is entered by users from a series of input wizard screens as an XML blob in the database. the main reason for this being that i would like to write the input wizard as a component which can be brought into a number of systems without having to bring with it a large table structure. To try to clarify if the wizard has 100 input fields (for example) then if i go with the normal relational db structure then their will be a 1 to 1 relationship so will have 100 columns in database. So to get this working in another system will have to bring the tables,strore procedures etc into the new system. I have a number of reservations about this but i would like peoples opinions?? thanks

    Read the article

  • XML with iPhone app !

    - by totato
    hi .. I just work on web-based application for iPhone, And I try to retrieve data from my website to my app. can I edit XML code for my website as I want to be in my iPhone app? for example, XML for my website is: <item> <title>Announcement title</title> <link>iphone feed</link> <description>Announcement type</description> <category>Students</category> <pubDate>April 5, 2010, 12:50 pm</pubDate> <guid>iphone feed</guid> </item> but I can't retrieve all of this to the tableview in my app. So, I will edit the code to be like this: <item> <category name="staff"> <Announcement title="welcome back"> <description> hope all of you enjoy in the vacation, and welcome back to university </description> </Announcement> </category> </item> Is this the right way?

    Read the article

  • parse a special xml in python

    - by zhaojing
    I have s special xml file like below: <alarm-dictionary source="DDD" type="ProxyComponent"> <alarm code="402" severity="Alarm" name="DDM_Alarm_402"> <message>Database memory usage low threshold crossed</message> <description>dnKinds = database type = quality_of_service perceived_severity = minor probable_cause = thresholdCrossed additional_text = Database memory usage low threshold crossed </description> </alarm> ... </alarm-dictionary> I know in python, I can get the "alarm code", "severity" in tag alarm by: for alarm_tag in dom.getElementsByTagName('alarm'): if alarm_tag.hasAttribute('code'): alarmcode = str(alarm_tag.getAttribute('code')) And I can get the text in tag message like below: for messages_tag in dom.getElementsByTagName('message'): messages = "" for message_tag in messages_tag.childNodes: if message_tag.nodeType in (message_tag.TEXT_NODE, message_tag.CDATA_SECTION_NODE): messages += message_tag.data But I also want to get the value like dnkind(database), type(quality_of_service), perceived_severity(thresholdCrossed) and probable_cause(Database memory usage low threshold crossed ) in tag description. That is, I also want to parse the content in the tag in xml. Could anyone help me with this? Thanks a lot!

    Read the article

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