xml

How to access XMLList nodes in AS3

I am working with an XML list at the moment, which looks like this: <feature type="startLocation" value="1" x="15" y="3"/> <feature type="startLocation" value="1" x="15" y="4"/> <feature type="startLocation" value="1" x="15" y="5"/> <feature type="startLocation" value="1" x="15" y="6"/> <feature type="startLocation" value="1" x="15" y="...

Determining whether to store XML data as XML or in normalized tables

(This post is soliciting personal experiences about storing XML; please share what you know. :-) ) I am working on a service application that communicates with an external service using XML. I am planning to use SQL Server 2008 to store the XML that is received and sent to the external service. I'm exploring my options for storing ...

Retrieving XML element name using t-SQL

If I have: <quotes> <quote> <name>john</name> <content>something or other</content> </quote> <quote> <name>mary</name> <content>random stuff</content> </quote> </quotes> How do I get a list of the element names 'name' and 'content' using T-SQL? The best I've got so far is: declare @xml xml set @xml = ... sele...

NULL Guid in Soap/xml call

I am developing applications that communicate to a web service to access a database. One of the web service calls returns data held by a node in a tree structure by taking either the GUID of the node, or NULL to return the root node. Adding a web service reference to a managed project easily allows null to be sent as a parameter, but ...

Generic Collections and XStream

Is there a way to map (using xstream) a List<Person> to <friends> and List<Things> to <stuff> for example? Thanks! ...

Using XML for dynamic contraints in Grails

I am trying to dynamically populate the static constraint ={} at run time. Is there a way to do this. Example code: Normal statement: static constraint = { lastName(blank:false, maxSize: 100) } What I am trying to do: static constraint = { call to an XMLSlurper that returns a HashMap of lastName as a key and (blank: false, maxSize:...

How can I append an attribute to an existing XML element in Java?

I want to append an attribute an existing element in XML using Java. For example: <employee> <details name="Jai" age="25"/> <details name="kishore" age="30"/> </employee> It want to add weight to it (assume that it is calculated and then appended in response). How can I append that to all items? <details name="Jai" age="25" weight="5...

Xalan (XSLT) translate method translating more than it should.

Hi everyone, I seem to be having an issue with Xalan's translate method. I have the following code: translate(translate(string(name),'&lt;sup&gt;',''),'&lt;/sup&gt;','') This is used to remove <sup> and </sup> from string(name). Unfortunately when I do that, it seems to remove s, u and p from the names as well. So names like sony Bra...

PHP: How to convert array to XML with support to attributes (DOMi ?)

I'm using DOMi ( http://domi.sourceforge.net ) to create XML from arrays. But I don't know how to create attributes in these XML (in arrays, so these attributes appear in the XML). How can I construct these arrays so I can get some tags with attributes after the convertion? Thank you! ...

PHP XML DOM - getElementsByTagName

I'm trying to use the weatherbug API, but seem to be stuck quite early in the proceedings. The [very simple] code I tried: function weather_widget($apikey, $zipcode) { $url = "http://$apikey.api.wxbug.net/getLiveWeatherRSS.aspx?ACode=$apikey&amp;zipcode=$zipcode&amp;unittype=0&amp;outputtype=1"; $contents = file_get_contents($url);...

java tree class to XML through jRuby on rails

I have a custom Java Tree class (from stanford parser,) that I am able to work with in JRuby on Rails. What I am trying to figure out how to do is to output this tree class to XML through rails The tree class describes a word tree derived from a parsed sentence. Each tree may have multiple child trees depending on the structure Here i...

iphone xml parses text but no images or paragraph spacing

i am trying to parse an xml blog found here: http://www.feed43.com/1515171705611023.xml it has pictures within the text. I am able to parse the headers, the content and the link of the individual posts. I, however, cannot get it to parse the paragraph spacing links within the text or images. all three of these are EXTREMELY important....

xml child/parent help

I have been trying to build a child/parent navigation for a little while now using PHP (I'm from a .net background) and I can't get close to the desired results. I am loading my data from an xml file using simplexml successfully but I am trying to workout how I can map that into arrays or variables so I can write it out. <Categories> ...

regex to match <Key>....<Value> pattern

I have the following data sent by an external system which needs to be parsed for a particular Key <ContextDetails> <Context><Key>ID</Key><Value>100</Value></Context> <Context><Key>Name</Key><Value>MyName</Value></Context> </ContextDetails> I tried parsing this with the regex to fetch the value for the KEY : Name <Context><Key>Name<...

Neat XML from T-SQL

Lets say we have a table "Names": ID Name Surname 1 Matt Smith 2 John Doe How would you write some SQLXML to generate this: <people> <person> <name>Matt</name> <surname>Smith</surname> <person> <person> <name>John</name> <surname>Doe</surname> <person> </people> The best I've got is this:...

What does xmlns="" exactly mean

Given the following (piece of) a soap call; <m1:NextCommencementDateInput xmlns:m1="http://foo.bar.com/Types"&gt; <aDate xmlns="">2010-06-02</aDate> </m1:NextCommencementDateInput> Apperantly this is the same as (when validating against the xsd using XMLSpy) <m1:NextCommencementDateInput xmlns:m1="http://foo.bar.com/Types"&gt; ...

xbean's inst2xsd : generate int instead of short/byte

Does anyone knows how can I configure inst2xsd to generate int and not byte (nor short)? I use the -simple-content-types smart (default) option. see also their online docs. 10x, asaf :-) ...

Setting the order of attribute when writing XML Element

When writing in java the following: Element fieldEl = targetDocument.createElement("field"); fieldEl.setAttribute("Wine","Marlo"); fieldEl.setAttribute("Beer","Corona"); The order of adding the attributes are not kept in the result XML file. How can I control the order of the attribute inside XML Element (so it will be easy for human...

Attributes and elements missing from serialized object

Hi, I have some generated proxy classes, that contain properties with the XMLAttribute attribute, e.g. [System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="http://www.egem.nl/StUF/StUF0301")] public Verwerkingssoort verwerkingssoort { get { return this.verwerkingssoo...

Unknown fields in Django Model

I am hoping to to build a model for a single table that houses different types of "articles" (for argument's sake). Each article will have MOSTLY common fields (e.g. title, date etc.) but there are cases where some article types (outside of my control) have slightly different field requirements and respective validation rules . No fie...