xml

How to encode characters from Oracle to XML?

In my environment here I use Java to serialize the result set to XML. It happens basically like this: //foreach column of each row xmlHandler.startElement(uri, lname, "column", attributes); String chars = rs.getString(i); xmlHandler.characters(chars.toCharArray(), 0, chars.length()); xmlHandler.endElement(uri, lname, "column"); The XM...

How to output a CDATA section from a Sax XmlHandler

This is a followup question of How to encode characters from Oracle to Xml? In my environment here I use Java to serialize the result set to xml. I have no access to the output stream itself, only to a org.xml.sax.ContentHandler. When I try to output characters in a CDATA Section: It happens basically like this: xmlHandler.startEleme...

How do I resolve the error "Expression must evaluate to a node-set" when checking for the existence of a node?

I'm attempting to check for the existence of a node using the following .NET code: xmlDocument.SelectSingleNode(String.Format("//ErrorTable/ProjectName/text()='{0}'", projectName)); This always raises XPathException: Expression must evaluate to a node-set. Why am I getting this error and how can I resolve it? Thank you. ...

In javaDoc, what's the best way of representing attributes in XML?

When you're adding javaDoc comments to your code and you're outlining the structure of an XML document that you're passing back, what's the best way to represent attributes? Is there a best practice for this? My general structure for my javaDoc comments is like this: /** * ... * * @return XML document in the form: * * <pre> * &...

Best binary/ordinary XML implementation for j2me

Following Izb's question about Best binary XML format for JavaME, I'm looking for an implementation for either binary XML-like formats or just plain XML. My metrics for such implementation, by most important first, are: Supported phones. A basic JTWI phone should be able to run it. It should be either verified or open source, so I cou...

How do I convert an XmlNodeList into a NodeSet to use within XSLT?

I've got a XmlNodeList which I need to have it in a format that I can then re-use it within a XSLT stylesheet by calling it from a C# extension method, can anyone help? I have read that it might have something to do with using a XPathNavigator but I'm still a bit stuck. Thanks in advanced, Chris ...

Best way to encode text data for XML

I was looking for a generic method in .Net to encode a string for use in an Xml element or attribute, and was surprised when I didn't immediately find one. So, before I go too much further, could I just be missing the built-in function? Assuming for a moment that it really doesn't exist, I'm putting together my own generic EncodeForX...

Issue with XDocument and the BOM (Byte Order Mark)

Is there any way to output the contents of an XDocument without the BOM? When reading the output with Flash, it causes errors. ...

[XmlRoot] attribute not included in the generated proxy class

Using .Net 3.0 and VS2005. The objects in question are consumed from a WCF service then serialized back into XML for a legacy API. So rather than serializing the TestObject, it was serializing .TestObject which was missing the [XmlRoot] attribute; however, all the [Xml*] attributes for the child elements were in the generated proxy cod...

Text editor to open big (giant, huge, large) text files

I mean 100+ MB big; such text files can push the envelope of editors. I need to look through a large XML file, but cannot if the editor is buggy. Any suggestions? ...

How do I load an XML document in a SUN One ASP hosting environment in Linux

Hi, I am working on an ASP site hosted using SUN One (used to be called Chillisoft) server. I am having trouble loading in an XML file, the code I am using is below dim directory set directory = Server.CreateObject("MSXML2.DOMDocument") if(directory.load(Server.MapPath("directory.xml"))) then Response.Write("Loaded") else Re...

Java: Writing a DOM to an XML file (formatting issues)

I'm using org.w3c XML API to open an existing XML file. I'm removing some nodes , and I'm adding others instead . The problem is that the new nodes that are added are written one after another , with no newline and no indentation what so ever. While it's true that the XML file is valid , it is very hard for a human to examnine it. Is the...

Setting data type when reading XML data in SAS

I need to control the data type when reading XML data in SAS. The XML data are written and accessed using the XML libname engine in SAS. SAS seems to guess the data type based on the contents of a column: If I write "20081002" to my XML data in a character column, it will be read back in as a numerical variable. An example: filename m...

XMLTextReader in .NET 1.1

I have a process that reads an XML file. It uses the XMLTextReader class to do this as it is supposed to be a fast, forward only XML parser/reader. Works just great with a 1 megabyte test file but comes to a complete halt when working on a 12 meg file in the live system. Are there any solutions to this other than writing my own XML rea...

How do I preserve markup tags when using XSLT?

I've got an XML document containing news stories, and the body element of a news story contains p tags amongst the plain text. When I use XSL to retrieve the body, e.g. <xsl:value-of select="body" /> the p tags seem to get stripped out. I'm using Visual Studio 2005's implementation of XSL. Does anyone have any ideas how to avoid this...

Program to analyze a lot of XMLs

I have a lot of XML files and I'd like to generate a report from them. The report should provide information such as: root 100% a*1 90% b*1 80% c*5 40% meaning that all documents have a root element, 90% have one a element in the root, 80% have one b element in the root, 40% have 5 c elements in b. If for example some documents h...

MSXML from C++ - pretty print / indent newly created documents

I'm writing out XML files using the MSXML parser, with a wrapper I downloaded from here: http://www.codeproject.com/KB/XML/JW_CXml.aspx. Works great except that when I create a new document from code (so not load from file and modify), the result is all in one big line. I'd like elements to be indented nicely so that I can read it easily...

Redistrubte xml Crystal Reports

How can I redistribute crystal report with an xml dataset in a windows application. I want to be able to use the same xsd and a new xml file every time. When I load the RPT file from inside my application using the code below on a computer other than my own it looks for the xml and xsd. Is there any way I can strip this information from ...

What is the best standard to use for business document exchange (invoices, POs etc)?

If I need to implement sending and receiving of business documents from system to system (invoices, POs, remittance advice, etc) what standard would you recommend for best interop and why? It could be XML or otherwise. ...

XML add <a> hyperlink

Hi, I have a xml blob that's checked against a schema in sql 2005. My website uses xsl to transform and display the blob. How do I add a hyperlink to the xml (in any node) without the sql 2005 schema complaining a node was found in the wrong place? Or the xsl thinking that the hyperlink is a valid xml node? thank you ...