xml

How to get a file path in a class?

I have this Xml file that i browse from my HDD into my C# program. Now the nodes of this Xml doc get displayed in a tree view in my winform. All my logic is in the winform right now. There are three methods: To load the Xml doc in memory. Add nodes to tree which is called by the previous method in point 1. And event that works when i c...

How do I extract data from an XML file with Visual Basic?

I've not used XML too much and I need a little help. My .NET application gets this XML response from the W3C's public validation server: <?xml version="1.0" encoding="UTF-8" ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"&gt; <env:Body> <m:markupvalidationresponse env:encodingStyle="http://www.w3.org/2...

Best practice to serialize and deserialize .net objects across versions

Objects are serialized to a database using the .NET XML serializer. The object can change over time, and therefore multiple versions exist in the database at one time. Any suggestions for the best way to construct your code, so that you can still deserialize this object into the latest version. (interfaces / maps / manual serialization ...

Proper rendering of special characters in Flash, parsed from XML and generated with PHP/MySQL

Hi all, Probably a problem many of you have encountered some day earlier, but i'm having problems with rendering of special characters in Flash (as2 and as3). So my question is: What is the proper and fool-proof way to display characters like ', ", ë, ä, etc in a flash textfield? The data is collected from a php generated xml file, ...

Test to see if an xelement exists

I'm reading an XML file that looks like this: <?xml version="1.0" encoding="utf-8"?> <VehicleList> <Vehicle> <Item> <Name>F-150</Name> <Maker>Ford</Maker> <Color>Black</Color> <Price>30000</Price> </Item> <ItemSpecific> <NameValueList> <Name>Mileage</Name> <Value>56000</Value> </NameValueList> <NameVa...

Simplest way to output XML from SQL Server to client

I need to return contents of an xml column in sql server to client by simply clicking a URL. The xml has processing instruction to open the correct application (Infopath in this case). I'm a bit confused as to all the various xmlreader writers and streams available. I suppose I want to send the contents of SQLs ExecuteXmlReader to Resp...

JAXB inheritance, unmarshal to subclass of marshaled class

I'm using JAXB to read and write XML. What I want is to use a base JAXB class for marshalling and an inherited JAXB class for unmarshalling. This is to allow a sender Java application to send XML to another receiver Java application. The sender and receiver will share a common JAXB library. I want the receiver to unmarshall the XML into ...

how does one go about copying one xml document's node to another?

I'm trying to insert an element node (that has some children) from one XML into another in java. What I'm trying (which isn't working) looks like this... Node foo = document1.getChildNodes().item(3).cloneNode(true); document2.getChildNodes().item(2).appendChild(foo); I'm getting an exception that complains that i'm trying to use a n...

How can I get an XML fragment as a string from an XElement?

I have an XElement and inside that element I have another XML fragment. How do I retrieve the XML? If I try the following, I get only the value: string str = "<Root><Node1>value1</Node1><Node2></Node2></Root>"; XElement elem = XElement.Parse(str); string innerXml = elem.value; ...

Java DomImplementationLS.

I'm looking to create XML Document objects in Java and serialize them to a byte array (prior to sending them across a TCP connection). I currently have code that looks like this: public byte [] EncapsulateThingy( ThingyType thingy ) { parser.reset(); // parser is a pre-existing DocumentBuilder object Document doc = parser.newDo...

What does the url in XML file mean

I find this URL (or a similar one) always on HTML files, XML, XSD... Like "http://www.w3.org/2001/XMLSchema" or "http://www.w3.org/2001/XMLSchema-instance" I always wonder what those URLs means. Even offline the XML or HTML document works without changes. What's the benefits on links to those URLs?? Thanks ...

Delete XElement based on attribute

Hi, I'm still playing around with xml. Now I have a file that looks like this: <?xml version="1.0" encoding="utf-8"?> <Attributes> <AttributeSet id="10110"> <Attribute id="1">some text here</Attribute> <Attribute id="2">some text here</Attribute> <!-- 298 more Attribute nodes follow --> <!-- note that the value for the id att...

Consuming .NET webservice in Java (metro) - XMLNode/XMLDocument consumption?

I am a bit rusty in my Java, and this is my first time using metro/JAX-WS, so if this is a dumb question I apologize. I have to write a client that consumes a .NET webservice. I've got the basics down; I have generated the wrappers from the WSDL, and I can create my object and port and make a call and get a response. Widgets d = new ...

Current line number from a System.Xml.XmlReader (C# & .Net)

Does anyone know how I can get the current line number of an System.Xml.XmlReader? I am trying to record where in a file I find Xml elements. ...

SWF object not playing my XML Playlist.

Hello, I've tried to include youtubetune player to social network, but for somereason it wont play the xml files it should play. I got around issue that the tracks dint even appear by uploading the neccessary swf files and swfobject.js file to my server. Now the tracks appears to the player, but the player wont play them. You can see my...

Strange behaviour XmlDocument.LoadXML and GetElementByID, how to delcare string with quotation mark

Here's some c# code string webPageStr = @"<html><body><div id=""content"">good content</div><div id=""badcontent"">bad content</div></body></html>"; XmlDocument webPage = new XmlDocument(); webPage.LoadXml(webPageStr); XmlElement divElement = webPage.GetElementById("content"); and divElement is equal null and i don't know why I ha...

Java: Using Castor XML with images

Hey, how can I use Castor XML to marshal a java.awt.Image object to XML, or make the XML reference the image in some way. Cheers, Pete ...

Only show X rows from DataGrid

Hi, I want to post my 5 recent twitters on my website. I've build a datagrid with XMLTextReader in C# which reads the feed but the problem I face is that it shows ALL the feeds and I can't find a way to only show 5. Any idea's? XmlTextReader reader = new XmlTextReader("http://some.rss/feed.rss"); DataSet ds = new DataSet...

How to use Xpath in Yahoo! Widgets to traverse a tree?

Hello. I'm creating a Yahoo! Widget and have done this before without any problems (creating a widget). I'm getting a xml document via a weblink and want to get all the nodes intro a tree. I'm doing this: var request = new XMLHttpRequest(); request.open( "GET", url, false ); request.send(); if ( request.status == 200 ) ...

Insert some java script using HTMLDocumentClass

i would like to insert custom javascript to the head of the page all i have is this HTMLDocumentClass object, does anyone know how to do that? are there any security restrictions??? can i change ids of elemnts that came with the page?? ...