xml

XElement.Value not reading multi-line data

I current have the following XML fragment that I'm parsing to read its values and display them on a web page: <root> <PostcardTitle>The Needles</PostcardTitle> <PostcardDescr>Granite Dells, Prescott</PostcardDescr> <PostcardImage> <img alt="GraniteDells" src="GraniteDells.jpg" /> </PostcardImage> <PostcardDate /> <Postca...

Using SAX (Java) to parse multiple XML messages from a single TCP-stream

I'm in a position where I use Java to connect to a TCP port and am streamed XML documents one after another, each delimited with the <?xml start of document tag. An example which demonstrates the format: <?xml version="1.0"?> <person> <name>Fred Bloggs</name> </person> <?xml version="1.0"?> <person> <name>Peter Jones</name> </p...

Better way to create XMLs at Runtime

I am working on an Android application that is required to connect to a REST WebService. There are a number of requests that the application needs to make and the request format is XML. What I have done presently is create a Request template per XML request using StringBuilder class and substitute a placeholder String for different value...

cURL doesn't seem to work in a while loop

I'll just post the whole thing since it would be a bit confusing otherwise: <?php echo "<html> <head> <title>ARMORY.</title> <meta http-equiv='Content-Type' content='text/html' charset=iso-8859-1> </head> <body> <table width='50%' border='1' cellpadding='10' cellspacing='10'>"; $server = "Sunstrider"; $guild = "Mist"; $url='ht...

Creating objects using LINQ

I have an xml file that looks like this; <Employee> <EmployeeName>Burt Reynolds</EmployeeName> <EmployeeTitle>Bad Ass</EmployeeTitle> <EmployeeStory> <EmployeeStoryHeaderParagraph> <EmployeeHeader>Employee Header 1</EmployeeHeader> <EmployeeParagraphs> <EmployeeParagraph>Employe...

Changing where XmlSerializer Outputs Temporary Assemblies

Hi I am trying to change where XmlSerializer Outputs Temporary Assemblies so I am following this sort of tutorial http://www.hanselman.com/blog/ChangingWhereXmlSerializerOutputsTemporaryAssemblies.aspx yet when I add <system.xml.serialization> <xmlSerializer tempFilesLocation="c:\\foo"/> </system.xml.serialization> I get temp...

What's going on with these XML nodes named "#text"?

I've got some simple XML-handling code that's supposed to locate a child node of a passed in node based on an attribute value: function GetNodeByAttributeValue( const AParentNode: IXMLNode; const AttributeName: string; AttributeValue: Variant): IXMLNode; var i: integer; value: Variant; begin result := nil; if (not Assigned(A...

using XmlArrayItem attribute without XmlArray on Serializable C# class

I want XML in the following format: <configuration><!-- Only one configuration node --> <logging>...</logging><!-- Only one logging node --> <credentials>...</credentials><!-- One or more credentials nodes --> <credentials>...</credentials> </configuration> I'm trying to create a class Configuration that has the [Serializable] a...

How to put the results from R into an XML file

In a previous question I asked about reading in an XML file into R and carry out basic statistical analysis such as finding the mean and the standard deviation etc. This question is about the reverse of the reading of the original XML file and creating a new XML file that contains the original data and the results from the statistical a...

xslt: time ago test

using xslt how do i test if a date was within the last (say) 15 days? input: date in format dd/mm/yy X number of days output: if the date occured within X days of now eg recent('02/07/10',30) would return true iff 02/07/10 was 30 days in the past some steps i got: main func <xsl:function name="custom:monthtodays"> <x...

Validating XmlDocument with a XSD

I am developing a system that will receive a XML (XmlDocument) via webservice. I won't have this XML (XmlDocument) on hardisk. It will be managed on memory. I have a file XSD to validate the XML (XmlDocument) that I receive from my WebService. I am trying to do a example to how validate this Xml. My XML: <?xml version="1.0"?> <note> ...

iphone XML attachments

My iPhone app will be receiving an xml feed from a Java web service. The xml is in a SOAP message. I can easily parse data from within the xml however there is a jpeg attachment to the SOAP message that I need to display within the iPhone app. Does anyone have example code or a link to some documentation on how to work with SOAP attachme...

Map XSLT input document prefixes to preferred values

Using XSLT, I'm wondering how to get the output to use my stylesheet's namespace prefixes rather than the input document's prefixes. By way of example, given this very simplified document: <?xml version="1.0"?> <a:node xmlns:a="urn:schemas:blah:"/> And the following XSL transform: <?xml version="1.0"?> <xsl:transform xmlns:xsl="htt...

SQL Server XML Data Type and QUOTED_IDENTIFIER

Can anyone provide insight into this? I've developed an import process using an XML data type. After the data is inserted in to a table by the import sProc I run another procedures to update another table with the imported table. The update procedure throws an exception if it is created with SET QUOTED_IDENTIFIER OFF. I'd like to under...

issue with a seemingly simple nokogiri xml parsing problem

Hi all, I have an xml file as follows: <products> <foundation label="New Construction"> <series label="Portrait Series" startImg="img/blank.png"> <item_container nr="1" label="Firebed"> <item next="11" id="" label="Logs Black Brick">img/PortraitSeries/logs-black-brick.png</item> ...

Extraneous wcf body xml namespace declarations

I generated a set of web service proxy objects with the .Net 3.5 svcutil.exe tool. The soap body element has 2 extraneous xml namespace alias declarations. Specifically schema and schema instance namespaces ( http://www.w3.org/2001/XMLSchema, http://www.w3.org/2001/XMLSchema-instance ). For other reasons, the service I'm interacting wit...

How can I better understand and navigate the structure of large XML files

Hello everyone, I'm slogging through a somewhat large XML file. Say I'm looking for a particular value within the tree. I find it manually, but then to find it programmatically I need to know the path. Right now, I'm usingtidy and vim to pretty-print the file so that can I inspect it manually. It's getting old real fast though, 'cause t...

Get Items from xml and add to listview

I am trying to add get items from an xml document and load it into a listview. I keep getting an System.OutOfMemory exception on the line projects.Add(project). What am I doing wrong and how do I do it correctly? I got this code from murach's beginning visual basic.NET. When I run this it adds random spaces between the items in the listv...

XML parsing in Python

Having trouble getting this to work. What's strange is that I have 10 bookmarks in Delicious and it prints out 10 blank strings so it must be close to working. import urllib from xml.dom.minidom import parse FEED = 'http://feeds.delicious.com/v2/rss/migrantgeek' dom = parse(urllib.urlopen(FEED)) for item in dom.getElementsByTagName('...

Support for POSTing XML in HttpUnit?

Does HttpUnit support getting a response from an HTTP POST with an xml argument? Edit If you want to send a post request, you might instantiate a PostMethodWebRequest object. WebRequest request = new PostMethodWebRequest("http://example.com/thing/create"); And if you want to set parameters for that request, I think what you would do...