xml

Using Python's xml.dom.minidom

I'm trying to use Python's xml.dom.minidom, and I'm getting the following error: >>> from xml.dom import minidom >>> xdocument = minidom.Document() >>> xrss = minidom.Element("rss") >>> xdocument.appendChild(xrss) <DOM Element: rss at 0xc1d0f8> >>> xchannel = minidom.Element("channel") >>> xrss.appendChild(xchannel) Traceback (most rece...

Changing document's attributes in Python's xml.dom.minidom

I created a xml.dom.minidom.Document. How do I give it attributes so that when I do .toprettyxml() it will show like this: <?xml version="1.0" encoding="iso-8859-2"?> ...

Default is JSON in Script Manager ?

Hi, I used ScriptManager control on my asp.net page but It sends my data as Json to server, is it default ? and Can I change it with XML ? ...

Updating DOM element with AJAX return data fails in jQuery

I'm doing a simple AJAX post request in jQuery to another page on my site to get an XML document response. I'm putting the response into a pre element with syntax highlighting enabled. The response comes through fine (I can alert it), but it isn't being added to thepre element when I attempt to assign it in the handlResponse function wit...

Scrambling Text Elements in XML

How is it possible to take an XML document and in .Net scramble all text elements to make them un-readable to a human? E.g. Make <root><Node1>My Name is Ben</Node1></root> Into <root><Node1>klj sdlasd asdjfl</Node1></root> Points: We only need scrambling not encryption, i.e. not human readable at a glance. It doesn’t matter if...

How can I split an <xsl:foreach> into multiple parts?

I have a list of elements that I want to split into individual lists of 3. The end result would be something like this: <ul> <li>element</li> <li>element</li> </ul> <ul> <li>element</li> <li>element</li> </ul> <ul> <li>element</li> <li>element</li> </ul> My XSLT is like this, but it doesn't work, because I can...

How to validate an XML document using a RELAX NG schema and JAXP?

I would like to validate XML documents using RELAX NG schemata, and I would like to use the JAXP validation API. From Googling around, it appeared that I could use Jing and the ISO RELAX JARV to JAXP Bridge. Unfortunately, after adding both to my classpath, I can't get it to work. SchemaFactory is just throwing an IllegalArgumentExcepti...

How to resolve an internally-declared XML entity reference using NSXMLParser

I have an XML file that uses internally-declared entities. For example: <?xml version="1.0" encoding="UTF-8"?> ... <!ENTITY my_symbol "my symbol value"> ... <my_element> <my_next_element>foo&my_symbol;bar</my_next_element> </my_element> ... Using the NSXMLParser class, how am I able to resolve the my_symbol entity reference? ...

Adding a node to to another in XSLT

I have xml like this: <configurationData> <path name='b'> <path name='a'> <setting name='s1'> ![CDATA[XXXX]] </setting> <setting name='s2'> XXXX </setting> </path> </path> </configurationData> where configurationData is the root node, and there can be may nested...

Help with putting RDF in a web page (jsp)

When I read the documentation on Common-Tags, I thought it would be easy to put this in a jsp because the examples were cut and paste <body xmlns:ctag="http://commontag.org/ns#" rel="ctag:tagged"> <span typeof="ctag:Tag" rel="ctag:means" resource="http://rdf.freebase.com/ns/en.u2" property="ctag:label" c...

XDocument or XMLDocument

Hi everyone, I am now learning XMLDocument but I've just ran into XDocument and when I try to search the difference or benefits of them I can't find something useful, could you please tell me why you would use one over another ? Thanks in advance. ...

What's the most commonly used XML library for C++?

I saw a few libraries through a quick Google search. What's generally the most commonly used XML implementation for C++? I'm planning on using XML as a means for program configuration. I liked XML because I'll be making use of its tree-like structure. If you think you have a more suitable solution for this, feel free to mention it. I wa...

problem with DWR integration in spring?

Actually this is not, how can we integrate DWR and all that. But actually the problem is i am using xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" and few hours back 'http://www.directwebremoting.org' was down, so i was unable to deploy my application, And now when the site is back i got to know that this link 'http:/...

how to read data from xml file

<?xml version="1.0" encoding="utf-8" ?> <user> <username>prince</username> <password>user1</password> </user> This is my xml file name as user.xml. Now when i click the button in the page, i need to get the data from that file and place that data in variable like: string strusername = data cmg from xml file (prince) str...

How to generate an XML file

I need to create an xml file here bool result= false; How to achieve this in ASP.NET with C# syntax. result is value that I need to add in the XML file. I need to create an XML file under a folder with contents like this <?xml version="1.0" encoding="utf-8" ?> <user> <Authenticated>yes</Authenticated> </user> thank you ...

How to return XML in an Zend Framework Application

Hi all, I'm having problems returning XML in my ZF Application. Below is the code I have: <?php class ProjectsController extends Gid_Controller_Action { public function xmlAction () { $content = "<?xml version='1.0'><foo>bar</foo>"; header('Content-Type: text/xml'); echo $content; } } ?> I've also tried the following: <?php...

How can I parse JSON in Perl?

I want to use Perl script that gets the JSON data and converts it into XML file. How can I do that in Perl? ...

How do I retrieve an XML Element where an attribute is either X or Y?

Consider this xml: <parent> <child name="alpha" /> </parent> and also this xml <parent> <child name="beta" /> </parent> There should be only a sinlge node at /parent/child with either alpha or beeta as it's name value. To clarrify... there will never be 2 child nodes one each named alpha and beta I'm trying to create a si...

Flex TreeDataDescriptor

How do I get a Flex tree to display only specific XML nodes? A sample of the XML data is below. Only the Grouper and Product elements should be displayed as branch and leaf nodes respectively; the Name elements should not be displayed. I can't use XSL or e4x to modify the XML as the Name elements' text is used as the label for the Gro...

Why can't I set the XDocument XDeclaration encoding type to iso-8859-1?

Why doesn't the following code set the XML declaration encoding type? It always sets the encoding to utf-16 instead. Am I missing something very obvious? var xdoc = new XDocument( new XDeclaration("1.0", "iso-8859-1", null), new XElement("root", "") ); output: <?xml version="1.0" encoding="utf-16"?> <root></root> ...