xml

Find Elements by Attribute using XDocument

This query seems to be valid, but I have 0 results. IEnumerable<XElement> users = (from el in XMLDoc.Elements("Users") where (string)el.Attribute("GUID") == userGUID.ToString() select el); My XML is as follows: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Users> <User GUID="68327fe2...

A simple way (in java) to remove headers from xml files

I need remove non-xml tags from file generated by another program. The file is some like this: Executing Command - Blah.exe ... -----Command Output----- HTTP/1.1 200 OK Connection: close Content-Type: text/xml <?xml version="1.0"?> <testResults> <finalCounts> <right>7</right> <wrong>4</wrong> <ignores>0</ignores> <ex...

2 Spaces or 1 Tab, what's the standard for indentation in the Rails Community?

I've noticed that most of the HTML/XML/HAML that gets generated from plugins uses 2 spaces instead of 1 tab. I use textmate and have tabs set to 4 spaces for HAML/HTML/XML and 2 spaces for Javascript/Ruby, but I only have to press the tab key once to get nice indentation. Pressing the space bar twice and delete twice seems like too muc...

PHP Simple XML Parse Attributes

I have an XML file with data stored like this: <myxml> <item name="column18">88744544</item> <item name="column11">47884994</item> <item name="column3">44788894</item> </myxml> I need to first check (and be sure that) column11 is defined (there is no particular order), and then get its value. Using simple XML is not seeming to work. ...

How do I rename an attribute using XSLT?

I have an xml like this: <person name="foo" gender = "male" /> I want to transform it to <person id="foo" gender="male" /> Is there a way to do that using XSLT? I will have a lot of child nodes in person I will have more attributes in the person. ...

Is there a way to easily serialize form input into xml or yaml for database storage?

I am dealing with an old app in asp classic vbscript. I'd like to store the input of a form in a database text field as the form fields are a subject to frequent change and I don't feel like normalizing the old database. Any solutions for serialization in vbscript? Thank you! ...

ASP.NET XML to JSON for httphandler

Can anybody recommend the best way to do this? Should I use JSON.NET? ...

XML Parsing Error: junk after document element

I am using the following script to generate a RSS feed for my site: <?php class RSS { public function RSS() { $root = $_SERVER['DOCUMENT_ROOT']; require_once ("../connect.php"); } public function GetFeed() { return $this->getDetails() . $this->getItems(); } private function dbCo...

How do I write a XPath with qualified name with Perl's XML::LibXML?

I've found this on http://www.perlmonks.org/?node_id=606909 looking by qualified name ... In this case you can call findnodes method on any node, you don't need the XML::LibXML::XPathContext with its prefix => namespace mapping: $doc->findnodes('///info/fooTransaction/transactionDetail/[name() = "histFile:transactionSummary"]/*')...

How to find ordinal position of an element in XML using VBScript & XPATH

I have an XML like this <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">1</int> <lst name="params"> <str name="start">num</str> <str name="fl">string</str> <str name="q">string</str> <str name="rows">num</str> <...

Java, UnmarshallingException caused by XML attribute with special chars: ;ìè+òàù-<^èç°§_>!£$%&/()=?~`'#;

Hi, my xml file has a tag with an attribute "containsValue" which contains the "special" characters you can see in the subject: <original_msg_body id="msgBodySpecialCharsRule" containsValue=";ìè+òàù-<^èç°§_>!£$%&/()=?~`'#;" /> in my xml schema the attribute has xs:string: <xs:attribute name="containsValue" type="xs:string" /> ...

DotNetNuke + XPath = Custom navigation menu DNNMenu HTML render

I'm developing a skin for DotNetNuke 5 using the Component DNN Done Right menu by Mark Alan which uses XSL-T to convert the XML sitemap into an HTML navigation. The XML sitemap outputs the following structure: <Root > <root > <node id="40" text="Home" url="http://localhost/dnn/Home.aspx" enabled="1" selected="0" breadcrumb="0" fi...

XML RSS Feed Parse PHP

With an XML feed like so: <w:current temperature="22.2" dewPoint="12.9" humidity="56" windSpeed="5.6" windGusts="9.3" windDirection="ESE" pressure="1017.8" rain="0.0" /> and <w:forecast day="Thursday" description="Mostly Sunny. Warm." min="17" max="29" icon="2" iconUri="http://www.weather.com.au/images/icons/2.gif" iconAlt="Mostly Sun...

Remove XML Tag using linq c#

I am having on xml from which i have to remove the one book detail <Books> <bookdetail> <bookname>ThreeIdiot</bookname> <bookauthor>chetan bhagat</bookauthor> <bookid>idi001</bookid> <isavailable>true</isavailable> <subscribername>NA</subscribername> </bookdetail> <bookdetail> <bookname>Csharp</bookname> ...

Flex 4: Dynamic ComboBox/List problem [object Object_Type] even with labelField defined

I am dynamically populating a ComboBox with an HTTPservice calling an XML file. This all works dandy through the Flash Build 4 interface. Below is the ComboBox code: <s:ComboBox id="cbSockOptions" change="cbSockOptions_changeHandler(event)" selectedIndex="1" enabled="true" creationComplete="cbSockOptions_creationComplete...

Using TXMLDocument to serialize form settings to XML and database.

I have an interface: type IXMLSerializable = interface function SaveToXML : DOMString; function SaveToXMLDocument : IXMLDocument; procedure LoadFromXML(AXML : DOMString); end; It is used to serialize some settings of forms or frames to xml. Simple implementation: SaveToXMLDocument: function TSomething.SaveToXMLDocument: IXMLD...

XSLT+JavaScript: using classes

I'm trying to use classes in XSL (the 'msxsl:script' tag). But I get the 'Syntax error' message when debugging the file. Here's a simple code that I'm using: function Test1(str) { this.str = str; } Test1.prototype.getStr = function() { return this.str; } function test() { var newTest1 = new Test1("some string"); return...

How should I display errors when a dynamic XML document is requested?

I'm currently writing a PHP script that 3rd party clients will be able to access using GET. It will take a few GET parameters and return an XML document with results. My question is, if required GET parameters are left out or contain invalid data how should display errors back to the end user? Should I return a completely different XML...

unable to get values from JSON converted from XML

I have passed some JSON to my page via a webservice. I used JSON.NET to convert XML to JSON. The JSON output looks ok to me, but I am unable to access some of the items in the response. I am not sure why it is not working. I am using jQuery to read the response and make the webservice call. Even when I try to read the length of the array...

Is it possible to alternate between two types in an XML Schema

I'm wondering if I am missing something obvious. I have a list of numbers, possibly including ranges (think of the print page option of a print dialog). Ideally I'd like to have the final XML output look like this, with page and pageRange in an order. <pages> <page> 1</page> <pageRange><start>3</start><end>6</end></pageRange> ...