xml

XSLT to Compare XMLs using local-name()

Hi, I'm new XSLT but i want to be able compare to XMLs using XSL. The problem the nodes may be changed so i need to make it using lacal-name(). But i can't seem to be able to do it. Please check the below and help me thanks. <xsl:output method="xml" indent="yes"/> <xsl:param name="Doc1" select="Root/items/*" /> <xsl:param n...

Get the Count of Elements where candidate has won

LINQ2Xml: I would like to get the count of elements where candidate has won in every province. I need some help. <Pronvice_Data> <Pronvice>PronviceA</Pronvice> <Registered_Voters>115852</Registered_Voters> <Sam_Kea>100</Sam_Kea> <Jeje>500</Jeje> <John_Doe>400</John_Doe> </Pronvice_Data> <Pronvice_Data> <Pronvice...

Selecting string/literal from a specified child node element using XSLT

this is the excerpt of the XML file. <rdf:RDF> <rdf:Description rdf:about="http://abc.org/JohnD"&gt; <video:Movie xml:lang="en" xmlns:video="http://example.org/movie"&gt;Avatar&lt;/video:Movie&gt; </rdf:Description> <rdf:Description rdf:about="http://abc.org/JohnD"&gt; <foaf:interest xml:lan...

What's the best way to store and access XML in Android?

While I realize resources themselves are defined in XML files, if I have an XML file of my own type that I wish to use, should I be storing them in "res/xml"? Is there a better way to do this such as using assets and then loading them as binary to be parsed by another XML library? ...

How to compile a schema that uses a DataSet (xs:schema)?

I have created the simplest web service in c#: public void AddData(DataSet ds) The generated schema (Wsdl) looks like this: <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema"&gt; ... <s:element ref="s:schema" /> ... </s:schema> Note the schema does not contain any import/include elements. I am trying to load this schema to a c# ...

How to get a node from xml not knowing its level in flex?

My question is, that how can I get the node in witch I want to insert: I.e <folder id="1"> <folder id="4"> <folder id="5"></folder> </folder> </folder> <folder id="2"> <file id="4"/> </folder> <folder id="3"> </folder> I want to get folder with id = 4, but that can...

Download and upload of data (eg. serialized objects) from a phone to a webserver

I'll be very simple: I want to be able to store Java objects from the phone to a webserver. Then, I want to be able to retrieve them later. What could be a good combination of tools/webservers/languages to achieve this? I have done that before with a serialization of objects through a LAMP server. Example [java object on the android ...

Java XML validation against XSD Schema

private void validateXML(DOMSource source) throws Exception { URL schemaFile = new URL("http://www.csc.liv.ac.uk/~valli/modules.xsd"); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI); Schema schema = schemaFactory.newSchema(schemaFile); Validator validator = schema.new...

Converting xml attribute to array

In the following XML: <myxml> <photos> <photo url="1.jpg"/> <photo url="2.jpg"/> <photo url="3.jpg"/> <photo url="4.jpg"/> </photos> </myxml> How do I use e4x to extract the urls and push them in an array with the least possible code? ...

Is there a way to arbitrarily load Resources at runtime in Android?

I've got some XML resources in my Android app. Each one has a different name like "bicycle.xml" and "car.xml". I'd like to know if there's a way to load resources based on conditions during run time. As an example... Say I had a text input in my app. When the user enters "bicycle", my app can look up an XML resource by that name, pars...

ASP.NET XML as Datasource error

Hello I am trying to use an XML as a datasource in ASP and then display it as a datagrid. The XML has the following format: <?xml version="1.0" encoding="UTF-8"?> <people type="array"> <person> <id type="integer"></id> <first_name></first_name> <last_name></last_name> <title></title> <company></company> <tags...

Extend DOMElement object

How could I extend objects provided with Document Object Model? Seems that there is no way according to this issue. class Application_Model_XmlSchema extends DOMElement { const ELEMENT_NAME = 'schema'; /** * @var DOMElement */ private $_schema; /** * @param DOMDocument $document * @return void ...

Why does IE prompt a security warning when viewing an XML file?

Opening an XML file in Internet explorer gives a security warning. IE has a nice collapsible tree view for viewing XML, but it's disabled by default and you get this scary error message about a potential security hole. http://www.leonmeijer.nl/archive/2008/04/27/106.aspx But why? How can simply viewing an XML file (not running any embe...

java NullPointerException when parsing XML

Hi Everyone, I keep receiving a java.lang.NullPointerException while trying to store the values into my Vector. Here is the XML document: <?xml version="1.0" standalone="yes"?> <autocomplete> <autocomplete_item> <title short="Forrest Gump"></title> </autocomplete_item> <autocomplete_item> <title short="Forrest Landis"></...

Turning XSLT into a simple HTML snippet.

The XML <?xml version="1.0" encoding="utf-8" ?> <data> <events /> <tour> <section id="3" handle="tour">Tour</section> <entry id="15"> <title handle="dummy-entry-1">Dummy Entry 1</title> <description mode="formatted">Lorem ipsum dolor sit amet...</description> <photo siz...

Accessing xml from jsp on tomcat server is throwing FileNotFoundException trying to access .keystore?

I am trying to access an XML file from JSP on my Tomcat server. The error is from Catalina's protocol handler and the exception is java.io.FileNotFoundException trying to access my .keystore in the 'documents and settings' folder for my signed-on user (with admin, but not the user that installed the server). I can provide the stacktrac...

Query XML file with PHP to return certain bookmarks...

I have an XML file full of bookmarks from Google Bookmarks. (File: http://gist.github.com/324844) I want to pull the bookmark based on this path: xml_api_reply->bookmarks-bookmark->labels->label. So, my question is How can I use SimpleXML to grab the bookmarks that have the label Inspiration? Some bookmarks may have more than one bookm...

How to access and work with XML from API in C#

My goal is to pull XML data from the API and load it to a sql server database. The frist step I'm attempting here is to access the data and display it. Once I get this to work I'll loop through each row and insert the values into a sql server database. When I try to run the code below nothing happens and when I paste the url directly int...

convert &lt to < xml document

Hi, I have read an XML file and converted into NSXMLDocument object. But, due to the presence of "<" in the string content of a node, it has been converted into "&lt". So, when i write it as xml document to a file, it has the character "&lt" in it. How can i write to the file as ordinary XML file in which "&lt" will be replaced by "<"...

Write XML using best way(Linq To XML or other)

Hello All I want to write my xml with following format. How can i do it?I am using c# <map borderColor='c5e5b8' fillColor='6a9057' numberSuffix=' Mill.' includeValueInLabels='0' labelSepChar=': ' baseFontSize='9' showFCMenuItem='0' hoverColor='c2bc23' showTitle='0' type='0' showCanvasBorder='0' bgAlpha='0,0' hoveronEmpty='1' includeNa...