xml

Transforming XML mixed nodes with disable-output-escaping

Variations on this question have been posted, but I couldn't find any that address the base case. I thought it would be good to have a canonical answer to the simplest version of the problem. This question assumes xslt 1.0. I have an XML document that contains mixed nodes, e.g.: <paragraph> This is some text that is <bold>bold</b...

Convert doc/docx to semantic HTML

I would like to convert doc/docx documents to semantic HTML. Some wishes/requirements: Semantic HTML such that headers in the document are <h1>, <h2> etc., tables are <table> and so forth. Should preferably be possible to handle headings, lists, tables and images. Graphs and math formulas is a nice extra. • Doesn't have to be conver...

The easiest way to populate a collection from XML file in .NET

I have the following XML file: <?xml version="1.0" encoding="utf-8" ?> <scripts> <ScriptName> <name> "My Name" </ScriptName> <ScriptBody> "body contents" </ScriptBody> </script> </scripts> And the following object: public class DbScript { #region Constructors public DbScript() ...

In HTTP, Prompt to Save and XML File Rather Then Render

In a Web Application I am creating, users can backup their data locally. The backup data is an XML file. At the moment, most browsers try to display this file. What should I change in the HTTP response to suggest to a user-agent that the file should instead be saved? ...

convert amp; to & and ?F to Degree F in Vb.net

Hello, The XML String I am getting from other application is converting & to &amp; and 0F to ?F etc. I am loading the XML string into XDocument and inserting into db using linq. Is there any easy way to replace those characters with actual ones. thanks ...

C# Crystal Reports and XML Dataset (ADO.NET) Data typing problems

Afternoon Developers, I have a problem that's beginning to get on my wick. I have looked through google and Crystal Reports help and am still stuck for a solution. We have created an XSD complete with full information about data-types and the like. A report has been created that is linked to this XSD (using a c# class generated using M...

Creating classes or just using associative arrays for XML data in PHP?

From a maintenance and code organization standpoint, in PHP5, does it make sense to create/define objects and classes for XML data coming from a web service? Using Twitter's API as an example, I would have a class for each API method (statuses, users, direct_messages, etc). For statuses/public_timeline, I would have something like this...

Does the sequence schema element guarantee order of child elements?

Given this xml schema (fragment): <xs:element name="GetIEnumerableResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="GetIEnumerableResult" nillable="true" xmlns:q4="http://schemas.microsoft.com/2003/10/Serialization/Arrays" type="q4:ArrayOfstring" /> </xs:sequence> </xs:complexType> </xs:element>...

How to use Where clause to match DateTime condition

Below query works fine for me until I apply Where condition for Hour with attribute Id = '06/02/2009 12:00CDT'. I need to get the max temp for today's date only, and I am not able to use the Where condition in the date field. Any ideas on what I am doing wrong? Dim document = XDocument.Load("c:\meridian.xml") Dim wind_gusts = From cou...

Data files storage approach on web servers.

My web application stores product information in XML files on disk, on the web server. This is perfectly fine when it comes to a few products, however I have my worries that large amounts of files may cause problems. So let's say I'm gonna have 20,000 products, that would mean having 20,000 XML files inside a directory. I'm not familiar...

Linq to XML - Trying to print the Infinity symbol

Hey all, I am using Linq to XML for some HTML output files. I need to place the infinity symbol (&#8734;) in the code on output in some table cells. I am creating an XElement like this var table = new XElement("table", new XElement("tr", new XElement("td", "&#8734;") ) ); var document...

How can I write xml with a namespace and prefix with XElement?

This may be a beginner xml question, but how can I generate an xml document that looks like the following? <root xmlns:ci="http://somewhere.com" xmlns:ca="http://somewhereelse.com"&gt; <ci:field1>test</ci:field1> <ca:field2>another test</ca:field2> </root> If I can get this to be written, I can get the rest of my problem to wo...

Groovy - How to transfer XML nodes between documents?

Hi everyone, to the %subj%, I've tried: def xp = new XmlParser(); def testsuite = xp.parseText( "<testsuite/>" ); def testsuite1 = new XmlParser().parse( "testsuite.xml" ); testsuite1.testcase.each { testsuite.append( it ); } But this gives me an exception: groovy.lang.MissingMethodException: No signature of method: groovy.util.N...

Passing a PHP array in a SOAP call

So I am trying to include the following XML in my SOAP request: <Responses> <Response> <QuestionAnswerID>someint</QuestionAnswerID> <QuestionID>someint</QuestionID> </Response> <Response> <QuestionAnswerID>someint</QuestionAnswerID> <QuestionID>someint</QuestionID> </Response> </Responses>...

Is there a way to get all of a DOMElement's attributes?

I'm reading some XML with PHP and currently using the DOMDocument class to do so. I need a way to grab the names and values of a tag's (instance of DOMElement) attributes, without knowing beforehand what any of them are. The documentation doesn't seem to offer anything like this. I know that I can get an attribute's value if I have its n...

Why do I get an error from XML::SAX::PurePerl::EncodingDetect although I did not load that module?

Hi, Below is the script I have written to change the value of one of the parameter in an XML file situated at a different location: #!/usr/bin/perl -w use Cwd; use XML::Simple; use Data::Dumper; no warnings; my $before_upgrade_value = &pre_upgrade_value; print "Value before upgrade:: $before_upgrade_value \n"; &change_value ($before...

Storing Data as XML

In which cases storing data as XML is preferable to RDBMS and why? Can you give any analogy? ...

Is this a bug in XSD implementation? Why doesn't this work?

Hi, I have one xsd file I'd rather not modify (Exceptions.xsd): <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://me.com/Exceptions.xsd" targetNamespace="http://me.com/Exceptions.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified" > <xs:element name="Exception" typ...

problems with xml output from C# webservice and/or xpath query

Hi! The webservice I've build returns XML by default, I added my own XML nodes which I need to query in a different application (Nintex). I do that with Xpath. But I can't seem to get the result I want... public class Service1 : System.Web.Services.WebService { public struct aduser { public String result; pu...

How to use if statement in xsl to check if a path is valid?

Hello. What I am doing is reading in some xml and using xsl to output it in a table to make it more readable. So some sample xml: <example1> <sample name="aaa"> <help1>Help</help1> <help2>Me</help2> </sample> <sample name="bbb"> <noHelp1>No</noHelp1> <noHelp2>Help</noHelp2> </sample> </example1> So I have a ...