xml

kCFXMLParserSkipWhitespace and text element

I am using CFXMLParserCreate() with kCFXMLParserSkipWhitespace to parse some XML files. The option helps skipping the white spaces between XML tags like the space bwtween <foo> <bar> which is good. However, I just find out that it also caused text elements that contain only white space to be skipped, too. For example, the space between ...

Castor Lists Polymorphism

Hi, I have a quick Castor question. I would like to use Castor mapping to marshal a list of objects. These objects are of two different types, both extending the same abstract base class. I would like them to have different tags in the xml, but both be added to the same list. They also have slightly different fields. Is this possible? If...

xml parse error on illegal character

SO, I am asking as a last resort, as I am completely out of ideas. I have a Windows ASP.NET ASMX web services app that returns a serialized Person object with a -- name, address, email... etc but some attributes in the xml are encoded very weirdly, for instance- &#x1a (I dont know where the encoding takes place. I assume in the seria...

Traversing complex XML document in C# with XLinq

So I want to access the child element in a structure that looks like this: <asdf:foobar attr="value"> <child>...</child> </asdf:foobar> I forget what the asdf is called, but it is what's causing the problem. My normal method of traversing in XLinq doesn't work: xElem child = xDoc.Element("foobar"); Sets child to null because it...

Is it possible to further simplify the resulting data structure from XML::Simple?

Given the below XML and script, I can produce this: { Item => { Details => { color => { Val => "green" }, texture => { Val => "smooth" } }, }, } but, I really want the following: { Item => { Details => { color => "green", texture => "smooth" }, }, } I can't use GroupTags here because there could be many Details item...

Utility / library for tidying xml

What libraries / tools are available for tidying up xml? I've found the highly recommended HtmlTidy, however unfortunately it doesn't correctly handle my input xml files - I mean to submit a bug report, however in the meantime I need a xml tidying tool that works with my xml. Can anyone suggest any alternatives? Update: By "Tidy" I me...

actionscript 3 load xml not loading some tags

I'm trying to load some XML into flash to populate some dynamic text fields. The problem I have is that some of the xml tags seem to be ignored by flash. Here's the XML I'm loading: <?xml version="1.0" encoding="UTF-8" ?><xml> <node> <nid>2</nid> <name>Antonia O&#039;Neill</name> <jobtitle>Director</jobtitle> <photo>h...

C# consume rss feed containing xml-stylesheet ?

Hi, I have a problem for parsing a rss feed using c#. I used to use this method to load the feed. XDocument rssFeed = XDocument.Load(@url); But, when I notice when the feed has a xml-stylesheet this method crashes saying the xml is not well formated... Here's a rss feed that contains this tag http://www.channelnews.fr/accueil.feed?type=...

Converting XElement to HTML string

I am performing XML Operations on an XHTML document utilizing Xml and Linq. When converting it back to a String for outputting to a browser, it renders script tags in their original provided form when creating the XElement as <script />. That prevents it being processed correctly by most browsers on the market. I would like to perform...

How to load an XML file and get values from the nodes - VC++

Hello I'm new to VC++ and i want to load an XML file and read the values from the nodes using VC++. Any guidance? Thank you NLV ...

How to get attributes of an XML element in a cross-browser fashion?

Hi. Internet Explorer has support for xml response parsing and lets you do element.xml.attributes.getNamedItem('myAttr') How can I do the same for an xml element in standards based browsers? The type of element is [object Element] ...

C# : Reading the XML using XDocument and LINQ

The Input XML Format is <FileDetails> <Date FileModified="28/06/2010 10:43:36" /> <Data Name="DIG" List="U16,R30" Level="2"/> <Data Name="DIG1" List="Uee,Ree" Level="2"/> <Data Name="DIG2" List="Udd,Rdd" Level="2"/> <Data Name="N234" List="J3" Level="2"/> <Data Name="N11" List="U2" Level="1"/> <Data Nam...

Xml file reading using XML to LINQ in C#

I've an xml file (Sample.xml) which has the following structure <RootElement> <Children> <Child Name="FirstChild" Start="0" End="2"> <Sibling Name="Test1" /> <Sibling Name="Test2" /> <AdditionalSibling Name="Add_Test_1" /> <AdditionalSibling Name="Add_Test_2" /> <MissingSibling Name="Miss_Test_1...

Generating a PLIST file - to be read by Objective-C - via PHP

The title sums it up. Would that be possible, as in, is the data structure of a PLIST file possible to generate efficiently via PHP for an Objective-C app to read? Or, would a different format like XML be better? I'm more keen to go with PLIST as I hear it's easier to parse from Obj-C, and won't require any external libraries (this is f...

Check if a node exist in XML using XPath in Java

I have different forms of XML that I must analyse, <AMDI> ... <MI> </MI> </AMDI> or <AMDI> ... <AD> </AD> </AMDI> So I want to build an XPath query depending of the type of the node (if it's an MI : XML_ITEMS = "//MI/DL/D", if it's an AD : XML_ITEMS = "//AD/DL/D") I'm working with DocumentBuilder and XPathExpression. Thnx for the h...

.Net schema validation does not detect nilled elements

Hi, I want to validate the xml requests received in my WCF webservice. I created business classes by converting the xsd's to code with Xsd2Code.exe (Xsd2Code@Codeplex). Q: Why does the validator not fire when Element BrancheInfo is null? Validation functions: /// <summary> /// If a servicerequest enters our domain, we have to...

How to select following sibling/xml tag using xpath

I have an HTML file (from Newegg) and their HTML is organized like below. All of the data in their specifications table is 'desc' while the titles of each section are in 'name.' Below are two examples of data from Newegg pages. <tr> <td class="name">Brand</td> <td class="desc">Intel</td> </tr> <tr> <td class="name">Series</...

XML namespace for attributes

Question: I have an xml element + attributes, which all need to be in a namespace. I set the element + all attributes into the namespace oai, and I get: <oai:room building="AB" rmName="001"> but the XML i need to generate should look like this: <oai:room oai:building="AB" oai:rmName="001"> Why does it remove the oai namespace in t...

JAXB marshalling fields whose type is a generic type parameter

I would expect the following test to work with Sun's JAXB RI 2.2.1.1, but instead it fails with a NullPointerException in constructing the JAXBContext: public class GenericFieldMarshallTest { public static class CustomType { } public static class CustomTypeAdapter extends XmlAdapter<String, CustomType> { @Override ...

How to decrypt XML file in C#

How to read the encrypted file of XML in C# ...