xml

how to add xml namespces

Hi: This feed (snippit of it) needs to look exactly like this: <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd"> what do I add to this C# code to add that extra xmlns, xsi junk: writer.WriteStartDocument(); writer.WriteStartElement("AmazonEnvelop...

XSLT - XML to XLS

I have an XSLT template that gets applied to an XML file of data. The template generates an Excel Spreadsheet XML file. Everything works wonderful except for one minor issue.... When I open the spreadsheet in Excel, it treats it as an XML import and asks me whether the stylesheet should be applied. I would like to have it so it autom...

Transform Xml using Xslt

Hello, I have the following XML: <?xml version="1.0" encoding="utf-8" ?> <ApplicationSettingCategories> <Category>Cat1</Category> <Category>Cat2</Category> <Category>Cat3</Category> <Category>Cat4</Category> <Category>Cat5</Category> <Category>Cat6</Category> </ApplicationSettingCategories> I am trying to bind this Xml to a Dr...

Binding TreeView to XML

Hi I recently got it working to bind my XML document to my treeview by doing the following in the code behind file: XDocument doc = XDocument.Load("path\\dsCurrent.xml"); _treeView.DataContext = doc; and the following in the XAML: <Window.Resources> <HierarchicalDataTemplate ItemsSource="{Binding Path=Elements}" x:Key="TVTe...

How do I validate XHTML, ATOM, and CSS in Ruby?

I'd like to run validations on the static web content I'm creating. Are there any good validators for XHTML, ATOM, and CSS? (The first two would be covered by any general-purpose XML-DTD validator.) Later I failed to specify that I wanted local validation, not something that uses the W3C service. ...

How can I fix this PHP XML parsing error?

This is my first question :). Im writing a little twitter app in PHP that sends a DMs to all your followers. What im trying to do right now is to get the list of followers. So through twitter api and getting all usernames but for some reason this parsing error appear. Im new to php(but not so much to programming), I actually started lea...

How do I work with an XML tag within a string?

I'm working in Microsoft Visual C# 2008 Express. Let's say I have a string and the contents of the string is: "This is my <myTag myTagAttrib="colorize">awesome</myTag> string." I'm telling myself that I want to do something to the word "awesome" - possibly call a function that does something called "colorize". What is the best way ...

Loading Unicode Characters from XML and push into Form via AJAX

How can I load Unicode Characters (specifically a trademark symbol) from XML and push it into a Form via AJAX? When I push formelement.value += "\u2122" it works fine, but when I place "\u2122" into XML, load it via AJAX, and push it to the form element it does not work. Any ideas? Thanks ...

How do I POST XML data to a URL via JavaScript in an Adobe AIR app?

I'm writing an application that downloads an XML string from a URL and POSTs that to another URL (that's set up to handle an incoming "XML" field). I've got the first part right - it downloads the XML and I can alert() it and all that, but I'm unable to figure out how to POST that data to a server. function pull() { var myLoader = n...

How can you make a sequence of optional items which must be in order in an XML schema?

What I want to do is create a sequence element in an XML schema such that the contents must be in order, but may not all be present. For example, the schema would be something like this: <xs:element name="rods" maxOccurs="1" minOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="green" type="xs:positiveInteger" /> <xs:...

Is there a text editor that formats XML files nicely?

I know there are many: Notepad2, Notepad++, even UltraEdit... But I'm looking for a special feature. I want the editor to format my XML files for human understanding. When I open an XML file saved by my application all the XML is in one line, making it impossible for easy reading. I know MS Visual Studio does it (Crtl+E, D), anyone else...

Can I create an XSD schema that places an attribute on all complex types?

I would like to create an XSD that defines an attribute which can be placed on elements from other schemas, or elements that are not in any schema. For example, the schema would look something like this: <xs:schema id="MySchema" targetNamespace="http://tempuri.org/MySchema" elementFormDefault="qualified" xmlns="http://tempu...

How do you make an element in an XML Schema that allows any HTML element as its children?

I am trying to create an element in an XML schema such that only standard (X)HTML elements can be used as children. What I've tried is this: <xs:element name="description"> <xs:complexType> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:any namespace="http://www.w3.org/1999/xhtml" /> </xs:sequence> </xs:co...

Problem with word "Nestlé" in an XML doc (UTF-8 encoding) using NXXMLParser. Any idea?

Hi all, We are using NSXMLParser in Objective-C to parse our XML document, which are all UTF-8 encoded. One document has a string "Nestlé" in it (as in ...<title>Nestlé Novelties</title>...). The parser just quit, reporting an error with error code=9, due to the French letter "e" at the end of the word "Nestle". Furthermore, we tried us...

What's the ideal way to implement this PHP/XML function in a website?

Hi, I have this code written up to snatch some weather data and make it available on my website: if( ! $xml = simplexml_load_file('http://www.weather.gov/data/current_obs/KBED.xml') ) { echo 'unable to load XML file'; } else { $temp = $xml->temp_f.' Degrees'; $wind = $xml->wind_mph; $wind_dir = $xml->wind_dir; $gust =...

XML characters in python xml.dom

I am working on producing an xml document from python. We are using the xml.dom package to create the xml document. We are having a problem where we want to produce the character &#x03c6; which is a φ. However, when we put that string in a text node and call toxml() on it we get &amp;#x03c6;. Our current solution is to use saxutils....

System.Net.HttpWebRequest in classic asp?

I've got a classic asp app that needs to post XML to a payment engine, and the reference code uses a System.Net.HttpWebRequest object (asp.net). Is there an equivalent in Classic ASP that I could use to post the XML? ...

C#: Read XML Attribute using XmlDocument

How can I read an XML attribute using C#'s XmlDocument? I have an XML file which looks somewhat like this: <?xml version="1.0" encoding="utf-8" ?> <MyConfiguration xmlns="http://tempuri.org/myOwnSchema.xsd" SuperNumber="1" SuperString="whipcream"> <Other stuff /> </MyConfiguration> How would I read the XML attributes SuperNumbe...

Merge XMLs with attributes

Duplicate: Merge XMLs with attributes I have two XML files which I'd like to merge. The merged file should contain every element from both files (maintaining the hierarchy), when elements from the second XML can override elements from the first XML: When two elements are identical (same XPATH, same properties), I'd like to overr...

Create XMLfile and save to directory And Update and Delete particular node.

Hi, I need to create a xml file and save in my project directory, add a node to that file, find and update or delete a particular node. I need sample code for this..pls help me to overcome from this . Thanks in advance. ...