xml

URI to an XSD File In A Class Library

I have a class library that stores several XSD files. When creating an XmlSchema class in the same library, I would like to know how to get the URI to the XSD file. The library is being deployed with a web application. Is there a way to get the URI from the web application as well? Thanks. ...

python: is there an XML parser implemented as a generator?

I'd like to parse a big XML file "on the fly". I'd like to use a python generator to perform this. I've tried "iterparse" of "xml.etree.cElementTree" (which is really nice) but still not a generator. Other suggestions? ...

Parse into HashMap using Commons Digester

I need to parse xml into a HashMap where the 'key' is the concatenation of two elements attributes. The xml looks like : <map> <parent key='p1'><child key='c1'> value1</child></parent> <parent key='p2'><child key='c2'> value1</child></parent> </map> In the 1st entry of map, I want to put 'p1.c1'as the map key while 'value1' as the...

How to make an xpath result into a string with PHP?

if($xmlobj = simplexml_load_string(file_get_contents($xml_feed))) { $result = $xmlobj->xpath("TrafficMeta"); } The above code returns the desired result and when viewed with print_r it shows this, which is what I want to get (sessionId): Array ( [0] => SimpleXMLElement Object ( [sessionId] => tbfm1t45xplzrongbtbdyfa5 ) ) How ca...

How to zip a WordprocessingML folder into readable docx

I have been trying to write a simple Markdown -> docx parser/writer, but am completely stuck with the last part, which should be the easiest: i.e. compressing the folder into a .docx that Word, or any other .docx reader, will recognize. My parser-writer is irrelevant really: I have this problem if I simply unzip any old Word-produced...

How determine the right xml to write out

<?xml version="1.0" encoding="UTF-8"?> <idmef:IDMEF-Message version="1.0" xmlns:idmef="http://iana.org/idmef"&gt; <idmef:Alert messageid="abc123456789"> <idmef:Analyzer analyzerid="bc-corr-01"> <idmef:Node category="dns"> <idmef:name>correlator01.example.com</idmef:name> </idmef:Node> </idmef:Analyzer> <id...

How to parse a value from an XML tag in C language?

I'm getting this string as an input "<operator value=1/>". How in C can I parse out this string to get the "1" back? ...

Parse a char from an xml in C language?

Hi, I'm passing as input to my program: "<param value=s/>" I use this code: char character[1]; sscanf(data, "<param value=%c/>", &character); printf("%c", character); However the output seems to be "s/>" instead of only "s" char. what's wrong here? ...

Posted XML attributes dropped by Rails?

echo '<request><item attribute="foo">bar</item></request>' | curl -X POST -H 'Content-type: application/xml' -d @- http://10.0.1.51:3000/baz/evaluate My Rails application forgets all about the attribute when it receives the posted XML. Processing BazController#evaluate (for 10.0.1.3 at 2009-10-03 18:29:32) [POST] Parameters: {"reque...

Outputting CDATA in XQuery

How would I, using XQuery, transform <author>John Smith</author> to <author><![CDATA[John Smith]]></author> ? Also, how would I transform <content>&lt;p&gt;&lt;em&gt;Hello&lt;/em&gt;&lt;/p&gt;</content> to <content><![CDATA[<p><em>Hello</em></p>]]></content> ? If it matters, I am using XSLPalette.app. ...

How to get the parameter value of the currently active component in Joomla

I'm creating a custom template, and i have added a parameter 'headerpic' to various views. <param name="headerpic" type="filelist" default="" label="Header Image" description="Select the image for the header" directory="images/headers" filter="\.jpg" /> The client can then change the header image for each page from a drop down list. ...

Caching and accessing configuration data in ASP.NET MVC app.

I'm about to take a look at how to implement internationalisation for an ASP.NET MVC project. I'm looking at how to allow the user to change languages. My initial though is a dropdownlist containing each of the supported langauages. Whoever a few questions have come to mind: How to store the list of supported languages? (e.g. just "...

I'm having trouble parsing a facebook feed using simplexml

http://www.facebook.com/feeds/share_posts.php?id=207302593&amp;viewer=207302593&amp;key=d95b2de790&amp;format=rss20 The link above is the URL to my shared posts on Facebook. When I load that URL in to simplexml_load_file() it provides an entire page of errors. Looking at the errors, it looks like Facebook is spitting out HTML instead of...

xml diff in ruby?

What is the best/fastest way to merge two xml documents with ruby? I have two xml files, one that's formatted so it is visually appealing, one that isn't (and it has comments and whitespaces stripped) that has a few changes to some of the nodes throughout, and it gets changed often. So I'm trying to figure out a simple and efficient so...

Cannot parse poorly formed XML

I've been trying to parse this feed. If you click on that link, you'll notice that it can't even parse it correctly in the browser. Anyway, my hosting service won't let me use simplexml_load_file, so I've been using cURL to get it then loading the string into the DOM, like this: $dom = new DOMDocument; $dom->loadXML($rawXML); if (!$dom...

Creating XML in C# for jQuery

I'm trying to generate some XML for a jQuery.get (AJAX) call, and I'm getting the following error from my C# page: "Using themed css files requires a header control on the page. (e.g. <head runat="server" />)." The file generating the XML is a simple .aspx file, consisting entirely of: <%@ Page Language="C#" AutoEventWireup="true" Code...

How to get rid default xml namespace if I one to serialize an object in wcf using datacontact.

Here is my interface [ServiceContract(Namespace = "")] interface IParam { } Here is my class public class Parameter : IParam { private string categoryName; [DataMember] public string CategoryName { get { return categoryName; } set { categoryName = value; } } } My operation cont...

Django - Parse XML, output as HTML fragments for iFrame?

heya, I've been asked to quickly put together a small system that takes a Yahoo XML feed, parses it, and creates a HTML fragment based on it. At the moment, I'm using Django to handle the URL routing, with some Python script, and outputting a bit of HTML in a (with hardcoded dimensions as inline CSS), that can hopefully be put into an...

Import XML into a Grails Domain Class

Hi, I am reading an XML file with a schema based on a Domain Class. Here is a simple example for illustration (my current situation concerns a lot of fields from a lot of classes) : class Player { String name Date birthDate } The XML file to read is : <players> <player name='P1' birthDate='12-09-1983'/> </players> So my ques...

iPhone : Parse XML file with attribute

hi all, i want to parse the XML file. i am enable to parse simple XML file. but there are little complex XML file <?xml version="1.0" encoding="utf-8"?> <Level> <p id='327'> <Item> <Id>5877</Id> <Type>0</Type> <Icon>---</Icon> <Title>Btn1Item1</Title> </Item> <Item> <Id>5925</Id> <Type>0</T...