xml

Serializing a object with an image to be saved to SQL database

I have the following object: [Serializable] public class ExampleImage { public int ID { get; set; } public string Filename { get; set; } public byte[] Content { get; set; } } I store this in a List<ExampleImage> which I then pass to the following function to serialize it to a string: static string SerializeObjectToXmlStri...

View WebRequest XML

Hello, I'm having a strange issue - I saw a similar post on this forum, but it didn't have an answer. Long story short, I am sending an HttpWebRequest using C# to a web service (stubs were created by adding a web reference in Visual Studio 2008, .NET 2.0) which breaks with the following message: "Unable to parse the incoming request". ...

What is preventing widespread use of XSLT for webpages?

Why aren't more webpages written using XML with an XSLT stylesheet? For separating content from presentation, this combined with CSS would be even more powerful. Right now, for things like outputting a navigation menu, people often hand-copy the navmenu code from page to page or do something like <?php include_once('myheader.inc'); ?>...

Flex: ArrayCollection children returns null

I have an ArrayCollection with following structure (when viewed in debug mode): [0] - [0] -- src - [1] -- src src is the path to an image. I need to get all of the src's out of the arraycollection. However because of the first (unnamed) node i can't take them in. I've tried ArrayCollection[0].children and save the result in another ...

What's the most streamlined way of performing a XSLT transformation in ASP.NET?

In other words, is there a faster, more concise way of writing the following code: //Create an object for performing XSTL transformations XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load(HttpContext.Current.Server.MapPath("/xslt/" + xsltfile.Value), new XsltSettings(true, false), new XmlUrlResolver()); //Create a XmlRe...

Can I 'import' this value into a XML structure and parse it? C#

I have a sharepoint server and I am playing around with it programmatically. One of the applications that I am playing with is Microsoft's Call Center. I queried the list of customers: if (cList.Title.ToLower().Equals("service requests")) { textBox1.Text += "> Service Requests" + Environment.NewLine; foreach (SPListItem item in ...

T4, XML data source and relative path in Visual Studio 2008

Hi, I recently implemented a quick T4 template to generate some data access related classes in our app (Thanks Oleg). One problem I am facing is that my template does need to read data from an XML file that is part of the solution. Obviously, the path to the XML data must be relative. But when I first implemented it yesterday, it looke...

How do I put code examples in .NET XML comments?

What tags can I use for putting code examples in .NET /// XML comments? Is this the best place to put them? ...

How do I tell DOMDocument->load() what encoding I want it to use?

I search for and process XML files from elsewhere, and need to transform them with some XSLTs. No problem. Using PHP5 and the DOM library, everything's a snap. Worked fine, up till now. Today, funky characters were in the XML file -- "smart" quotes from Word, it looks like. Anyways, DOMDocument->load complained about them, saying that th...

Problem in generating Java classes from XML schema definition using XJC(of JAXB).

I have an XML that looks like this and a corresponding xsd with it. <books> <book name="book1" id="book1"> <name>Harry Potter</name> ........... </book> ........... </books> Please see that 'name' is appearing twice, once as an attribute in tag, and also as an element under tag. Apparently that is invalid syntax, I am no...

Using XML.Query for filtering multiple values

Hi I have XML column in my table which can contain XML like these 2 records : record 1, suppose that ID of record is 1 and XML content is <content> <node1 >10</node1> <node2 >20</node2> <node3 >30</node3> <node4 >40</node4> <node5 >50</node5> </content> record 2 , suppose that ID of record is 2 and XML content is <content> ...

"Unexpected End of file" using GetReaderAtBodyContents in WCF Service

I'm running a web service which accepts SOAP messages over a custom binding. The messages get dispatched correctly and most of them get processed fine. While working off a Message, the message is being read to a XmlDocument using: XmlDocument doc = new XmlDocument(); try { doc.Load(msg.GetReaderAtBodyContents()); } catch (XmlExcept...

Needs solution to store XML as object or as such in iPhone Apps

Hi, I am a beginner to iPhone App development. Please help me out. In my iPhone application, I am making an API request and getting an XML. I have to parse it, store it in a object(or xml as such) and also display it in my application at a later point of time (Its more like storing the current state). I figured out how to request A...

Select the same attribute in XPath and return result without repetition

I have an XML document like this: <wii> <game> <type genre="arcade" /> <type genre="sport" /> </game> <game> <type genre="platform" /> <type genre="arcade" /> </game> </wii> How to list all genres without repetition using only XPath? Thanks. ...

jQuery method to return XML objects where two fields are equal?

I'm getting data back from the server in XML format. The data looks like: <items> <item> <field1>10</field1> <field2>11</field2> <field3>12</field3> </item> <item> <field1>10</field1> <field2>11</field2> <field3>11</field3> </item> </items> Is there a way to write a jQuery stateme...

How do I update XML attribute with msbuild

I am currently using Msbuild and Msbuild.community.tasks using XMLUpdate and XMLMassUpdate to update various sections of my Web.Config one thing has me stumped though. If I have: <configuration> <nlog throwExceptions="true" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...

Creating hypermedia links in a custom media-type

I am currently creating a set of custom media types for a RESTful api (e.g. application/vnd.mycompany.foo+xml) and I'm trying to identify the pros and cons of two different ways of exposing hypermedia links. If I first consider what other media types do probably the best place to start is HTML. Html allows me to create links such as: ...

Flex sorting of XMLListCollection subelements

In a Flex webapp, is there an easy way to go about applying a sort to the children of an XML element, based on the children's attributes? Example follows below: XMLListCollection: <a anotherProp="ABCDE">   <e prop="AB">1</element>   <e prop="BC">2</element> </a> <a anotherProp="FGEH">   <e prop="HF">3</element> ...

Encoding special characters in xml

How to encode special characters in xml? e.g: i have a special character mu in my xml, transformation will fail due to this character any info would be helpful Thanks Preetham ...

Use WCF to receive any XML message from an MSMQ Queue?

I have an MSMQ that receives XML format messages from various sources. I have a WCF endpoint (using MsmqIntegrationBinding) that I want to receive these messages. I defined the following: [ServiceContract(Namespace = "http://TestApp.MSMQService", ProtectionLevel = ProtectionLevel.None)] [ServiceKnownType(typeof(String))] public interf...