xml

Reference to undeclared entity exception while working with XML

I am trying to set the innerxml of a xmldoc but get the exception: Reference to undeclared entity XmlDocument xmldoc = new XmlDocument(); string text = "Hello, I am text &alpha; &nbsp; &ndash; &mdash;" xmldoc.InnerXml = "<p>" + text + "</p>"; This throws the exception: Reference to undeclared entity 'alpha'. Line 2, position 2.. How...

Large XML parcels and using attributes or elements

I understand that there's no universal answer to the attribute vs. element debate (and I read through the other questions I saw on this), but any insight into this particular circumstance would be greatly appreciated. In our case we're going to be receiving very large amounts of master and transactional data from a system of record to...

Embedding Excel files in XSL-FO driven (Pdf)-Document Generation

Hello there, we're currently generating all our official documents using XSL-FO transformation using .xml files as input and generating .pdfs & basically all the content within these .xml's is either plain text or xhtml. This works perfectly fine for every-day use-cases, but some of our users refer to Microsoft Excel files which our XSL...

Can LINQ to SQL query an XML field DB-serverside?

.NET 3.5, C# I have a web app with a "search" feature. Some of the fields that are searchable are first-class columns in the table, but some of them are in fact nested fields inside an XML data type. Previously, I built a system for dynamically constructing the SQL for my search. I had a nice class hierarchy that built SQL expressio...

Dealing with Method Calls/XSLT Tranform in ASP.NET

I've got an ASP.NET page that uses code similar to the following: <asp: repeater> <tr><td><b>LabelName</b></td><td><%# SomeMethod(parameter) %></td></tr> </asp: repeater> These Labels are presently hardcoded, but there is an XML document that contains something like the following: <label type="LabelA" name="LabelName" />> ...

Parsing XML/XHTML in Actionscript

Is there anything similar to getElementById in actionscript? I'm trying to make a prototype of a flash page wich gets it's data from a xhtml file. I want to have both an accessible html version (for search engines, textreaders and people without flash) and a flash version (because the customer insists to use flash even though a html-cs...

.NET XML Serializer with Japanese chars in username

We are having a problem whenever our application makes use of the XML Serializer, when we are logged in as a user who has a username containing Japanese characters. We have prepared a sample application that tests the serializer on its own: TestClass myClass = new TestClass(); myClass.MyString = "Hello Wo...

What are your efficiency gains by removing XML in java projects ?

I have just moved from phase 1 to phase 2 of a project. In this transition we got rid of all of the XML configuration for spring and struts2, switching to a fully annotated regime. All of the participants are amazed at the actual effect this has on development speed. There are a number of reasons for this: Structured thinking about wh...

How to 'select' from XML with namespaces with XSLT?

I have an XML document something like ::: <?xml version="1.0" encoding="utf-8"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="urn:schemas-mi...

XmlSerializer and XmlElement fields

Hi, I have an xml that looks like this: <Config> <A></A> <Template><B/><C/></Template> </Config> and I would like to deserialize it in to get the <Template><B/><C/></Template> bit as a XmlElement or XmlNode. But when I try like this: public class Config { public string A; public XmlElement Template; } the Template is set...

How do I create an xmlElement from the current node of a xmlReader?

If I have an xmlreader instance how can I use it to read its current node and end up with a xmlElement instance? ...

How can I append a child node to an element in a DOM object?

<% Set xmlDoc = Server.CreateObject("MSXML2.DOMDOCUMENT") xmlDoc.loadXML( "<response />" ) Set node = xmlDoc.createElement("account") xmlDoc.documentElement.AppendChild node Set node = xmlDoc.createElement("type") node.Text = "TheType" xmlDoc.documentElement.AppendChild node Set node = Nothing %> This...

What is the best way to build XML in C# code?

Please indicate your best practices for building XML using C#. Edit: With the help of Shog9, I just learned about the "community wiki" feature, and happily turned it on. If you like a particular answer, vote it up. If you don't like a particular answer, feel free to shake your fist violently in the air and vote it down. ...

Flag certain properties as CDATA elements for serialization

When serializing/de-serializing certain classes I've come across the need to flag or mark certain properties as CDATA elements (due to their content). I am currently handling this like so: <XmlElement("MessageText")> _ Public Property XmlContentLeft() As XmlCDataSection Get Dim doc As New XmlDataDocument() ...

.NET XmlDocument : Why DOCTYPE changes after Save?

I am opening a XML file using .NET XmlReader and saving the file in another filename and it seems that the DOCTYPE declaration changes between the two files. While the newly saved file is still valid XML, I was wondering why it insisted on changing original tags. Dim oXmlSettings As Xml.XmlReaderSettings = New Xml.XmlReaderSettings() oX...

Default Handler implementation breaking on nbsp

I have an implementation of default handler. When it gets to a   in the character data it stops parsing. Is there any reason that it is doing this? Are there additional properties that I need to set in order for it to deal with &nbsp? ...

Simplest possible key/value pair file parsing in .NET

My project requires a file where I will store key/value pair data that should be able to be read and modified by the user. I want the program to just expect the keys to be there, and I want to parse them from the file as quickly as possible. I could store them in XML, but XML is way to complex, and it would require traversing nodes, and...

Tutorials to start learning Actionscript 3.0?

Hey guys, I already know Java, Objective C, C#, and some Python. I want to be able to integrate with XML or a MySQL database for dynamic content. What are some tutorials or online references that would get me up and running with Actionscript 3.0? ...

C# String.Replace double quotes and Literals

I'm fairly new to c# so that's why I'm asking this here. I am consuming a web service that returns a long string of XML values. Because this is a string all the attributes have escaped double quotes string xmlSample = "<root><item att1=\"value\" att2=\"value2\" /></root>" Here is my problem. I want to do a simple string.replace. If I...

Can I find and import files into an ant-buildscript at runtime?

I want to create an ant-buildscript, that includes some files as a sort of plugin. So if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new targets can be available to the build. But the import-task c...