xml

Parsing XML with Ruby & Nokogiri

I have the following XML structure: <charsets> <charset> <name>ANSI_X3.4-1968</name> <aliases> <alias>iso-ir-6</alias> <alias>ANSI_X3.4-1986</alias> <alias>ISO_646.irv:1991</alias> <alias>ASCII</alias> <alias>ISO646-US</alias> <alias>US-ASCII</alias> <alias>us</alias> <alias>IBM3...

libxml for python's utf encoding issue or mine?

hi all I'm trying to extract the "META" description from a webpage using libxml for python. When it encounters UTF chars it seems to choke and display garbage chars. However when getting the data via a regex I get the unicode chars just fine. Am I doing something wrong with libxml? thanks ''' test encoding issues with utf8 ''' from lx...

How to add XML to SOAP request in Flex

I have a Flex service defined like so: <mx:operation name="postTableDetails" resultFormat="e4x" result="event.token.resultHandler(event);" fault="event.token.faultHandler(event);"> <mx:request> <catalog></catalog> <schema></schema> <table></table> <details></details> Anyway, ...

Freemarker: Reproduce XML

Folks, I am working on a freemarker template that needs to reproduce parts of the input XML tree. I would love to have a macro that I could invoke as follows: <@renderTree node=node namespace="ns"/> Anyone have something like this handy? Thanks. -Raj ...

Whats the best way to offer SOAP/XML + REST/JSON?

I'm creating a general purpose web service that is likely to have a number of different clients, some of which I cannot anticipate at this time. I already have a nice Java Services API and am looking to provide a web services facade on top of that. There are great arguments on both sides of the SOAP vs REST debate and it leaves me wond...

java create xml with xpath

Hi, Can you please suggest the best approach for my requirement(below) in Java. I have tried using xpath but I had to recreate the whole xml. I am hoping if there is a simple way of doing this. I want to remove nodes whose xnuy != 1 Sample input xml ::: <object-stream> <com.vo.ShapeEventsVO> <mtx>198.0</mtx> <mty>79.0<...

Adding a class instance as value to a dictionary

I've an xml file "Sample.xml" <RootElement> <Children> <Child Name="FirstChild" Start="0" End="2"> <Sibling Name="Test1" /> <Sibling Name="Test2" /> <AdditionalSibling Name="Add_Test_1" /> <AdditionalSibling Name="Add_Test_2" /> <MissingSibling Name="Miss_Test_1" /> ...

getting xml cross site by using iframe

I am trying the above mentioned, like this: $.ajax({ type: 'GET', dataType: 'xml', url: $('#proxy').attr('src', 'http://192.168.0.106:8111/getconfiguration?'), success: function (xml) {//do stuff with xml And in the body...

Using ActiveResource POST to create an entry in another Rails application

Hi There are 2 apps App1 and App2 and I am trying to create an entry into the items table of App2 from App1 using ActiveResource I want this to work: new_item = App2::Item.create(:property1 => "foo", :property2 => "bar") This is what I am doing: In App1: module App2 class Item < ActiveResource::Base self.site = "http:/...

Copy DOMNodes from one DOMDocument to another

Hi everybody, I've been trying to combine two XML documents like this: $def = new DOMDocument( '1.0' ); $rdef = new DOMDocument( '1.0' ); $def->load( $path ); $rdef->loadXML( $info ); $r = $def->getElementsByTagName( 'repository' )->item( 0 ); $s = $rdef->getElementsByTagName( 'repository' )->item( 0 ); try { $r->appendChild( $s );...

Reading XML file faster in ASP.NET

Hi all, I have multiple XML files that I need to parse. Problem is that I only need some data in the last couple of lines. I currently use XMLTextReader and reader.ReadToFollowing("DATANEEDED"); but it is still too slow. Does anyone know if I can 'tail' an XML file and read from there? (taking into account the tail would not be a ...

External input binding in OWL-S

Hi, I'm trying to figure out, whether input bindings for CompositeProcesses and AtomicProcesses in OWL-S can be defined externally. Example The OWL-S CompositeProcess has the rdf:ID "CompositeProcess". The two OWL-S AtomicProcesses are identified by "AtomicProcess_1" and "AtomicProcess_2" respectively. Each OWL-S Process has one inpu...

c++ qt read xml file

if i got an xml file like this: <?xml version="1.0" encoding="utf-8"?> <name> <id>1</id> </name> how can i read everything that i got string id = ... (1 in this case); ...

convert nu.XOM.Element to org.w3c.dom.Element

Is it possible to convert nu.XOM.Element to org.w3c.dom.Element? Am trying to construct XML using XOM APIs. But few of my legacy APIs expects org.w3c.dom.Element. So, I just want to know if I can convert. Thank You :) ...

configure tidy to escape the unknown xml tags

Hi, I am using tidy to make HTML entered by the user well-formed and i have configured tidy to accept only few html tags. Is there a way i can tell tidy to escape sequence the xml tags that are not known. Example input and the expected output are given below- Input:: <div> <p>this is a paragraph</p> <unknown-tag>text in unkn...

Factors in deciding whether to use DOM, SAX or XPath

Hello everyone. I am in a kind of an weird condition in my code. I am writing an Apache module that needs to add a comment in the head tag of the response document (apart from doing some other unimportant stuff). At the point where I need to parse the response document, I have the whole document in memory in the form of a char * buffer...

how can I extract an XML block from an XML document?

I want to extract a chunk of XML from a larger XML document. For example, my XML document looks like this <?xml version="1.0" encoding="utf-8"?> <Root> <CONTAINER> <FIRSTNODE> <CHILDNODE> </CHILDNODE> </FIRSTNODE> </CONTAINER> </Root> If I wish to extract any portion. For example, I wish to extract everythi...

Reduce repeating expression in XSLT 1.0

Hi everyone, I have the following XML (simplification): <?xml version="1.0" encoding="utf-8"?> <TestCases> <TestCase> <Name>Test1</Name> <Result>Failed</Result> <Properties> <Type>Type1</Type> </Properties> </TestCase> <TestCase> <Name>Test1</Name> <Result>Failed</Result> <Properties> <Type...

XML reading using jQuery is not working in ie6 and ie8

XML reading using jQuery is not working in ie6 and ie8. i've used the below code.. the alert is not coming in ie8, ie6, i've not tested with other internet explorer versions. $(document).ready(function() { $.ajax({ type: "GET", url: "xml/contextMenu.xml", dataType: "xml", success: function(xml) { ...

how to use getLastModified() in android for XML file creation/modicfication date check

hi, I am parsing XML file in my android application, but I like to modify the code, that it only parses the XML file if it is update (I will store the last successful parse date). I found out the urlConnection.getLastModified(); but not getting proper idea of how to use it, as it is returning milliseconds as long. is it possible I c...