xml

XML field replacement in C#

ok, so, i have an xml file that looks like this: <?xml version="1.0"?> <Users> <User ID="1"> <nickname>Tom</nickname> <password>a password</password> <host>[email protected]</host> <email>anemail</email> <isloggedin>false</isloggedin> <permission>10</permission> </User> <User ID="2"> <nickname>ohai</nic...

get list of children in SimpleXMLElement PHP

how do i get the list of children in xml->request->ABC ABC may have DEF, ZZA, XAS, ETC and i would like to iterate through a list of these children (name required) instead of checking if they exist. -edit- Note: I am looking for the element name. I found an example which returns an attribute IF its known. How do i get the tag/element na...

How to automatically propagate the XMLNS attribute from on XSL template to another

I'm looking for a way to have the XMLNS attribute propagate automatically from one XSL Template to another so I don't have to redeclare it each time. Here's my situation. I'm trying to transform an XML file into an XHTML file using a XSLT file. My XML file is: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" enco...

XmlSerializer Performance Issue when Specifying XmlRootAttribute

I'm currently having a really weird issue and I can't seem to figure out how to resolve it. I've got a fairly complex type which I'm trying to serialize using the XmlSerializer class. This actually functions fine and the type serializes properly, but seems to take a very long time in doing so; around 5 seconds depending on the data in ...

printing a count with XSLT

I have an XML file which I'm trying to transform into XHTML using a XSLT file. I was wondering if it's possible to get a count of the number of times a template has been invoked. This is my XML: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" encoding="UTF-8" href="car.xslt" version="1.0"?> <vehicle> <car> ...

Where is a tutorial for using XML with Delphi?

I need a sample or tutorial on working with XML files. I want to create a file that contains a "record" to a person, something like this: Name: Just Me Age: 99 EMail: [email protected] I want to learn how to read and write an XML file. ...

How to display entities taken from XML with Javascript?

There MUST be an easy way to do that! I didn't want to ask this question again if somebody already asked it but I couldn't find something similar in this site... anyway : So I have a XML file : <marker>This is a test &amp; it&#039;s fun. &eacute;</marker> So when I read this XML file with Javascript, I want to put it in a text input ...

Sanitizing KML Stream to change xml namespace

There is some strange behaviour in parsing KML produced by Google Earth using a compliant parser, JAK. The expected namespace by the parser is not written as the correct one by the GE Kml production system and when reading this KML back into another Java application validation fails. We are fiddling the stream as it is read and replacin...

jQuery : How to create XMLDom , load XML data in it,Parse it ?

I have a jquery ajax call in my javascript where the server page will return data in an xml form.now i want to load this XML in an XML DOM (browser independent.Need firefox and IE support atleast ) and parse via it.Can anyone tell me how to create one XML DOM object and load the content returned from the serverpage to it ? ...

Limiting or restricting the value used for a xsi:type attribute

Hi, i have the following piece of xml: <MyField> <FieldName>Blah</FieldName> <ValueFormatting xsi:type="DateFormatter"> <Format>dd/MM/yy</Format> </ValueFormatting> </MyField> in my xsd, how can i limit or restrict the values that are supplied for the xsi:type attribute on the ValueFormatting element, as i have a l...

Structure map and generics (in XML config)

Hi I'm using the latest StructureMap (2.5.4.264), and I need to define some instances in the xml configuration for StructureMap using generics. However I get the following 103 error: Unhandled Exception: StructureMap.Exceptions.StructureMapConfigurationException: StructureMap configuration failures: Error: 103 Source: Requested Plugi...

How to convert XML to java.util.Map and vice versa

I'm searching a lightweight API (preferable single class) to convert a Map<String,String> map = new HashMap<String,String(); to xml and, vice versa, convert the XML back to a Map. example: Map<String,String> map = new HashMap<String,String(); map.put("name","chris"); map.put("island","faranga"); MagicAPI.toXML(map,"root"); result...

Get Xml Files on Website

How can i get xml files from a web site and save it on pc. what is easy way with C# ? ...

Need help Serializing System.Data.OracleClient.OracleCommand to XML?

Trying to write a list of oracle commands to XML but keep getting this error. This is driving me crazy. Thanks in advance. "There was an error reflecting type 'System.Data.OracleClient.OracleCommand'." Friend Sub WriteDataToFile(ByVal Commands As List(Of System.Data.OracleClient.OracleCommand)) Try Dim PathName As String...

Google Calendar Feed - Only Show Today's Events

Hi Everyone, This is my first post here at stackoverflow. My question is how to change the google calendar feed so that it only shows events for the current day automatically? Basically what I want to do is output the feed onto a webpage that only shows events for today. The feed would change day by day. I've done something similar ...

PHP CLI vs PHP WEB

Hiya All, I am currently running a script that i've created in PHP that parses and sorts out 6 different xml files of around 40mb each. I currently run the script through a browser, and a cron job to wget the page. But sometimes with the server load it can clog up apache and and the rest of the server, Would it make sense to convert...

c# XML DTD validation. ENTITY is an unexpected token

Hi all, Im trying to validate an XML file using a .DTD but it gives me the following error. 'ENTITY' is an unexpected token. The expected token is 'DOCTYPE'. Line 538, position 3. public static void Validate(string xmlFilename, string schemaFilename) { XmlTextReader r = new XmlTextReader(xmlFilename); X...

how to xsl sort ascending with nulls last

I want to sort these elements in ascending order but with the nulls last rather than first which seems to be what xslt does by default. I've managed to do this but wonder if there is a better way. Here's my example. <b> <c>2</c> <c>1</c> <c>3</c> <c></c> <c>15</c> <c>11</c> <c></c> <c>43</c> <c>4</c> ...

XML serialization array

I have a custom XML (Vendor specific) which I need to serialize and deserialize. The format of the XML is as follows <RootElement> <childelement> <id/> <description/> </childelement> <childelement> <id/> <description/> </childelement> </RootElement> Root element is ...

Regular Expression vs XML Functions in PHP

Hiya, I currently do alot of data parsing, and have toyed with PHP functions for XML such as simple XML and a few others here and there. But there always seems to be some sort of issue with dealing with them, mainly due to the way the data is presented. The most reliable way i have found is to always just simply use preg_match_all a...