C# XML conversion
Hi, I have a string containing fully formatted XML data, created using a Perl script. I now want to convert this string into an actual XML file in C#. Is there anyway to do this? Thanks, ...
Hi, I have a string containing fully formatted XML data, created using a Perl script. I now want to convert this string into an actual XML file in C#. Is there anyway to do this? Thanks, ...
Hi, I am trying to implement an autocomplete textbox whose values are generated by a remote script returning XML contents. I'm using JQuery-1.4.3 and the autocomplete widget from JQuery-UI-1.8.5. I've studied the autocomplete demo page for the XML data parsed once example, and am trying to implement the comments: This should also s...
Hi, I'm pretty new to XSLT and have an urgent work requirement that I'm finding quite complex to sort out. I have an XML doc which needs an attribute adding under certain conditions. The XML doc is pretty straightforward: <A x="foo" y="bar" z=""> <B/> <C/></A> Basically if attribute "z" is present. Then a new attribute needs to be...
I have some xml in which a specific element, let's call it dave might either be: <dave>A Normal Value</dave> or <dave><![CDATA[A CData Value!]]></dave> When I'm parsing it I would like to be able to test whether the retrieved value is CDATA or not. How would I do this? ...
I need an XML file to change after installation, based on some parameters. For example: <?xml ...?> <root xmlns="..."> <!-- remove this element when PARAM_MODE=1 --> <sometag /> <!-- remove this element when PARAM_MODE=2 --> <sometag2 /> <someothertag /> </root> The easiest way it to use XSLT to remove the element, but ...
I am trying to read some XML received from an external interface over a socket. The problem is that the encoding is specified wrong in the XML-header (it says iso-8859-1, but it is utf-16BE). It is documented that the encoding is utf-16BE, but apparently they forgot to set the correct encoding. To ignore the encoding when I deserialize ...
I want to bind the data from my XML file to my userControl. So far I have: XML file: <?xml version="1.0" encoding="utf-8"?> <testData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <pumps> <pump> <speed value="1200"/> <color value="Black"/> ...
I have an endpoint to a web service, I have a .wsdl file with the information in it, as well as a .xsd file. I have created a web reference application using the endpoint in VS. Now I want to send an xml file as a string and get some form of response from the service. HOW can I do this? I need a complete waalkthrough in terms of VS. Than...
Lets say you have an xml document like <parents> <parent> <element /> <element /> </parent> <parent> <element /> <element /> </parent> </parents> While processing I need to know that the elements are 1, 2, 3, 4 in the document, not that but calling position() will return 1, 2, 1, 2. Nor...
Hi to all, I am developing Android Web App using JSP with xml parsing. I developed it in Java using Tomcat Server but I couldn't develop in Android. I am new to the web app development. So can anyone kindly suggest me how to proceed further... waiting for a response guys...Thank you ...
Hi I'm trying to get a variable value (ref within contractRef) in the xml below, but when I use what I assume to be the xpath: /discovery/contractRef[@xmlns='http://schemas.xmlsoap.org/disco/scl/']/@ref it returns nothing. How can I get this variable, what am I missing? Thanks <?xml version="1.0" encoding="utf-8"?> <discovery xmlns:x...
I downloaded the XML Schema for XML Schemas at http://www.w3.org/2001/XMLSchema.xsd. I then used XSD.EXE to create a class from the downloaded file. I called the class schema.cs. I then executed this line of code: XmlSerializer serializer = new XmlSerializer(typeof(schema)); and got this error: The XML element 'annotation' from ...
Hi, I've seen this somewhere, but I don't remeber the page. I'd like to extend the HTML tags, so then I can add my own attributes to the HTML elements, I saw a example where the developer added a new xmlns to the page definition, so he could add new things and still be a valid XHTML. What is the name of this technique and where could ...
I'm having a hard time wrapping my head around XSLT but I heard it's possible to split an XML file into multiple files. Basically I'd like to copy all the elements up to the first file and after the last file and then add the individual file content for each output file. Could someone give me some pointers on this if it's even possible...
Does anyone has idea how to access HREF from the below object: SimpleXMLElement Object ( [@attributes] => Array ( [title] => Preview [rel] => enclosure [type] => image/jpeg [href] => http://a1.phobos.apple.com/us/r1000/008/Purple/94/ee/38/mzl.fupornmt.320x480-75.jpg ) ...
I have the standard XML form and am having problems removing an element. XML <my:myFields> <my:Attachment>some values</my:Attachment> </my:myFields> I have tried using this: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="@*|node()"> <xsl:copy> <xsl:app...
I am using Nokogiri which works for small documents well. But for a 180 kb html file I have to increase the process stack size (via ulimit -s) and the parsing takes a long time. Let alone xpath queries. Are there faster alternatives available using a stock ruby 1.8 distribution? I am getting used to xpath, but the alternative does not ...
I want to replace the text PATHTOEXPORT with the contents of a variable passed on the command-line that would have a folder path in it (for example, /Dev_Content/AIX/Apache) I came across this article that discusses how to use sed to replace a value in an XML file with another. However, not having used sed before, I'm unsure how to rea...
I have made small web-app in jsp with a start page with login and some restricted pages with logout, -everything controlled with filters and servlets. I started making it because I wanted to learn how to use filters and servlets, and think I have succeded in that very well. Everything works fine when I just ensure everything is happenin...
Hey there, I have the following XML: <?xml version="1.0" encoding="UTF-8" ?> <text> Lorem <foo>ipsum</foo> dolor sit amet. </text> and am trying to parse this XML with JQuery and replace the <foo> tags inside the response with <b></b> tags. The resulting string should be "Lorem <b>ipsum</b> dolor sit amet." I'm doing a GET reque...