xml

transforming xml embedded in html

Hi, suppose I have xml inside an html document like <html> <body> <xml> <foo> <bar /> <baz /> </foo> </xml> </body> </html> What is the best way to apply xslt to the xml node? ...

Is XPath much more efficient as compared to DOM and SAX?

I need to parse an xml string and find values of specific text nodes, attribute values etc. I'm doing this in javascript and was using the DOMParser class for the same. Later I was informed that DOM is takes up a lot of memory and SAX is a better option. Recently I found that XPath too provides a simple way to find nodes. But I'm not ...

How do I reference the 'next' (as yet nonexistant) XML node in a sequence?

So to expand... I have some XML <root> <list> <item value="9"/> <item value="3"/> <item value="1"/> <item value="8"/> <item value="4"/> </list> </root> I have an XPath "/root/list/item [4]" which I believe will retrieve the 5th 'item' element (whose value attribute is 4) This suggest...

Python XML - build flat record from dynamic nested "node" elements

Hey guys, I need to parse an XML file and build a record-based output from the data. The problem is that the XML is in a "generic" form, in that it has several levels of nested "node" elements that represent some sort of data structure. I need to build the records dynamically based on the deepest level of the "node" element. Some exa...

Problem with XSLT and Namespaces

Hi, I am new to XSLT, so this question may have been answered other times. I've searched but I did not found anything :( I need to parse an XML like this <ns1:tagName1> <ns2:tagName2> This is the content </ns2:tagName2> </ns1:tagName1> And I using this XSL for that <xsl:template match="ns1:tagName1"> <r...

Linq-to-SQL With XML Database Fields -- Why does this work?

Some background: I have an database that I want to use linq-to-sql to update through a C# application. One of the columns in this table has an XML datatype. Every other column in that table (that isn't of an XML datatype) updates perfectly fine, but when I went to make changes to the XML field, the program executes (seemingly) correctl...

What method of parsing does XMLTextReader use ?

What method of parsing does XMLTextReader use ? I am confused. Sax or Dom ? ...

append conditional html file output with xml response

hey guys i have a restful xml service where client passes current version of html they are viewing. if the version on the server is the same as the client, i just respond with the current server version in xml. example: <Response ServerHTMLVersion="1" /> however if server html version is greater than current client version, i still spit...

What is the proper XPath for "all nodes exactly one below the base node?"

Presuming that I don't know the name of my base node or its children, what is the XPath syntax for "all nodes exactly one below the base node?" With pattern being an XmlNode, I have the following code: XmlNodeList kvpsList = pattern.SelectNodes(@"//"); Which looks right to me, but I get the following exception: System.Xml.XPath.X...

How do I reference config elements values in other config elements?

For example, I created a provider service that uses a database. In web.config, how do I set the provider's connection string to the main application connection string, defined in <ConnectionStrings>? ...

I18N of XML documents

I'm about to decide how to handle internationalisation of an XML-based format for UI description. The format typically looks something like this: ... <devif> <screen id="scr1" title="Settings for this and that"> <header text="Climate readings"/> <rd setp="123" text="Air temperature" unit="°C"/> <rd setp="234" text="Humidi...

How do I bind xml from a file to a WPF Treeview ?

I've spent the better part of the day trying to figure this out. From what I understand I need to use an XmlDataProvider but while debugging I see that it doesn't contain any data. Can someone demonstrate how to do that? ...

Reading and writing XML using JUST Java 1.5 (or earlier)

For reading XML, there is SAX and DOM built into Java 1.5. You can use JAXP and not need to know details about what parser is available... So, what are some prescribed APIs for one to write XML documents in Java 1.5 and earlier? I don't want to use a third party binary I don't want to assume a Sun VM or IBM VM etc and use some speciali...

Elegant examples of xslt?

After a long learning loop via XAML, I've returned to HTML and javascript, and realised that the concept of declarative code - in terms of rules for transformation - is an incredibly powerful concept. Despite its surfeit of syntax, XSLT processing of XML is the keystone of declarative transformation programming. I have, however, always ...

boost serialization NVP macro and non-XML-element characters

When using the BOOST_SERIALIZATION_NVP macro to create a name-value pair for XML serialization, the compiler happily allows the following code to compile, even though the element name is not a valid XML element and an exceptions is thrown when trying to actually serialize the object into XML: BOOST_SERIALIZATION_NVP(_member[index]) An...

Loading a remote xml page with file_get_contents()

I have seen some questions similar to this on the internet, none with an answer. I want to return the source of a remote XML page into a string. The remote XML page, for the purposes of this question, is: http://www.test.com/foo.xml In a regular webbrowser, I can view the page and the source is an XML document. When I use file_get_co...

craigslist rss feed

I'm trying to parse the data from a craigslist rss feed. This is the feed url - http://www.craigslist.org/about/best/all/index.rss I'm using jfeed and my code is given below jQuery(function() { jQuery.getFeed({ url: 'proxy.php?url=http://www.craigslist.org/about/best/all/index.rss', success: function(feed) { ...

Qt XML Input

I'm trying to input data from an XML file in a C++ program using the Qt tool kit. My XML data is formatted as follows: `<item> <title>title<\title> <tree_loc1>0<\tree_loc1> <parent>parent<\parent> <description>description<\description> <other_info>other info<\other_info> <location>location<\location> <last_mo...

Creating XML using the from XML clause using SQL 2000

I am creating an XML document from a SQL query and i was wondering if there is a way to output the version and encoding tag via the SQL Query? ...

MiniXml (php) unable to parse files larger than 100k

I am retrieving XML from a web service and then loading it into MiniXml (PHP). When the file is smaller than 100k it parses just fine. Larger, and I get an error: Call to a member function getElement() on a non-object This is happening when I try to get the first element off of the root element. $parsedDoc = new MiniXMLDoc(); $par...