xml

What does it take to get the "LyricArtist" from this XML feed using Nokogiri?

First the xml: http://api.chartlyrics.com/apiv1.asmx//GetLyric?lyricId=90&lyricCheckSum=9600c891e35f602eb6e1605fb7b5229e doc = Nokogiri::XML(open("http://api.chartlyrics.com/apiv1.asmx//GetLyric?lyricId=90&lyricCheckSum=9600c891e35f602eb6e1605fb7b5229e")) Successfully will grab the document content. After this point i am unab...

map xml element to xsd complexType based on attribute

Assume there exists an XML instance document that looks like this: <root> <object type="foo"> <!-- ... --> </object> <object type="bar"> <!-- ... --> </object> </root> My goal is to have a small (static) schema that verifies proper <element type="xxx" /> syntax for objects, and another schema (more pro...

What's so bad about building XML with string concatenation?

In the thread What’s your favorite “programmer ignorance” pet peeve?, the following answer appears, with a large amount of upvotes: Programmers who build XML using string concatenation. My question is, why is building XML via string concatenation (such as a StringBuilder in C#) bad? I've done this several times in the past, as it's so...

How do I get a less than in a javascript for loop in XSL to work?

I am using CDATA to escape the script but in IE8's debugger I still get this message: "Expected ')'" in the for loop conditions. I am assuming it still thinks that the ; in the &lt; generated by CDATA is ending the loop conditions. Original script in my XSL template: <script type="text/javascript" language="javascript"> <![CDATA[ ...

How to achieve conditional resource import in a Spring XML context?

What I would like to achieve is the ability to "dynamically" (i.e. based on a property defined in a configuration file) enable/disable the importing of a child Spring XML context. I imagine something like: <import condition="some.property.name" resource="some-context.xml"/> Where the property is resolved (to a boolean) and when true ...

XML Deserialization

I have the following xml file. <a> <b> <c>val1</c> <d>val2</d> </b> <b> <c>val3</c> <d>val4</d> </b> <a> I want to deserialize this into a class and I want to access them with the objects of the class created. I am using C#. I am able to deserialize and get the value into the object of class ‘a’ (the <a> tag). ...

How to serialize entire XML document into JavaScript array?

Hi, I have a html document which loads an XML document using jQuery jQuery.ajax( { type: "GET", url: example.xml, etc... When that XML is loaded I want to serialize the entire XML document into a JavaScript array. How would I do this? ...

how to add a xml document to another xml document in java.

I have a xml document like this rootXMLDoc=<root> <param></param></root> . I need to insert paramxmlDoc= <parameter par='1'>abc</parameter>. how to insert paramxmlDoc to rootXMLDoc in java.? and i need output like this <root> <parameter par='1'>abc</parameter> <param></param> </root> ...

how to use XML sent by html form?

i have html form with textarea in which i paste some XML, for example: <network ip_addr="10.0.0.0/8" save_ip="true"> <subnet interf_used="200" name="lan1" /> <subnet interf_used="254" name="lan2" /> </network> When user submit form, that data is send to Java server, so in headers i get something like that: GET /?we=%3Cnetwork+ip_addr...

Property transfers in soapui

I'm trying to write parallel tests in soapui and need to transfer properties between the test steps I currently have 3 tests steps: Execute legacy request Execute new request XML diff the two responses in a groovy script I've found a lot of blogs about picking values out with xpaths, but nothing about passing the full response throu...

How to verify XML attributes using XSD enumeration?

I have the following XML sequence <property name="a" value="x" /> <property name="b" value="xx" /> I want to limit "a" to a list of values, like [ x, y, z] and "b" to another list like [xx, yy, zz] Is it possible to do this using XSD, and if it is how? If this is not possible, how do you recommend to change the XML format in order...

Comprehending the Semantic web and it's methods, syntax, vocabularies and languages

Hi. I have just been introduced to the semantic web and it's family of functions but I have a hard time understanding some of it, which I was hoping someone could explain to me. As far as I've understood, RDF can be written in several syntaxes. RDF/XML, Turtle, etc. Now, I understand XML. How it is presented and how it can be parsed. ...

Is the order of attributes in a certain tag releveant?

Is the order of attributes in a certain tag releveant. Specific case: This is from a selenium testfile. Given a testcasse <?xml version="1.0" encoding="UTF-8" standalone="no"?><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"&gt; <meta content="text/htm...

How to generate following xml

hi. i want to generate XML for the following tree type structure. i attached picture. generated xml should be <services> <service> <name>Service 1</name> <categories> <category> <name>Cateogry 1</name> <methods> <method> <name>Method 1</name> </method> </methods> ...

How can I dynamically create XML using jQuery to then output at a later time?

I currently have an XML document which I want to read, and then dynamically create a new XML object with jQuery using some of the information I have taken from the already existing XML document. I need to store this new XML object into an array, so that I can read it later on. I can't seem to find much jQuery documentation on creation ...

C# XML Deserializer fails to deserialize Child Node

I have an XSD and a class generated by XSD.EXE I'm using to deserialize an XML document. For some reason, a node fairly deep into the XML document is failing to deserialize, and I can't find why it would be doing so... Here's how I'm deserializing: XmlSchema schema = XmlSchema.Read(XmlReader.Create("X12_00401_271.xsd"), null); XmlSeri...

Remove parent xml tag based on child value

For example, we have xml file with this format: <A> <B> <C></C> <D></D> <D></D> </B> </A> i need that: if all "D"-tags elements are empty, then we need to delete whole "A"-tag element and, of course, we need to do this with all "A"-tags in xml. ...

Updating DIV with XML content on Hover (JQuery)

Hi everyone! The concept of what I'm trying to do is fairly simple. I have a grid of company logos loaded through XSLT from an XML document, each with their own unique links to the company profiles. I have a separate div on the page, essentially a "preview" box. What I want to do is this: I roll over a logo, and it loads the name of...

How do I load an xml file and read from it in Silverlight?

I do not want to load it from a website I have added it to my project all I want to do is access it and read it. Can anyone help! ...

Python + Expat: Error on &#0; entities

I have written a small function, which uses ElementTree and xpath to extract the text contents of certain elements in an xml file: #!/usr/bin/env python2.5 import doctest from xml.etree import ElementTree from StringIO import StringIO def parse_xml_etree(sin, xpath): """ Takes as input a stream containing XML and an XPath expression...