xml

POST an xml API call (for Intuit) using Coldfusion

UPDATE: I managed to get this thing working! Turns out, you NEED to send a secure ticket with the call to get a proper response. I have no idea why it worked in Poster without it. There are a couple other parameters that are required which ColdFusion apparently doesn't send by default. Here is a working call: <!---MyTicketValue is sen...

BaseX get line-breaks return between node-data

Hi! I'm using BaseX as my XML based DB. I make a simple query like xquery for $Book in /Libraray/Literaturelist/Literature/Title return fn:data($Book) I get all titles, just as a String that has got no line breaks. Is there a way to add line-breaks with XQuery after each node found by the query to separate the data? This is not rea...

LINQ to XML - Adding a node to a .csproj file.

I've written a code generator, that generates C# files. If the file being generated is new, I need to add a reference to it to our .csproj file. I have the following method that adds a node to a .csproj file. private static void AddToProjectFile(string projectFileName, string projectFileEntry) { StreamReader streamReader = new Strea...

grep, xml problem

@ubuntu:/tmp$ cat one.xml <?xml version="1.0" encoding="UTF-8"?> <e2frontendstatus> <e2snrdb> 12.10 dB </e2snrdb> <e2snr> 75 % </e2snr> <e2ber> 0 </e2ber> <e2acg> 99 % </e2acg> </e2frontendstatus> @ubuntu:/tmp$ sed -n -e 's/.*<e2ber>\([0-9][0-9]*\)<\/e2ber>.*...

XSD with for elements with same name

I am trying to create a Xml schema for a xml file that looks like following <attributes> <attribute name="article_artextref">123213213</attribute> <attribute name="ProviderID">ABC</attribute> </attributes> What I am trying to accomplish is check if an attribute named "article_artextref" exist and make sure the lenght of its value is...

Node.TEXT_NODE has the value, but I need the Attribute

Hi, I have an xml file like so: <host name='ip-10-196-55-2.ec2.internal'> <hostvalue name='arch_string'>lx24-x86</hostvalue> <hostvalue name='num_proc'>1</hostvalue> <hostvalue name='load_avg'>0.01</hostvalue> </host> I can get get out the Node.data from a Node.TEXT_NODE, but I also need the Attribute name, like I want to kn...

Making the nodes to ignore namespaces (prefixes) after changing XML structure. PHP DOMDocument

Hello. Original XML (myfile.xml) <?xml version="1.0" encoding="UTF-8" standalone="no"?> <blabla xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:blabla="http://www.w3.org/2000/blabla" xmlns="http://www.w3.org/2000/b...

Complex edit xml file

For example, we have this xml: <x> <y>some text</y> <y>[ID] hello</y> <y>world [/ID]</y> <y>some text</y> <y>some text</y> </x> and we need to remove words "[ID]", "[/ID]" and text between them (which we don't know, when parsing), of course without damage xml formatting. The only solution i can think is that: ...

Text file to XMl file convert

Hi all, I going to convert text file to XML. I use the following code. But it generate error in line 12. Can anyone correct the code. Error is in this line. writer.WriteString(lines[0].TrimEnd().Split(ca, 2)[1]); ------ "Index was outside the bounds of the array." private void button1_Click(object sender, EventArgs e) { ...

Remove Commas in a string and insert each comma-separated value into a string

How would I do this? To bring it into some better context, I'm having a value from an XML attribute and I want each individual value to be added to an array of strings and each of those values is separated by commas ...

Differences/Advantages of using JSON over XML or vice versa?

Possible Duplicate: When to prefer JSON over XML? i wonder if JSON is the preferred choice for AJAX transfers (if this is what its called) over XML? i see that usually JSON is used in jQuery docs over XML? ...

Reading a tag name from an IXMLDOMDocument2 object in Delphi

I have something like this: uses MSXML2_TLB; type TDocumentType = (dtOrder, dtInvoice, dtStatus, dtError); // And a few more, actually function DetermineDocumentType(doc: IXMLDOMDocument2): TDocumentType; ... It must do something simple: determine what kind of XML is contained in the doc parameter. The XML could be something like: <Or...

uiscrollview or uipagecontrol to display image from web (xml data) asynchronously

uiscrollview or uipagecontrol to display image from web (xml data) asynchronously Hi...all experts. I'm new to iphone development. Now, I'm planning to develop like "Photo" in iphone Default apps. Every image is pulled out from web service(xml). However, parsing xml is extremly slow. Well, I've got found apple's office document, wh...

Converting the children of XElement to string.

I am using an XElement to hold a block of HTML serverside. I would like to convert the children of that XElement into a string, sort of like an "InnerHtml" property does in javascript. Can someone help me on this please? :) ...

Hierarchical Menu in MVC.NET driven by XML

I am trying to create a hierarchical xml based menu in MVC.NET <?xml version="1.0" encoding="utf-8" ?> <NavigationMenu id="1" Name="myMenu" Lang="EN"> <NavigationMenuGroup Header="Home" Name="header1" Link="/home" /> <NavigationMenuGroup Header="Manage" Name="header2" Link="/options" /> <NavigationMenuGroup Header="About" Name="he...

remove whitespace from html document using ruby

So I have a string in ruby that is something like str = "<html>\n<head>\n\n <title>My Page</title>\n\n\n</head>\n\n<body>" + " <h1>My Page</h1>\n\n<div id=\"pageContent\">\n <p>Here is a para" + "graph. It can contain spaces that should not be removed.\n\nBut\n" + "line breaks that should be removed.</p></body></ht...

XML Can't get value of child node : c#

Hi , I'm newbie in XML ^_^ <a> <book> <c> <e>Val1</e> </c> <d>val2</d> </book> <book> <c> <e>Val3</e> </c> <d>val4</d> </book> Question is i need to get value inside each book first i use XmlNodeList xnList = xDoc.SelectNodes("/a/book"); problem is node "c" has child "e" so i cant get its value like i g...

Geotagging in xml can't be use in c#

I'm new in twitter api and now i try to get the geotagging from xml data of twitter my code for get geo code is XmlNode eNode = xn.SelectSingleNode("coordinates/georss:point"); error is XPathException was unhandle by user code -Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function. bu...

XQuery that updates if something is true and otherwise returns error

I'm trying to create a xquery expressions that inserts some new nodes only if a condition is true and returns an error if the condition is false. A simplyfied version of my state is: let $a := [...] return if($a/@something != "true") then ( insert node ( element {'Foobar'} { } ) into $a/somenode ) else ( ...

How to pull random rows from a database but ensure every row is selected before any are repeated?

I am doing a project on the blackberry. There are two XML databases, Full & Lite. In total there are 350 questions in Full and 20 questions in Lite. When a user takes the Full test, 50 questions are randomly asked from the full set of 350, chosen at random (for Lite it's 10 questions). As the user retakes the test, I want to ensure ever...