xml

What's the easiest way to remove all attributes from a XML in C#?

Hi, I want to remove the attributes of all tags from a XML (I want to keep only the tags and their inner value). What's the easiest way to do this in C#? ...

Zend_Rest_Client problem with sending XML content with encoding type specified (content-lenght is 0)

I would like to sent request to our clients server, but they require to send XML as application/xml I was trying to use setEnc() method but I've got error on unsupported content type, so then I've tried to se setRawData() as they suggested: self::getHttpClient()->setRawData($XML, 'application/xml'); $this->restPost($this->getPath());...

Write element value to an XML in Python

HI, I have a Text file containing a key=value pairs. I have another XML file which contains the "key" as "Source" Node and "value" as "Destination Node". <message> <Source>key</Source> <Destination>value</Destination> </message> Suppose, I get a new text file containing the same keys but different values, how do I go about chan...

Direct access and edit to an xml node, using properties

El Padrino showed a solution: http://stackoverflow.com/questions/367730/how-to-change-xml-value-file-using-c where an xml element can be loaded directly (no for each..), edited and saved! My xml is: <?xml version="1.0" encoding="ISO-8859-8"?> <g> <page no="1" href="page1.xml" title="נושא 1"> <row> <pic pos="1" src="D:\Rut...

removing and inserting tags in HTML

Hi, I need to convert HTML file to iXBRL format. iXBRL format is basically html with some embedded nodes or some information of html file wrapped under ixbrl tags. For this, I will need to SEARCH and REMOVE some nodes from HTML file and WRAP some nodes under iXBRL tags. Can I use XML DOM in C# to achieve this objective. Am I right in a...

Generating XML with an xsd in VS2010 using LINQ

I think the title says it all. I've used Linq2SQL lots and am familiar with most of the concepts (up to and including extending an ObjectContext) but with regards to Linq2XML, I'm a little lost. I now have a need to generate some complex XML and I'd like to use the simplicity of LINQ. Previously, I've used XMLDocuments and programatic...

how to write data to the existing xml file using code in android

friends i am downloading some images from website using xmlrpc now i want write the url of those images into xml files how to add data to exiting xml file in android ...

Speeding up code that copies database structure to XML

I have a database structure filled with data that I'm trying to write out to an XML file. Here's a taste of the way the VB code is structured: Dim xsi = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance") Return _ New XElement( _ "providers", _ New XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName), _ ...

Accessing/Scope problem in actionscript 3 with loading xml

OK, it's probably easiest now to explain my problem like this, I am able to write the name of my xml file that needs to be loaded to a dynamic textfield on the stage, however, I don't seem to be able to access it after this and strip the necessary data from it, here's my code: var tf:TextField = new TextField(); tf.autoSize=TextFieldAut...

Get the last node of a Google maps XML file

I have been playing around with Google maps API v3 because v2 is depricated and no longer works for my site Instead of displaying every pointer in the xml file on the map, i want to display the current marker that would be relevant to that page. I have an events page so i want to show info about the event and display a map just for tha...

Should I use from_xml or from_json for importing objects?

Hello all, I currently have a PHP app that I'm going to be rewriting in Rails. My idea is to slowly replace all of the PHP functionality with Rails, so both will need to run side-by-side (I think I've got this part figured out). Now, at the moment, each of our client's has a separate database, and as it turns out, it would be really gr...

jquery check if xml element has children?

I know how to use JQuery to iterate over the children of an xml element: $(this).children('tag_name').each(function() { }); Is there a convenient way to simply test if an element has any children? Something like this incorrect code: $(this).hasChildren('tag_name') //returns true or false ...

Cannot open a local file using fopen()

HI. i am trying to open a local file from xml created by xlink i have parsed the file path in $resourceRef variable and it looks like that file:/./birds/birds.txt without the quotes. Please someone tell me why i cant open it. here is my code $fh = fopen($resourceRef, 'r'); $theData = fread($fh, filesize($resourceRef)); fclose($fh); ech...

How to import an XML schema into the "no namespace"

I have a schema here where I am trying to include/import another schema that has no namespace (and this cannot be changed because it comes from another vendor and it would no longer validate their XML). Here is the first Schema: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:samp="http://sample/namespace" targetNamespace...

Current Directory in XML

Hi, I am converting some environment variables to property sheets for some C++ projects. This way when the projects are used from the branch or the trunk in SVN we don't have to use a junction to switch between the branch and trunk. My property sheet, paths.vsprops, is in this format: <?xml version="1.0" encoding="Windows-1252"?> <Visu...

JiBX: How to run codegen on a schema that imports into the no-namespace schema

I have a schema here where I am trying to include/import another schema that has no namespace (and this cannot be changed because it comes from another vendor and it would no longer validate their XML). Here is the first Schema: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:samp="http://sample/namespace" targetNamespace...

xsl transform for WTF "well formed" example

i laughed out loud when i read this article on Daily WTF : http://thedailywtf.com/Articles/WellFormed-XML.aspx, but now it's not funny anymore because i have begun to recognize this "xml design pattern" in the wild with alarming frequency. for example, i just exported some data from a rational clearquest query and i got this: <?xml ver...

XML Marshalling: How to add an attribute from another namespace to an element

I want to generate this XML: <myElement myAttribute="whateverstring" xsi:type="hardPart"/> I have this XSD: <xsd:element name="myElement"> <xsd:complexType> <xsd:attribute name="myAttribute" type="xsd:boolean" /> <!-- need to add the xsi:attribue here --> </xsd:complexType> </xsd:element> How exactly can I a...

How to prevent XMLSerializer.serializeToString() from re-ordering attributes?

I'm using jQuery to load arbitrary XML strings (fragments of a larger document) into the browser DOM and manipulate them, then using XMLSerializer to load them back to strings and send them back to the server, where they are processed (by python and lxml) and re-integrated into a full XML document. The XML starts and ends in a git repos...

A problem with the usage of recursive XML schema types

It is easy to define two elements with the same name like <any> in one XML schema and different permitted subelements. One should just declare two XSD types AnyType1 and AnyType2 as complexTypes which describes permitted subelements. Then one can declare element <any> in one context as <xs:element name="any" type="AnyType1" /> and as <xs...