xml

Best way to serialize a C structure to be deserialized by Java, etc.

Currently, I'm saving and loading some data in C/C++ structs to files by using fread()/fwrite(). This works just fine when working within this one C app (I can recompile whenever the structure changes to update the sizeof() arguments to fread()/fwrite()), but how can I load this file in other programs without knowing in advance the sizeo...

How do I prevent JAXB from binding superclass methods of the @XmlRootElement when marshalling?

I have a class that is annotated as the @XmlRootElement with @XmlAccessorType(XmlAccessType.NONE). The problem that I am having is that the superclass's methods are being bound, when I do not want them to be bound, and cannot update the class. I am hoping there is an annotation that I can put on the root element class to prevent this f...

Dynamic LINQ

I have an XML document defined like so XML File <TABLE> <RECORD> <PAGENUMBER> 1 Of 1</PAGENUMBER> <OtherFields1>..</OtherFields1> <OtherFields2>..</OtherFields2> </RECORD> <RECORD> <PAGENUMBER> 1 Of 2</PAGENUMBER> <OtherFields1>..</OtherFields1> <OtherFields2>..</OtherFields2> </RECORD> ...

NHibernate mapping generic classes

How does one create a mapping file for a generic class in NHibernate. Say I have a class Foo How would it look in the mapping document? class name="mydll.Foo ???? , mydll" ... I know if it was a Foo it would be: class name="mydll.Foo`1[[mydll.Fee, mydll]], mydll" Would it be something like: class name="mydll.Foo`1[[mydll.Fee, mydll],[m...

How can I use XML::Simple with XML tags that might have one or more sub-elements?

I asked a question yesterday http://stackoverflow.com/questions/657058/perl-xml-simple-retrieveing-attribute link I am using to get the XML: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&amp;id=19273512 (1) http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&amp;id=19291509 (2) I made very good...

Android ImageButton -- can't get image in the center

I want to create an Android ImageButton in the xml file with a background image, and a smaller icon on top of that, right in the center. For some reason, it's not obvious how to do it, and documentation is no help. <ImageButton android:id="@+id/sound_button" android:layout_x="430px" android:layout_y="219px" android:layout_width="48px" a...

Help! Flash cannot load XML data from a third-party domain

I am getting news from Yahoo using an RSS feed, using: XML.load("http://finance.yahoo.com/rss/topstories") Yea this is legal and all, and although it works perfectly when my SWF is offline -- it shows a security error, but I allow my D drive "domain" in the Adobe Security Panel. But as soon as I upload it to my server, and test it on...

'Element' is an invalid XmlNodeType

I don't get this. I really don't get the ReadEndElement. I assume after every ReadStartElement, you need to close off the reader to advanced to the next start element and if there's no more start elements, close by ReadEndElement for all other elements? Sample of the returned XML: <Envelope> <Body> <RESULT> <SUCCESS>true</SUCCESS> <S...

How to implement a cross-domain Ajax request using CakePHP and jQuery?

I am using CakePHP for my project, and I am generating XML views so that I can interact with them (CRUD) from an external website. There is authentication required on the CakePHP website. Essentially, I want to view "http://mycakeapp.com/posts/views/1.xml" from "http://www.example.com" However, I get this error when using jQuery's aja...

Is there a parser/way available to parser Wikipedia dump files using Python?

I have a project where in I collect all the wikipedia articles belonging to a particular category, pull out the dump from the wikipedia, and put it into our db. So I should be parsing wikipedia dump file to get the stuff done. Do we have an efficient parser to do this job. I am a python developer. So I prefer any parser in python. If not...

player opening more than one time?

This is my site. When i will select songs for playing player.php file will open and it will play the songs selected. Everything working fine,but the problem is when o will go back and select another songs it is opening one more player window. please help me. I want only one player window has to be opened even i select other songs also...

loosly-typed versus strictly typed what are the pros and cons

In our company we have discussion going on whether to allow xml/xsd strucutures (used in webservices) that contain parts that are loosly-typed, in order to make changes to them easier. What do you thing are the pro's and cons of doing one (loosly-typed) or the other (strictly-typed) ? Arguments could be in the categories, of ease of ch...

The string '3/18/09 10:16 PM' is not a valid AllXsd value.

Obviously the reader doesn't like this format incoming from the response XML. Wondering if I can reformat this. Trying to convert to DateTime using the following code with my XmlReader: reader.ReadContentAsDateTime(); ...

How to handle When XML Element does not have a value

Sometimes, a certain XMLElement has a value: <CAR>value</CAR> sometimes though it does not in the returend XML: <CAR/> When using the XmlReader, I am not sure yet how to handle this situation. For example I have code that reads each element. But what if car has no value coming back at times? Then my DateTime.Parse bombs out so I...

Hierarchical RSS Feeds

Is it possible to create an RSS feed with a multi-level hierarchy, sort of like a directory structure? Is this allowed per the RSS spec? If this is possible, does anyone know of what limitations there might be? As in, are there any particular readers that would not support it? My main concern here is that I want to create an RSS feed ...

Saving a XML-Document in a Database (Combination of Hibernate and JAXB) in Java

I am looking for a solution to save a XML-File in a database using Hibernate. The problem is, that the structure of the XML-file is different to the Hibernate-beans. I'm trying to use JAXB to serialize the XML-content to the Hibernate beans. Please imagine the following scenario: There is this xml file: <root> <general> ...

Preserve order of attributes when modifying with minidom

Is there a way I can preserve the original order of attributes when processing XML with minidom? Say I have: <color red="255" green="255" blue="233" /> when I modify this with minidom the attributes are rearranged alphabetically blue, green, and red. I'd like to preserve the original order. I am processing the file by looping through t...

XMLStarlet: XML parsing error

xsltCopyText: text allocation failed runtime error: element value-of xsltValueOf: text copy failed Got this error when parsing XML (wikipedia dump, actually) w/ XMLStarlet. I can get page titles and ids, but when it comes to page texts, it fails. Expression used: xml sel -N xmlns=http://www.mediawiki.org/xml/export-0.3/ -T -t -m "//x...

System.Security.Cryptography and "Bad Data" - character encoding?

The class that produces "Bad Data" errors: using System; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; using System.Windows.Forms; namespace MyNameSpace { public class RSAcrypt { private string _encryptedData; private string _decryptedData; public string EncryptedData {...

Matching ReadEndElement with ReadStartElement when using an XmlReader

My question is simple. I've been using ReadStartElement and ReadEndElement with the XmlReader in my code just fine. The question is (and this is after looking at MSDN), do you need to match the two? In other words, do I end with ReadEndElement for each and every ReadStartElement or is are there cases where you don't need so many Rea...