xml

Getting values from SAX attributes when namespaces are involved.

I'm using SAX to parse some XML. In my handler's startElement() method I'm trying to read the value of an attribute named xsi:type with something like: String type = attributes.getValue("xsi:type"); However, it always returns null. This works fine for everything else so I'm assuming that it's due to the namespace prefix. How can I get...

Jquery: Mapping XML Nodes to HTML ID elements

Hi there, never easy to encapsulate what to say in the title... but here we go... I realise I am probably seeing straight past the obvious, and possibly built in function of JQuery. What I am trying to do is: Have an XML file (locally or via server) contain nodes which happen to have their node names i.e. as ID names of say a textb...

What is the Proper Escape Formatting for HTML and CSS Within an XML Document?

I have an XML data source that has HTML & CSS formatted data contained in one of the document nodes. What is the proper way to escape this data so that I can properly parse it? For clarification, I am using TouchXML in Objective-C to parse the data. (Not that it should matter but I wanted to include all pertinent information.) Any help ...

c#: Using Assemblies (via Reflection) as a (meta)data store

SOME CONTEXT one of my projects requires carrying around some of "metadata" (yes I hate using that word). What the metadata specifically consists of is not important, only that it's more complex than a simple "table" or "list" - you could think of it as a mini-database of information Currently I have this metadata stored in an XML fil...

How to solve XML to XML problem using Exslt - set:distinct

This extends from http://stackoverflow.com/questions/2133459/xml-to-xml-using-xsl-problem I managed to import exslt and modified my codes according to the solution (thanks to Kyle Butt) given as follows: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:func="http://exslt....

Update value in xml file

I have a xml-file: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <root> <level> <node1 /> <node2 /> <node3 /> </level> </root> What is the simplest way to insert values in node1, node2, node3 ? C#, Visual Studio 2005 ...

How to define a sequence of elements with same name but different types in XML Schema?

Hi! Just to be concise I want to obtain something like this: <root> <field value="..." text="...">fixed_value1</field> <field value="..." text="...">fixed_value2</field> <field value="..." text="...">fixed_value3</field> <!-- in some cases we can choose the «fixed_value» among different ones --> ... <field value=...

combine two xml files into one

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:param name="pXml1" select="''" /> <xsl:param name="pXml2" select="''" /> <xsl:param name="pRoot" select="'root'" /> <xsl:template match="/"> <xsl:variable name="vXml1" select="document($pXml1)" /> <xsl:variable name="vXml2" select="do...

How to make an XML document which contains relationships?

Okay this may sound silly, but I am not very familiar with XML. What I try to do is this: I have two entities: Company and Employee. Both entities only have a name property. How would an XML document look like, when I had two companies with each having two employees? Could I simply do something like this? : <?xml version="1.0"?> <c...

Where to add a version to an XSD schema?

The application I work on has XML output that conforms to an XSD schema. As features are added to the application, the XSD changes and I would like to note the version of the schema in the XSD file. Perhaps I'm missing something, but I haven't found a built-in way to mark the version of the schema. How do you do it? ...

Is it possible to insert a comment tag into an xml using simplexml?

I am using SimpleXML to build a document, and wondering whether it is possible to insert comment tag to the document like this: <root> <!-- some comment --> <value> </root> EDIT: The comment is somewhere in the middle of the document. <root> <tag1 /> <!-- some comment --> <value /> </root> ...

BizTalk Map Incorrectly Parsing Input XML

I've got a situation where my BizTalk map is not extracting data from input XML correctly. The input schema looks like this: Sequence A B All 3 of those nodes on the XSD have min 0, max unbounded. So here's a sample input file fragment: <A>1</A> <B>hi</B> <A>2</A> <B>there</B> Now my map takes this data and calls stored pr...

Flash AS3 - Load XML from outside web directory on the local server

Is it possible for flash to access data from outside of the root directory of the server it resides. i.e. Root directory = /var/www/httpdocs SWF = /var/www/httpdocs/flash/file.swf XML = /var/www/xml/file.xml Thanks! ...

How do I know what's the right Content-type to use when sending XML data using HTTPS POST?

Is it "application/x-www-form-urlencoded", "multipart/form-data", "application/xml", "text/xml" or something else? And more importantly, how do I know when to use which? This is a very old article which says to use "multipart/form-data" and that "application/x-www-form-urlencoded" is bad. Is that still valid advice? http://skew.org/xml/...

Ignoring case on E4X node names and attributes?

Does anyone know of a trick to ignore upper/lower/camelcase on XML node names and attributes? A quick example: I give an XML file to my client which contains an XML attribute named fooID but the client could change the XML, and - not being aware of upper/lowercaseness change or add an attribute under 'fooid'. Naturally my parser (in AS3...

.net Serialization XML namespace inside namespace

Hi. I want to generate an XML like this: <a:foo> <b:bar><b:value="test" /></b:bar> </a:foo> I'm generating an XML from a class descriptor. I have this: [Serializable] [XmlType(Namespace = Constants.NS_A)] [XmlRoot("Foo", Namespace = Constants.NS_A, IsNullable = false)] public class Foo { private Bar_ bar = new Bar_(); [XmlEl...

Reading filenames in a folder and storing them in XML using PHP?

Hi, I would like to know how one can write PHP code to read filenames from a particular folder and save the extracted filenames in an XML document? An example of any part of this would be HIGHLY appreciated. Thanks ...

Simple Iphone XML Example

Hi, I a bit overwhelmed with all of the sample code I've seen on the apple dev site. I'm looking for a simple example to show me how to load an xml file from a server into iphone. I would like to read url's from this xml file and load an image. ...

Programmatically Create XML File From XSD

I have an XSD file and I want to create an XML file at runtime based on the XSD. (My question is basically the same as this one, except in the .NET world, rather than for Java.) I have run xsd.exe /c /l:vb MyTest.xsd, but that generates a class that cannot be instantiated and used, as it has nested classes that are never instantiated. ...

XML: A namespace prefix is claimed to be not declared when it fact it is

We've got a web service that returns a very simple XML. <?xml version="1.0"?> <t:RequestResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://our.website.com/ns/" xmlns:t="http://our.website.com/ns/"&gt; <t:Result>No candy for you today.</t:Result> <t:Success>false</t...