xml

Help with using ConfigurationSection to properly read from a config file

I'm trying to create classes to read from my config file using ConfigurationSection and ConfigurationElementCollection but am having a hard time. As an example of the config: <PaymentMethodSettings> <PaymentMethods> <PaymentMethod name="blah blah" code="1"/> <PaymentMethod name="blah blah" code="42"/> <PaymentMethod name...

How do I safely create an XPathNavigator against a Stream in C#?

Given a Stream as input, how do I safely create an XPathNavigator against an XML data source? The XML data source: May possibly contain invalid hexadecimal characters that need to be removed. May contain characters that do not match the declared encoding of the document. As an example, some XML data sources in the cloud will have a ...

How do I get access to SOAP response

(If anything here needs clarification/ more detail please let me know.) I have an application (C#, 2.* framework) that interfaces with a third-party webservice using SOAP. I used thinktecture's WSCF add-in against a supplied WSDL to create the client-side implementation. For reasons beyond my control the SOAP message exchange uses WSE2...

Parsing a local XML Document in WPF (works in debug, fails once published).

I am building a WPF application. Inside that application I am using the XmlReader class to parse several local XML files. The code I have written works perfectly during debugging, but fails once I publish the application and install it. I have the XML documents as CONTENT in build action, and I have them set to COPY ALWAYS.I can confirm...

Editing .plist files - are single quotes allowed as strings?

In particular, I'm editing the AutoCompletion.plist file for CSSEdit (if that even matters). My question is, are there any characters withing the STRING elements that need to be escaped? spaces? quotes? EDIT: Just to be clear, I'm not using CSSEdit to edit the file - rather the file is part of the CSSEdit package. I'm using TextMate to...

Putting a pyCurl XML server response into a variable (Python)

I'm a Python novice, trying to use pyCurl. The project I am working on is creating a Python wrapper for the twitpic.com API (http://twitpic.com/api.do). For reference purposes, check out the code (http://pastebin.com/f4c498b6e) and the error I'm getting (http://pastebin.com/mff11d31). Pay special attention to line 27 of the code, which ...

Ruby on Rails XML generation

I am attempting to build a simple method that creates an XML file from a database in ruby on rails. I feel like my code is right but I am not seeing all of the users in the XML. I am a complete newbie to RoR. Here's my code: def create_file @users = User.find(:all) file = File.new('dir.xml','w') doc = Document.new make = Ele...

Returning a value of type Microsoft.XLANGs.BaseTypes.XLANGMessage

Hi there, Having a problem trying to create a function, as part of a BizTalk helper class that returns a value of type (Microsoft.XLANGs.BaseTypes.XLANGMessage). The function code is as follows: public XLANGMessage UpdateXML (XLANGMessage inputFile) { XmlDocument xDoc = new XmlDocument(); XLANGMessage outputFile; xDoc = (Syste...

XML Schema Validation with RelaxNG

Which XML validation tools can you recommend for both performance and accuracy, each of which is a critical issue on our system? We have the following requirements: It is not not xmllint (see below) Supports RelaxNG Can easily integrate with Perl (this is optional, but it would be nice) Why not xmllint? (This is background and you ...

Quick & Dirty way to update "IDs" in a string formatted as XML (C#)

For a one-shot operation, i need to parse the contents of an XML string and change the numbers of the "ID" field. However, i can not risk changing anything else of the string, eg. whitespace, line feeds, etc. MUST remain as they are! Since i have made the experience that XmlReader tends to mess whitespace up and may even reformat your ...

Strengths and weaknesses of XmlBlaster

Are/were you using XmlBlaster? What do you think about it? What are its weaknesses and strengths? ...

XSLT selecting attribute of ancestor; "../.." works, "ancestor::<tagname>" doesn't

I'm running through an XML document, selecting all the elements, and creating links based on the ancestor which is usually two nodes up in the tree, but occasionally 3 or 4 nodes up. For the majority of the elements, using <xsl:value-of select="translate(../../@name,$uc,$lc)" /> works just fine, but for the cases where the ancestor ...

Turn OFF self-closing tags in SimpleXML for PHP?

I'm building an XML document with PHP's SimpleXML extension, and I'm adding a token to the file: $doc->addChild('myToken'); This generates (what I know as) a self-closing or single tag: <myToken/> However, the aging web-service I'm communicating with is tripping all over self-closing tags, so I need to have a separate opening and c...

Can I fail to deserialize with XmlSerializer in C# if an element is not found?

I am using XmlSerializer to write and read an object to xml in C#. I currently use the attributes XmlElement and XmlIgnore to manipulate the serialization of the object. If my xml file is missing an xml element that I require, my object still deserializes (xml -> object) just fine. How do I indicate (preferably via Attributes) that a...

Does Python 2.5 include a package to natively transform an XML document?

In my Python app, I have an XML document that I'd like to transform using my XSL file. I'm currently using xml.etree to generate the XML document, but I haven't found anything within Python 2.5 that will allow me to natively transform my XML document. I've already found one library (libxslt) which can execute the transformation, but I ...

strip out tag occurrences from XML

I'd like to strip out occurrences of a specific tag, leaving the inner XML intact. I'd like to do this with one pass (rather than searching, replacing, and starting from scratch again). For instance, from the source: <element> <RemovalTarget Attribute="Something"> Content Here </RemovalTarget> </element> <element> More...

LINQ to Array in Silverlight 2

There's something wrong with my code or I'm just not understanding this fully. I have the following code that runs a query that MAY contain more than one RIGHT attribute and want to store each within an array for later fetching: var members = from myList in o_data.Descendants(bp + "Reaction") select n...

Suggestions for a Beginner Level ASP/XML Test

I'm looking for suggestions for a beginner level ASP/XML test. Essentially I'm trying to hire an extremely junior programmer. I'm in the process of trying to hire a junior programmer to help maintain a large code base of somewhat repetitive ASP pages. I'm slowly in the process of making more modular, maintainable code but until that h...

Building dynamic fields using ActiveRecord::Serialization.to_xml

I'm curious about people's experiences using AR's to_xml() to build non-entity fields (as in, not an attribute of the model you are serializing, but perhaps, utilizing the attributes in the process) from a controller. to_xml seems to supply a few options for doing this. One is by passing in references to methods on the object being...

PHP SimpleXML, CodeIgniter and Apache with Suhosin

I have an application I am writing in PHP5, using the CodeIgniter framework. I have it running on both Windows (using Xampp) and Ubuntu (using standard Apache, PHP, MySQL stack). I have a form, that takes XML, parses it (using simpleXML) and posts the results into a database. On Windows - no problem, works as intended. On Linux - big ...