xml

What is the best suited language to process XML in a web application?

I'm planning a web application that requires a lot of XML processing: generate XML documents, validate against schemas, generate views from XSLT... For diferent reasons I've ruled out .NET and J2EE. Also, when I say 'best suited' I'm thinking of syntactic simplicity rather than performance. Any advantages in using PHP, Python, Ruby on Ra...

XML Generation in Java 1.3

Yes, I am talking about Java 1.3 - I'm maintaining an application that for reasons beyond my control will not move in the short term. There is a fair bit of XML generation going on using the boreland XML library, which makes XML generation quite longwinded. I'm looking for a library, built in or third party. That provides a simple wrap...

XOM getting attribute from Node?

Shouldn't something like this work? Assuming a document formatted as such: <root> <element id = "a"></element> </root> Node node = doc.query("/root/element").get(0); String id = node.getDocument().getRootElement().getAttribute("id"); When I print the value of the root element, it looks as if this should work. What's failing, here...

How to easily parse large xml data with a DOM parser?

I am using DOM parser to parse xml data, but its taking lots of time to parse it on line 3 where "is" is the InputStrem object. Here is my code. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(is); how can i do it in a sma...

loading html page as xml

I use this to load html page by xml Dim xmlDoc As New XmlDocument() xmlDoc.Load(Server.MapPath("index.htm")) Or Dim xmldoc As XDocument xmldoc = XDocument.Load(Server.MapPath("index.htm")) but i got some errors like : Expecting an internal subset or the end of the DOCTYPE declaration. Line 2, position 14. '>' is an unexpected to...

Splitting xml level according to Xpath

Can I split a level of an XML document with an XPath expression into a list? I have this, for example: <root> <test1 /> <testX /> <test2 /> <test21 /> <testX /> <test3 /> </root> so running it on this returns a list with <test1 />, <test2 /><test21 /> and <test3 />. There is not necessarily just one node between <testX /...

Jquery ajax method always fires error: callback instead of success:

Hi I am having a problem when using the ajax function in jquery. The ajax call seems to be running fine, i.e. the code that is returning an xmldocument runs without errors. Here is that code. Jquery code: function LoadWeekDays(){ var xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async="false"; xmlDoc.loadXML("<data...

parsing and translating from text to xml

Hello I need to translate programs written in a domain specific language into xml representation. These programs are in the form of simple text file. What approach would you suggest me? What api should I use to: Parse the text files written in this language. Write xml based on the token and token streams I obtain. My criteria is more...

JAXB validation using annotations.

If I have a simple class such as:- @XmlRootElement public class MyClass { @XmlAttribute(required=true) private String myattribute } Is it possible to validate a corresponding xml document WITHOUT an xml schema i.e. using only the annotations? ...

Parsing xml using XDocument, solr results

I want to take the solr response xml, and load a custom collection. I'd like this to be done the XDocument way, as I need to learn linq to xml. So the XML looks like: <response> <lst> </list> <result ... > <doc> <arr name="cat"> </arr> <str name="t1">text</str> <str name="t2">text2</str> <str name="t3">te...

Get content from XML PHP5

Hi, I´m working on a paymentsolution and need some help with the PHP. I´m doing a HTTPRequest and in response I will get some XML. The XML Could look like this: <?xml version="1.0" encoding="utf-8" ?> <payer> <purchase_list> <freeform_purchase> <line_number>1</line_number> <description>d...

Rome RSS - Disable Validation in Rome RSS

In my application ROME api tries to validate the feed against and DTD in W3C and after some time it fails since W3C blocks that IP. Is there a way that I can disable XML feed validation in ROME? RSS XML validation is not neccessary since we get the feed from a well reputed company ...

How to show a column value which has XML file in webbrowser - C#?

I have table which stores entire XML file in a column. I want to show that column's stored value (ie. XML ) in web-browser using C#. Please help/suggest some way to implement this. The trick is to retrieve the column and need to be displayed in webbrowser control. Please suggest. Thanks, Karthick ...

Deleting all child nodes and text of an element

With reXml using Ruby, I have a particular element and I want to completely clear out all its child nodes and text. I just cannot work out how to do this. Given this : <ug> <oog> Delete<delete/>all<delete/>this </oog> </ug> I want to delete all the children of oog, to end up with this : <ug> <oog> </oog> </ug> I can g...

How to embed xml in xml

I need to embed an entire well-formed xml document within another xml document. However, I would rather avoid CDATA (personal distaste) and also I would like to avoid the parser that will receive the whole document from wasting time parsing the embedded xml. The embedded xml could be quite significant, and I would like the code that wi...

[RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"]

Hey all, I get the following error message when I try to perform an update in flash builder 4 beta: [RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"] at mx.rpc.http::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::processResult()[E:\dev\gu...

On the fly tags generation for XML Builders

Hi, I have a hash like, object = { :type => 'book', :name => 'RoR', :price => 33 } OR object = { :type => 'wig', :name => 'Elvis-Style', :price => 40, :color => 'black' } The problem is that keys in above hash may be different all the time or even increase and decrease depending upon the object type. What I want to do generate XM...

&& in XML (logical operations)

Hi, in an application I'm using a config-file in which i'd like also to use '&&'. <?xml version="1.0" encoding="ISO-8859-1" ?> <use-case id="customer"> <precondition evaluate="!empty customer && !empty product" /> <menu-item id="customer" label="Kunde" /> </use-case> With this code I'm getting an validation error owing to the...

Trace Function Not Returning XmlList.length in As3

Hello, I'm looking to populate an array with bitmapdata based on some xml I load. The problem I'm having is I can't seem to get the length of my XMLList... var path:String = "http://mydomain.com/"; var bDataArray:Array = new Array(); var xmlLoader:URLLoader = new URLLoader(new URLRequest(path + "includes/categoryOutput.php")); xmlLo...

Powershell's import-clixml from string

Is there any way to run import-clixml cmdlet on a string or xml object? It requires a file path as input to produce ps objects and can't get input from an xml object. Since there is convertto-xml cmdlet which serializes ps object into xml object, why isn't there a convertfrom-xml, which would do the opposite? I am aware of System.Xml.Ser...