xml

Proper entity types for XHTML, XML and inside inline JavaScript

First, the way I understand it, it's more appropriate to use numeric entities in an XHTML document, such as " instead of ", is that right? Second, for my RSS XML feed, which entity type is correct? Named or numeric? I believe it's numeric, but see examples of both in my searches. Third, which of the following is correct for e...

read cdata in xml from javascript

<![CDATA[test]]> I am getting blanks. var dataNode=Ext.DomQuery.selectNode('data',xml); console.log(dataNode.childNodes[0].nodeValue); console.log(dataNode.nodeValue); ...

Writing to an xml file with xmllite?

I have an xml file which holds a set of "game" nodes (which contain details about saved gameplay, as you'd save your game on any console game). All of this is contained within a "games" root node. I'm implementing save functionality to this xml file and wish to be able to append or overwrite a "game" node and its child nodes within the...

Regex to get value within tag

I have a sample set of XML returned back: <rsp stat="ok"> <site> <id>1234</id> <name>testAddress</name> <hostname>anotherName</hostname> ... </site> <site> <id>56789</id> <name>ba</name> <hostname>alphatest</hostname> ... </site> </rsp> I want to extract everything within <name></name> but not ...

I want to edit my xml file

Hi I am working on XML file, here I want to give rights to user to edit my xml file nodes to his own custom language. I am enclosing my code, but it is not editting my xml file. Need assistance. class Program { static void Main(string[] args) { //The Path to the xml file string path = "D://Documents and Setti...

populate FusionCharts with XML data AJAX

Hi I have a js file that uses ajax to get a XML doc from a php script . The XML file forms the data to draw a Fusion Chart. I know I am getting the XML data ok but FusionCharts will not draw it . I would really appreciate any help , thanks (FusionCharts.js is included earlier in my script) if(XMLHttpRequestObject) { XMLHttpRequestOb...

Help with combining alternate rows of 2 XML files and displaying it as one HTML table

I have 2 XML files and I would like to display them in one HTML table having alternate rows from each file. I know of an approach using XSLT, can someone guide me on how this can be done? ...

Easier way to serialize C# class as XML text

While trying to answer another question, I was serializing a C# object to an XML string. It was surprisingly hard; this was the shortest code snippet I could come up with: var yourList = new List<int>() { 1, 2, 3 }; var ms = new MemoryStream(); var xtw = new XmlTextWriter(ms, Encoding.UTF8); var xs = new XmlSerializer(yourList.GetType(...

traverse every element in xml tree using linq to xml

I would like to traverse every element and attribute in an xml and grab the name an value without knowing the names of the elements in advance. I even have a book on linq to xml with C# and it only tells me how to query to get the value of elements when I already know the name of the element. The code below only gives me the most high ...

How do I strip all the html out of database records, than create an xml file?

Hello! Im trying to figure out a way to strip out all html tags from records in a database, then create xml? Any ideas? Built on asp.net 2.0 with sql server ...

Exclude XML directive from XslCompiledTransform.Transform output

I'm using an XsltCompiledTransform to transform some XML into a fragment of HTML (not a complete HTML document, just a DIV that I will include in page generated elsewhere). I'm doing the transformation as follows: StringBuilder output = new StringBuilder(); XmlReader rawData = BusinessObject.GetXml(); XmlWriter transformedData = Xml...

How do I convert a ruby hash to XML?

Here is the specific XML I ultimately need: <?xml version="1.0" encoding="UTF-8"?> <customer> <email>[email protected]</email> <first_name>Joe</first_name> <last_name>Blow</last_name> </customer> But say I have a controller (Rails) that is sending the data to a method, I'd prefer to send it as a hash, like so: :first_name => 'Joe...

How do I turn a C# Array to XML

Hello, I have a basic Generic List that I want turned into XML so I can return it to jquery. What I am trying to do is update my comments section in my article directory. I am returning an array of comment text, comment id, and user name. I would like to turn all of this into an array. Thanks if (CommentFunctions.AddComment(aid, l.GetUs...

if element not exists create xml element

I am facing a problem that is in my xml file somewhere some particular xml element is exists or not exists. so i want to create the element where not exist with value 0. Below is my xml file and xslt file. <?xml version="1.0" encoding="UTF-8" ?> <Jobs> <Job ID="84590099" PositionID="61838475"> <Title>Graduate Developer / Jun...

How to save dom with xml

hi everyone , i am saving my dom xml file with ` $dom = new DOMDocument("1.0"); // display document in browser as plain text // for readability purposes // create root element $root = $dom->createElement("playlist"); $dom->appendChild($root); $root->setAttribute('version', "1"); $root->setAttribute('xmlns', "http://xspf.org/ns/0/")...

XML attributes get sorted

When I create a document using the minidom, attributes get sorted alphabetically in the element. Take this example from here: from xml.dom import minidom # New document xml = minidom.Document() # Creates user element userElem = xml.createElement("user") # Set attributes to user element userElem.setAttribute("name", "Sergio Oliveira")...

Dealing with empty tags in pear xml_serializer

Im using PEAR XML Serializer to generate xml results from array inputs. I found out that empty array elements are encoded like this: <arraykey/>. I'd rather prefer it this way <arraykey></arraykey> Below are my options: $options = array ( 'indent' => ' ', 'defaultTagName' => $this->xml_tag_name, 'addDecl' => true, ...

Sending data to a script in a container page from a script running in an embedded page

Hi Guys, I have run into an interesting problem and am not sure if it can be resolved. I have a JS script (say script1) running in an SVG document with lots of rectangles which has collected user-entered information like which rectangle was clicked / data corresponding to the rectangle etc. This SVG document is embedded inside an HTML...

XML Schema : substitution groups

I'm investigating substitution groups in XML schema and I can't seem to find the official spec. can anyone point me to it ? I'm wondering if an element with substitution group attribute can replace an element inside a complex or only global elements as w3schools claims : "Note that all elements in the substitutionGroup (the head e...

getting XML from other domain using ASP.NET

I'm fairly new to ASP.NET. And I was wondering how I could go about getting xml from a site (Kuler's API in this case), and then post the result using AJAX? So what I want here, is to be able to do a query to Kuler's API. The URL would be something like "http://kuler-api.adobe.com/rss/search.cfm?query="+queryVariable Then send the resul...