xml

Xpath and XmlNameSpace

I have the following XML <?xml version="1.0"?> <FileHeader xmlns="urn:schemas-ncr-com:ECPIX:CXF:FileStructure:020001" VersionNumber="020001" TestFileIndicator="P" CreationDate="13012009" CreationTime="172852" FileID="0000000001" > <Item ItemSeqNo="09011340010009" PayorBankRoutNo="00704524" Amount="3980...

what actually is PCDATA and CDATA?

it seems that a loose definition of PCDATA and CDATA is that 1) PCDATA is character data, but is to be parsed. 2) CDATA is character data, and is not to be parsed. but then someone told me that CDATA is actually parsed or PCDATA is actually not parsed... so it is a bit of a confusion. Does anyone know the real deal is? Update: I act...

Why Sharepoint Webservice adds # (pound) sign and id to field values?

I wrote a routine to remove pounds and ids from sharepoint fields that worked flawlessy, since I found a field withouth ids and # (pound) signs. I want to understand why sometimes the field is serialized with ids and pounds and sometimes not. example: ows_Author="23;#Paperino, Pippo" or ows_Author="Paperino, Pippo" ...

XML indenting when injecting an XML string into an XmlWriter

I have an XmlTextWriter writing to a file and an XmlWriter using that text writer. This text writer is set to output tab-indented XML: XmlTextWriter xtw = new XmlTextWriter("foo.xml", Encoding.UTF8); xtw.Formatting = Formatting.Indented; xtw.IndentChar = '\t'; xtw.Indentation = 1; XmlWriter xw = XmlWriter.Create(xtw); Changed per ...

Calling text message from XML file.

Currently i'm developing a software which uses layered architecture using Visual Studio 2008 and C#. In that system I want to keep all the text messages(that will be shown using message boxes when necessary) in an XML file so that if I update any message I dont have to compile the whole system. How can I accomplish this? What will be th...

Is ServerXMLHTTP safe?

We have been using ServerXMLHTTP to send https POST's for credit card processing. Recently one of our users experienced a problem resulting in the error "An internal error occurred in the Microsoft Windows HTTP Services". The problem was resolved by updating IE. Now the user is claiming that our use of "internet explorer dll's" is a s...

XSLT Reverse template order via apply-templates or call-template?

I am writing a transform for a set of nodes, similar to this. <xsl:template match="/" name="nav"> <!--do stuff--> <xsl:if test="notEnd"> <xsl:call-template name="nav"></xsl:call-template> </xsl:if> </xsl:template> The result it generates is top down (recursive): <!--do stuff 5--> <!--do stuff 4--> <!--d...

Serializing Null Values from a REST API Response

Hi! I've recently used WCF to consume a REST API. I used an entity class to serialize REST XML Reponse, here's the part I have a problem: <grid-cell-size type="decimal" nil="true"/> and in my C# class: [XmlElement("grid-cell-size")] public decimal? GridCellSize { get; set; } but the result is Input string was not in a correct form...

LINQ To XML Syntax for XML Element with Attributes

Hello, I'm a bit of a LINQ newbie and I was having some trouble with the following. I'm trying to perform a query using LINQ on an XML file and store the results in a list of DataClass objects that match the XML. I've got an XML file that is defined like this: <NewDataSet> <NewDataTable> <Field>Accepted ASNs</Field> <Va...

How to design a REST API for a webservice whose RPC method has overloaded meanings?

Existing XML webservice Processes XML-RPC style requests in which an operation element which identifies the method to dispatch to. For example: <protocol><operation>810</operation><user>...</user></protocol> The number of parameters vary. The XML-RPC handler interprets the 810 token to mean two things. If it receives an element <user>...

XML UTF-8 encoding checking

Hello everyone, I have an XML structure like this, some Student item contains invalid UTF-8 byte sequenceswhich may cause XML parsing fail for the whole XML document. What I want to do is, filter out Student item which contains UTF-8 byte sequences, and keep the valid byte sequences ones. Any advice or samples about how to do this in ....

Problem with SOAP response structure from Coldfusion webservice

I have a problem with a Coldfusion webservice I've created. The service accepts XML data, BASE64 encoded, and then writes it to disk for archive purposes. This file then undergoes a basic schema check and any errors are reported back to the user as follows: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ...

Q: Update XML doc

I am a beginner to XML and XPath in C#. Here is an example of my XML doc: <root> <folder1> ... <folderN> ... <nodeMustExist>... <nodeToBeUpdated>some value</nodeToBeUpdated> .... </root> What I need is to update the value of nodeToBeUdpated if the node exists or add this node after the nodeMustExist if n...

Insert XML node at a specific position of an existing document

Hi, I have an existing XML document with some optional nodes and I want to insert a new node, but at a certain position. The document looks something like this: <root> <a>...</a> ... <r>...</r> <t>...</t> ... <z>...</z> </root> The new node (<s>...</s>) should be inserted between node <r> and <t>, resulting in: <root> ...

Displaying XML tags in labels

I’m trying to parse an XML file having ‘n’ number of questions using Objective C. I have to display those questions in labels at runtime in a view. That means ‘n’ labels for ‘n’ questions and ‘n’ labels for ‘n’ answers too. Does anyone have any suggestions about how to do this? ...

XSL Traversing Question (with Server Error:)

Hi there, I have, what I believe to be, an interesting situation at hand. I have a car garage XML and am transforming it (using XSL) into HTML. CAR XML: <car> <licensePlate>Car001</licensePlate> <feature> <color>Blue</color> <fuel>Unleaded</fuel> <feature> </car> I only want to print out <color> & <fuel> but want...

Atom data binding not working

Hi guys To make it simple, I've got a Flex application with Advanced Data Grids binded with XML and Atom feeds. With my XML file, the application works very well: jiraList = new XMLList(event.result.channel.item); However, when I try to access Atom feeds, I cannot go lower than "event.result". This works: clarityList = event.res...

Does solr make faceting on empty String?

Last time I made a solr index, it started indexing and doing faceting on empty strings too. This never happened. It is the right behaviour? Should I filter empty strings in the DIH? Thanks. ...

XmlWriter encoding issues

I have the following code: MemoryStream ms = new MemoryStream(); XmlWriter w = XmlWriter.Create(ms); w.WriteStartDocument(true); w.WriteStartElement("data"); w.WriteElementString("child", "myvalue"); w.WriteEndElement();//data w.Close(); ms.Close(); string test = UTF8Encoding.UTF8.GetString(ms.ToA...

How to generate XML documents with namespaces in Python

I'm trying to generate an XML document with namespaces, currently with Python's xml.dom.minidom: import xml.dom.minidom doc = xml.dom.minidom.Document() el = doc.createElementNS('http://example.net/ns', 'el') doc.appendChild(el) print(doc.toprettyxml()) The namespace is saved (doc.childNodes[0].namespaceURI is 'http://example.net/ns')...