xml

Parsing XML using android sax parser

Hi, below is a sample structure of the xml I'm trying to parse using the Android SAX parsing approach in this tutorial (http://www.ibm.com/developerworks/opensource/library/x-android/index.html#list8). <root> <parent> <id> </id> <name> </name> <child> <...

Merge a section NameValueSectionHandler of two .config files (C#)

I need merge a section of type NameValueSectionHandler from two .config files (Main.config and Secundary.config in sample). The Main.config has another sections like appsetings and others. Main.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="ParserSQL.Reglas" type="System.Configura...

How to convert an XML FIle into a SimpleXMLElement() Array?

I have an XML File: <?xml version="1.0" encoding="iso-8859-1"?> <deadlines> <deadline> <date>2010-07-01</date> <text>Residency Application for Fall Due</text> </deadline> <deadline> <date>2010-06-01</date> <text>Residency Application for Summer Due</text> </deadline> <deadline> ...

Building a Google Product Feed in .Net (C#)?

Below is the schema I am trying to conform to: <?xml version="1.0"?> <rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"&gt; <channel> <title>The name of your data feed</title> <link>http://www.example.com&lt;/link&gt; <description>A description of your content</description> <item> <title>Red wool...

get elements of xs:choice on XML Beans

I have a schema that looks like <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="a" type="a" /> <xs:element name="b" type="b" /> </xs:choice> XML Beans generates the two methods getAArray() and getBArray(), which return A and B elements separately, losing their ordering. I tried to let types a and b extend th...

Can I use JavaScript to generate an RSS (XML) page?

I'm looking to retrieve JSON (from a third-party website) and convert it into a valid RSS/XML feed. Is this possible? Can RSS readers read pages that are basically only javascript generating a web page? Are there other options to convert a JSON web page to RSS? (ie. retrieve the JSON using an HTTP request and then return valid RSS) ...

How to parse multiple XML documents from a single stream?

I've got a socket from which I'm reading XML data. However, this socket will spit out multiple different XML documents, so I can't simply parse all the output I receive. Is there a good way, preferably using the Python standard library, for me to parse multiple XML documents? In other words, if I end up getting <foo/> <bar/> then i...

NullReferenceException on this C# code.

Here is the entire code for my class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Xml.Linq; namespace SharpDIC.Entities { /// <summary> /// Represents a forum on the Dream.In.Code website. /// </summary> public class Forum { //Forum inf...

PHP DOMDocument validate against referenced XSI schema

Hello! I have a problem validating a given XML file in PHP. This works with a given $myFile xsi schema: function validate($file){ $xsi = $myFile; if(@!$this->dom->schemaValidate($xsi)){ $warning = error_get_last(); throw new Exception ('XML validation of file "'.$this->file.'" failed: '.$warning['message']); ...

Is it possible to make an Android Layout, without just widgets?

Just something I have been thinking about. It is possible to create an android layout with just a TextView widget and no Layout code (e.g: inearLayout, ScrollLayout), but if I try to add anything else to the XML file all sorts of errors start popping up. Is it possible to create a Layout with just widgets? Also, if it is, how? ...

Parsing XML with REXML

I have this XML document and I want to find an specific GitHubCommiter using REXML. Hoy do I do that? <users> <GitHubCommiter id="Nerian"> <username>name</username> <password>12345</password> </GitHubCommiter> <GitHubCommiter id="xmawet"> <username>name</username> <password>12345</password> </GitHubCommiter> <GitHubCommit...

Parse XML response from API, Javascript, Ajax

I have a rails app and i wanna to parse the xml response from API using Javascript (ajax). I tried: $(document).ready(function() { $.ajax({ type: "GET", url: "http://localhost:3000/users/mike.xml", dataType: "xml", success: parseXml }); }); function parseXml(xml) { ... } but don't ...

XML error at ampersand (&)

I have a php file which prints an xml based on a MySql db. I get an error every time at exactly the point where there is an & sign. Here is some php: $query = mysql_query($sql); $_xmlrows = ''; while ($row = mysql_fetch_array($query)) { $_xmlrows .= xmlrowtemplate($row); } function xmlrowtemplate($dbrow){ return "<AD> ...

log4j: how to log only messages from com.foo.* in the console?

Hi, in the system console I would like to log only messages from com.foo.* and not messages from an external library that I'm using com.bar.* Here's what I did: <appender name="console" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %p %c ...

perl xml dom error

try.pl is a script that is trying to generate sample.xml which should validate against sample.xsd. I am getting some errors. Guide me if possible. portion of sample.xsd <xs:element name="element1" maxOccurs="unbounded"> <xs:complexType> <xs:SimpleContent> <---- line number of error <xs:extension base="xs:token"> ...

Print XML as PDF using PCL

I have an xml file with which i want to print as a PDF using PCL. I am new to PCL. Can i use PCL to get the xml printed in PDF format directly or should i have some intermediate process to create a PDF file and then use PCL to get it printed as PDF? ...

Xpath/C#, getting data from multiple namespaces

So, in the XML below using this code sample, i can successfully grab HomeAddress and Name information for each entry from my XML. What if I also need to grab the ID (drivers license numberxxx) information from each entry? EDIT: Updated XML sample for clarificaiton Code Sample: XmlDocument xDoc = new XmlDocument(); xDoc.LoadXml...

modification of xml file in java

I have a dialog box that the user inserts various data through gui controls, and this information is saved as an xml file (implemented in java). The information stored in the xml file is configuration information for the application. I can manually modify the xml configuration file, but I also want to provide this capability through a UI...

How can I store UTF8 in MySQL with PHP, sanitize it, echo it with XML and transform it with XSLT?

I am developing a MVC application with PHP that uses XML and XSLT to print the views. It need to be fully UTF-8 supported. I also use MySQL right configured with UTF8. My problem is the next. I have a <input type="text"/> with a value like àáèéìíòóùú"><'@#~!¡¿?. This is processed to add it to the database. I use mysql_real_escape_string...

xpath query returning wrong values when using greater and less than???

This query is returning values less than 1000. It should only be returning values between 1000 and 1100. Why is that? //results/Building[ 1 = 1 and (( Vacancy/sqft > 1000 ) and ( Vacancy/sqft < 1100 ) ) ] The query will return the following building, which has vacancies less than 1000 square feet and greater than 1100 square feet: <B...