xml

Should I use JSON or AJAX for response data?

Why JSON? I have done some tests today, and the request time for both JSON, or a normal AJAX request was the same. In the "normal request" I have returned the complete text+html tags, in the JSON request, logically I returned a "json return type" and I have created the HTML with client-side JavaScript. I don't get it, why are the big si...

What is the XML equivalent of C# Regex.Replace method?

I am validating a Phone Number textbox. I would like to first strip the unneccessary characters from the value entered then validate that the number of characters is not more or less than 11. I know how I would do this in C# code. Unfortunately I now need to do this in an XML document. Validating the length of the corrected data is not a...

A lightweight XML parser efficient for large files?

I need to parse potentially huge XML files, so I guess this rules out DOM parsers. Is out there any good lightweight SAX parser for C++, comparable with TinyXML on footprint? The structure of XML is very simple, no advanced things like namespaces and DTDs are needed. Just elements, attributes and cdata. I know about Xerces, but its she...

saving file using curl

how can i save a file using curl and php ...

Is xs:choice an equivalent of C++ enumeration?

We have a lot of serialization done through MS XML 4. When we serialize C++ enums we use a table to translate each possible value to a string and them store that string as an attribute value. When we deserialize we read that attribute value, compare it against all items in the table and retrieve the corresponding enum value. If we fail t...

IN java, how a commons-Digester process an input XML file?

I am new to java and I came across a statement in a java project which says: Digester digester = DigesterLoader.createDigester(getClass() .getClassLoader().getResource("rules.xml")); rules.xml file contains various patterns and every pattern has different attributes like classname ,methodname and some another properties. i goog...

Validation of XML file against XSD in Ruby

Hi I'm trying to validate the following XML against a XSD schema using Ruby. It simply won't work, stops with an error message telling me Error: Element 'request': No matching global declaration available for the validation root. Maybe it's the namespace? I'm desperate. Please help. Thanks! XML: <?xml version="1.0" encoding="UTF-...

parse XML and insert data in MySQL table

Hello everyone I am trying to parse a xml file that i have (using javascript DOM). and then i want to insert this data in a mysql table (using php). I know how to parse xml data. But i am unable to figure out how to use php and javascript together and insert data in mysql table. Kindly help me in this. Best Zeeshan ...

In .NET XML deserialization, how can I allow polymorphic use of Array types ?

Example Schema: <complexType name="Dog">...</complexType> <complexType name="Cat">...</complexType> <complexType name="ArrayOfDog"> <sequence> <element name="Dog" type="tns:Dog minOccurs="0" maxOccurs="unbounded" /> </sequence> </complexType> <complexType name="Foo"> <sequence> <element name="Bar" type="str...

XSLT Insert html content

I'm trying to insert some HTML at a given point. The XML file has a content node, which inside that has actual HTML. For exmaple here is the content section of the XML: ----------------- <content> <h2>Header</h2> <p><a href="...">some link</a></p> <p><a href="...">some link1</a></p> <p><a href="...">some link2</a></p> </...

Why is my XML validation failing against its schema?

Howdy, I need to validate a XML file against a schema. The XML file is being generated in code and before I save it I need to validate it to be correct. I have stripped the problem down to its barest elements but am having an issue. XML: <?xml version="1.0" encoding="utf-16"?> <MRIDSupportingData xmlns="urn:GenericLabData"> ...

Are there valid reasons to hold data internally as XML?

In the years that I've been at my place of employment, I've noticed a distinct trend towards something that I consider an anti-pattern: Maintaining internal data as big strings of XML. I've seen this done a number of different ways, though the two worst offenders were quite similar. The Webservice The first application, a web service...

Adding text to beginning and end of file in C#

I have a process which picks up a series of "xml" files. The reason I put xml in quotes is that that the text in the file does not have a root element which makes in invalid xml. In my processing, I want to correct this and open up each file add a root node to the beginning and end of each file, and then close it up. Here is what I ha...

There is any tool that creates a class from a XML for deserialization? (C# .NET)

I have this XML file, and I want to deserialize it to an object. But I don't want to type its class definition. There is any tool that can create the C# code of the class for me, inferring the data types from sample data? ...

How to create SQL Server table schema from a XML schema? (with .NET and Visual Studio 2008)

I have a XML schema, and I know that "xsd.exe" can generate the C# code for it. But I want to know if is possible to automatically create the MS SQL Server 2005+ tables from the XSD, with the help of this or other tools. BTW I didn't get what the C# code generated by "xsd.exe" is worth for. What's the difference between code generated b...

.Net Transforming large XML docs with XSL

Question: What is the best way to transform a large XML document (>200MB) using XSL in .Net? Background: I have a application that feeds me large data files, I cannot change the format. In the past I have been able to translate smaller data files with no issues. Originally I was working with the XML as strings and was running out of ...

Linq to XML (Base64 Encoded)

I have got to convert a PDF to a Base64 Encoded and write it to a element in a XML file. I have got the Base64 Encoded string (very long/big) but the spec im working from says the following: This has been chosen, to ensure the XML file may be displayed and validated without any potential problems caused by the handling of the raw binary...

How can I get wildcards to work in XPath attribute value matching?

I have the following XML: <root> <foo> <bar type="a whole bunch of stuff, then a magic string: MUPPET" /> <value>my Muppet value</value> </foo> <foo> <bar type="some other stuff, then a different magic string: GREMLIN" /> <value>my Gremlin value</value> </foo> </root> I'd like to build an XPath query that retur...

Pros/Cons for containers for child nodes in XML?

I've noticed that different XML schemas define child elements differently. Some define them directly under the parent nodes like so: <parent> <foo /> <foo /> ... <foo /> <bar /> <bar /> ... <bar /> </parent> where as others define container nodes around the child nodes like so: <parent> <foos> ...

problem with xml file saving using curl and php

I am using curl and xml to post my xml to a URL. I am getting response from it right now, but its not displaying in output. when I take the View Source page by right clicking its there like the XML file output. I need to store that xml document to a file. I used this code below <? $path = "https://newport.ingrammicro.com/mustang"; /...