xml

xml cross port on same server?

hey all, i have an apache server on port 8080 and apache tomcat on 8181. i want to call a command in apache from tomcat. this command is a php script found on the apache server port 8080. i use jquery inside a javascript function on tomcat server, using $.ajax. sthg like: function fct() { $.ajax({ type: "GET", url: pathof...

What Java XML parser to extract data from 2000 lines file (on mobile device)

In my Android app I need to extract data from a xml file (the file will have less than 2000 lines). I have no experience with XML parsing, so I don't know what the best approach is. DOM parser is perhaps not a good option, because I am on a mobile device. On the other hand with SAX I would probably end with more complicated code. What wo...

API choice, should I return XPathNavigator or XmlDocument

I'm building a new API for an existing service. The methods in it will be called from with in XSLT as .net extensions however I can see me needing to use the same API to do some .net XML juggling too. I've been toying which how best to write this all night. For it to be XSLT friendly I'll be returning XML in a XPathNavigator object so t...

Difficulties to output "HTML-string code" through XML

I got som difficulties to output "HTML-string code" through XML.I have presented a example below. In the server-side I have some code written in PHP. $htmlCode = "<div>...........................</div>"; header("Content-type: text/xml"); echo "<?xml version='1.0' encoding='ISO-8859-1'?>"; echo "<info>"; echo "<htmlCode>"; echo $htmlCo...

Read config file using XMl reader

I have a bunch of key in AppSettings section of my web.config file. I want to read the key and values of those app settings using XML reader technique and populate them in the list box. ...

How to validate xml so that only elements that actually exist can be used as attributes?

So, basically what I want to do is to emulate the "ref" attribute of schema validation. I have the following XML, for example: <node name="parent"> <subordinate name="child3" /> </node> <node name="child1" /> <node name="child2" /> And I want this to be flagged by my schema as invalid, since "child3" isn't one of the availab...

Parse large RDF in Python

I'd like to parse a very large (about 200MB) RDF file in python. Should I be using sax or some other library? I'd appreciate some very basic code that I can build on, say to retrieve a tag. Thanks in advance. ...

Serialize XML where elements differ only by rel="

I'm trying to serialize some XML. Normally, I would just create a class and use the System.Xml.Serialization.XmlSerializer however, in this case there are various issues like the a few link tags that are only different because of the rel='. And so, I'm not sure how to serialize it and create the class for that. Any ideas? Here's a sam...

XmlStreamReader not reading complete text value

It seems like this question has come up before as I see in http://stackoverflow.com/questions/2938398/reading-escape-characters-with-xmlstreamreader But the issue I am seeing here is little different. I am reading a pretty big XML file which contains a large snippet of malformed html as one of the tag values. The values are enclosed in...

Jquery validation messages from xml

I am using Jquery valdiation plugin for validating the form at client side. I am fetching validation error messages from an xml file. $("#"+form).validate({ errorLabelContainer: "#dialogError", //msg_error wrapper: "li", rules: { txtInfringementID: { ...

how to insert xml into mysql from a script?

Hi!! bit of a curly one here let me know if you have any ideas.. For various reasons I need to store a small number of medium size xml documents in mysql (yes I know that technically violates 1NF). I want to script this load so I can drop-recreate the database, and also for my release scripts, however the catch is that the prod release ...

Converting .xls file to xml for webservice with iOS

Hey, am writing an application and I need to convert a .xls file to xml to feed it into a web service. All my google searches involve converting it by hand. I've not been able to find any tutorials on how to do this automatically through iOS, does anyone know of a good tutorial or even a book that includes this? Thanks, William ...

reading xml files in vb6

I know it is easier to read xml files in vb.net but since our appl is still on vb6, i need a work around. but somehow, i am stuck. also i do not have control over the xml file as it is being generated from another application. Short code from the xml file is below, <Report> <Categories> <Category name="...

How to create xml file from a list of objects

I defined 3 classes: public class PublishedPage { public string Action { get; private set; } public string PageGuid { get; set; } public List<string> SearchableProperties { get; set; } public PublishedPage() { Action = "Published"; SearchableProperties = new List<string>(); } } public class Dele...

XPath query how to get value of one attribute based on two attribute

I want to extract name attribute value from the following tag <application comments="Do not erase this one" executable="run_CIET" icon="default" instances="1" mode="1" name="CIET" order="10" selection="1" tool="y" /> I can easily get value of name attribute value based on mode value as shown below ...

Force XDocument to write to String with UTF-8 encoding

I want to be able to write XML to a String with the declaration and with UTF-8 encoding. This seems mighty tricky to accomplish. I have read around a bit and tried some of the popular answers for this but the they all have issues. My current code correctly outputs as UTF-8 but does not maintain the original formatting of the XDocument...

Clojure stripMargin

Scala offers a method called stripMargin that removes the left-hand part of a multiline string up to a specified delimiter (default: "|"). Here is an example: """|Foo |Bar""".stripMargin returns the string Foo Bar Is there a similar function in Clojure? If not, how would you implement it (most functionally)? Thanks. UPDATE: Th...

Back Button in IE shows plain xml instead of loading xsl stylesheet

IE has weired behaviour when pressing back button. When trying to open a webpage server seds a 302 responce that redirects client to Login xml page with xsl stylesheet. After user successfully logged in some page is loaded. However, when user presses "back button" and reaches Login page, IE shows only xml values as plain text instead of ...

XSD Enumeration on a range of values

Hello everyone! I've got to build an XSD file for XML structure verifying purposes, as usual. After generating the XSD (with XMLSpy), I've found one portion of the file that is giving me trouble. I've got an enumeration like this: <xs:enumeration value="1"/> <xs:enumeration value="1011"/> <xs:enumeration value="1032"/> a...

Marshal a field/property to an xml-element with an additional xml-attribute name=propertyName

Hi everyone, I have a java object like: public class Person { private String firstName = "Harry"; private String lastName = "Hacker"; private int age = 30; } which I would like to marshal into the following xml: <attribute xsi:type="someType" name="Person"> <attribute xsi:type="CustomStringType" name="firstName"> <v...