xml

What is the preferred way to implement serializable classes in C#

I've seen many different ways to serialize objects in C# that I'm not sure which one to use and when. In the current situation I'm serializing for exposure through WCF so I'm guessing the [DataContract] attribute is the way to go. Currently I'm reading in some XML, then exposing the resulting object through WCF. So I am deserializi...

jQuery ui - autocomplete from XML cache xml document

I've implemented an autocomplete using an XML source. It takes ~4 seconds to download this XML document from the server. Can someone point me in the right direction on how I could cache that document so that the next time the user visits the site they wont need to download it again unless it's changed. Thanks ...

How to create object graph from an XML-file?

I have an XML file. It could be something like: <person> <name> <firstname>Joni</firstname> <lastname>Smith</lastname> </name> <born year="1983" day="31" month="01">Finland</born> ... lots of elements ... </person> My goal is to create class Person. How can I do it "automatically"? I think I have used some maven castor...

How to create an XML text node with an empty string value (in Java)

I am using a Transform object to save my XML file but it seems to drop empty text nodes. Is there any way to create (and keep) a text node with an empty string i.e. "". Here is how I create the node: Element type = doc.createElement("TYPE"); type.appendChild(doc.createTextNode(value)); It is just that sometimes value is an empty st...

Storing dimensions in xml file in Android

Hi, I am trying to consistently use the same dimension in all the views in my android app (e.g., a left margin of 20dp). If I were using HTML, I would simply use a CSS file, but I am at a loss of how to do this on Android. Is there a way I can store this value in a xml file inside res/values and then use it in layouts? e.g., I thought...

XHTML empty tags not treated as empty tags by any browser

So I've tried this XHTML 1.1 code (validated at validator.w3.org) in Chrome 6, IE 8, and Firefox 3.5. The <p> following the <a/> gets hyperlinked, and the <p> following the <div/> turns red: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&g...

JsTree: Load custom metadata from an external xml source

I have an existing data structure which is stored as an xml doc. It is essentially a sitemap. Every node has some associated metadata (e.g., keywords and description associated with the node). I would like to be able to use the xml_data plugin to be able to load directly from that source. From a quick look at both the documentation a...

Nokogiri and XML Formatting When Inserting Tags

I'd like to use Nokogiri to insert nodes into an XML document. Nokogiri uses the Nokogiri::XML::Builder class to insert or create new XML. If I create XML using the new method, I'm able to create nice, formatted XML: builder = Nokogiri::XML::Builder.new do |xml| xml.product { xml.test "hi" } end puts builder outputs the foll...

Reading and using PHP generated XML in Qt

Hello I'm building an Qt application which, amongst other things displays products of a store. The products are stored in a MySQL database, which is queried by php functions. The PHP function returns an XML of the contents of table. So, I've been looking for a while, but I can't find an elegant soulution for my problem. What I need is: 1...

Retrieving date from .xml

In retrieving records from .xml file using php, I get this error: This website is temporarily unavailable. Please check back later. Unfortunately there were no suitable nodes available to serve this request. What's the problem? In my xml file, I got a lot of Array(). Will this cause the error? ...

Oracle XML Parsing Vs Java XML Parsing

I have a situation to choose between parsing XML documents in Oracle PL/SQL and parsing them in Java. The system receives the XML documents on a message queue and so the XML documents are not on the file system, unless I write them to the filesystem after reading from queue. And, the intent of parsing is to insert/update records in a bun...

Removing content from a xml file

I have a xml file <?xml version="1.0" encoding="UTF-8"?> <text><![CDATA[<p><span style="font-family: arial black,avant garde; font-size: medium;"><strong>Extensible Markup Language</strong> (<strong>XML</strong>)</span> ]]></text> How i can replace <![CDATA[ and ]]> using php ...

How to convert string to xml file in java

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;soap:Body&gt;&lt;LoginResponse xmlns="http://tempuri.org/QuestIPhoneWebService/QuestIPhoneWebService"&gt;&lt;LoginResult&gt;...

Invalid XML characters

I have a text file(UTF-8) file. Content of this file is extracted form rich text documents, it might be MS Word, PDF, HTML or any thing. I have to pass this content to a web service, but most of time it contain invalid characters like form feed or null. What happens now is when I pass the content of the file, containing invalid character...

Get subchild value from an xml with jquery

Hi everyone! I working with Google maps v3, and I want to get the short name of the country where a marker was geocoded. But I can't get the short_name subchild from the google maps' xml. The returned xml like this: http://code.google.com/intl/hu/apis/maps/documentation/geocoding/#XML I would need the "US" from this example. This is my ...

Parsing xml file using xpath and xquery

I have a xml file <category> <type name="SWEATERS"> <product id =1> <itemNumber>1</itemNumber> <name>ProductA2</name> <price>345</price> </product> <product id=2> <itemNumber>4</itemNumber> <name>Product Test </name> <price>456</price> ...

Flex tree populating with xml over http

Hello, i have a HTTPService providing XML on request. <mx:HTTPService id="selektProdukt_data" url="{l_url_selektProduktservice}" useProxy="false" resultFormat="e4x"/> so invokink the service with: selektProdukt_data.send(); delivers resulting XML <?xml version="1.0" encoding="UTF-8"?> <result> <error_text>OK</error_text> <node...

C#.Net ,XML,SQL

I have 150 Nodes in XML ,It have data,,, i want to store Only 5 nodes value into SQl Db in a runtime...... Can u Suggest me Thanks In Advance ...

linq to xml navigate through xml c#

I have some XML and need to be able to read the data within. A sample of the XML is <?xml version="1.0" ?> <ConsumeLeadRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <LeadType>Mortgage</LeadType> <LeadXml> <ns1:LeadAssigned xmlns:ns1="http://YaddaYadda" xmlns:ns0...

OpenXML: Read text between two document fields using OpenXML SDK

Hi, I'm new to programming with the OpenXML SDK and I've tried excessively to locate and read text that is between two document fields, but never really succeeded. There are tons of samples and tutorials on the web about almost everything you can think of doing with the OpenXML SDK, from setting watermarks to doing merge mail, but not o...