xml

Regex for quoting unquoted XML attributes

Edit: The 100% correct theory is that you don't want to do this at all. However I have accepted the answer that helped the most. So I'm being given ugly XML from a client that promises to fix it. In the meantime I need to clean it up myself. I'm looking for a regex to use in Java to add quotes around unquoted attributes. The general cas...

how to create a c# app to listen for xmls and reply in xml

Hi, I know that you can create web services in .net and have them run on iis. I'd like to make something that doesn't rely on iis as the webserver I'm using runs apache. The eventual app should listen for incoming xml documents and repy in the form of an xml document, the client application will be running Javascript and sending xmls v...

How are xml schemas referenced in practice?

When you add an xml schema to a document like I understand that the xmlns is not actually the location of the xsd file. Is this correct? How do you in practice reference an xml file's schema? Is it usually on a web server? That would seem very chatty. Is it referenced by relative path? Is it not actually referenced in the xml...

PHP MYSQL to XML - Efficient File Generation

Hi there, I run a price comparison data engine, and as we are collecting so much data im running into pretty serious performance issues. We generate various XML files, one per product and within the product data is each Online shop we grab data from, with their price, link, description, etc. We have multiple feed parsers/scrapers which ...

MS Project XML Serialization

I am trying to read data from an MS Project XML file. I have used the XML Schema Tool to generate a set of strongly typed classes based on the Microsoft Project 2007 XML Schema. However, I ran into several issues. The xmlns property on the root node from the XML exported from MS Project does not match the XSD schema. MS Project gener...

Is it wrong to transform/unserialize xml to an array to interface with it?

Consider a SOAP response with lots of nodes, I've noticed some developers using a PEAR Unserialize class while I've always been using simple_xml. Are there any disadvantages to interfacing if you aren't really doing any XML transformation or rendering but simply using data from it. ...

Find parent from descendant attribute xml linq?

I'm trying to capture Elements with a child decendent attribute == value class Program { static void Main(string[] args) { XDocument doc = XDocument.Load(@"path to doc"); var query = from q in doc.Elements("Candidates").Elements("Candidates") //How to filter based on descendant attribute value...

ASP.NET web services and Blackberry -- need assistance with returning complex data

I need to transfer a significant amount of structured data that goes something like this in XML - <person> <fname></fname> <lname></lname> <DOB></DOB> . . </person> Each person record has 5 fields, and each time the app is opened, about 30-40 (possibly more) person records will be loaded. Will XML be a good imple...

Jmeter - generate xml

Hi all, I have a J2EE application that needs some extensive integration testing. I am using Jmeter to generate HTTP POST requests. So far I manage to send them to the server correctly but the xml is static. I am looking for a way to insert dynamic/random values into the XML and then send it to the server. Something like a PreProcessor b...

Correcting XmlReader problems using ReadToDescendant and/or ReadElementContentAsObject

I'm working on a mysterious bug in the usually very good open source project Excel Data Reader. It's skipping values reading from my particular OpenXML .xlsx spreadsheet. The problem is occurring in the ReadSheetRow method (demonstration code below). The source XML is saved by Excel and contains no whitespace which is when the strange b...

Help with XSD element having references to other elements but don't want things nested.

I have a XSD file I'm using to generate JAXB classes for a RESTful API I am working on. I have two classes. An Appointment and a Person. A Person has an Appointment. I'd like to end up with XML like this: <Appointment> <Person id="12345">Billy Bob</Person> ... </Appointment> So, that on the far end I an just fetch Person if...

How do I download the source code of a web page and then stick it in SAX parser as a whole?

I just want to download the source as a string. Then stick that XML (which is currently a string) into a parser. ...

How to read large xml file without loading it in memory and using XElement

I want to read a large xml file (100+M). Due to its size, I do not want to load it in memory using XElement. I am using linq-xml queries to parse and read it. What's the best way to do it? Any example on combination of XPath or XmlReader with linq-xml/XElement? Please help. Thanks. ...

Can someone help me with this JAVA SAXParser?

I've been fiddling for 3 hours and I can't get this F*** parser to work. Sorry for cursing. I don't understand why I can't find **one decent tutorial that does exactly what I want. I just want to send the function a String/XML. Then, parse it. it's not that hard. In python, I can do it with my eyes closed. Awesome, freaking documentat...

Does JAXWS client make difference between an empty collection and a null collection value as returned value ?

Since JAX-WS rely on JAXB, and since I observed the code that unpack the XML bean in JAX-B Reference Implementation, I guess the difference is not made and that a JAXWS client always return an empty collection, even the webservice result was a null element: public T startPacking(BeanT bean, Accessor<BeanT, T> acc) throws AccessorExcepti...

How to use a parameter in a xslt as a XPath?

I'd like to add an element to a xml document and I'd like to pass as a parameter the path to the element. sample.xml file: <?xml version="1.0"?> <stuff> <element1> <foo>2</foo> <bar/> </element1> <element2> <subelement/> <bar/> </element2> <element1> <foo/> <bar/> </element1> </stuff> Using: xalan.exe -p my...

Using simpleDom.php to parse an xml file works fine in windows but failsin unix .

Using simpleDom.php to parse an xml file works fine in windows but failsin unix . <br /> <b>Fatal error</b>: Uncaught exception 'InvalidArgumentException' with message 'chunk is not well balanced ' in SimpleDOM.php:576 Stack trace: #0 lib.php(367): SimpleDOM-&gt;insertXML('&lt;prebuilt.credi...') #1 save_document....

Unique xml nodes based on attribute

I want to use XSLT to transform a set of documents into one structure. I have the transformation working correctly to concatenate the documents. I don't know, however, whether the the documents have duplicate entries in them, which I will need to remove. I need to know how to remove these duplicates (if they exist) by an id attribute. A...

Why can't I open this XML in SAXParser?

public static void parseit(String thexml){ SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser; try { saxParser = factory.newSAXParser(); DefaultHandler handler = new DefaultHandler() { public void startElement(String uri, String localName, String qName, Attributes att...

How to perform edit and delete data from html table row as well as from xml file in the following code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Text" %> <%@ Import Namespace="System.Xml" %> <%@ Import Namespace="System.IO" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...