xml

Need help handling documents using dom4j

import java.util.Iterator; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.dom4j.io.XMLWriter; public class Main { public static void main(String[] args){ Company cp17 = new Company(); Person ps1 = new Person("Barry","15900000000"); Person ps2 = new Person("Andy","15...

What's the best way to serialize JavaScript objects to XML ?

I am looking for a best proved way to serialize JavaScript objects to XML, that could be sent to server further in Ajax style. Just googling I've found some options like http://svn.mirekrusin.com/pub/javascript/to_xml/trunk/to_xml.js, but does somebody has proved experience and could recommend any specific library? ...

Microsoft SSIS 2005 removing columns from an XML source

I have an XML source in a Microsoft SSIS 2005 package and when I debug the package I am receiving warnings like: [DTS.Pipeline] Warning: The output column "AccBasicRateDesc" (15229) on output "AccFwdDetail" (303) and component "XML Source" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increas...

How do I represent an XML file as a Java object using commons-digester?

Following on from my recent question regarding parsing XML files in Java I have decided to use the commons-digester library. I am now familiar with this process and now want to create a Java class representing the XML file, so that when a user instantiates a new object of that class, all of the data from the XML file will be available. ...

Is there a standard naming convention for XML elements?

Is there any standard, de facto or otherwise, for XML documents? For example which is the "best" way to write a tag? <MyTag /> <myTag /> <mytag /> <my-tag /> <my_tag /> Likewise if I have an enumerated value for an attribute which is better <myTag attribute="value one"/> <myTag attribute="ValueOne"/> <myTag attribute="value-one"/> ...

Spec. for JUnit XML Output

Where can I find the specification of JUnit's XML output. My goal is to write a UnitTest++ XML reporter which produced JUnit like output. See: "Unable to get hudson to parse JUnit test output XML" and "http://stackoverflow.com/questions/411218/hudson-c-and-unittest" ...

How do you work with SessionStateItemCollection in C# (ASP.net)

If I store the contents of an xml file (name -> value) in a session collection, whats the best way of accessing it on another page (i.e not the one that the below script runs on). Is it just a job of creating a new instance of SessionStateItemCollection on each page I want to access the collection? System.Xml.XmlDocument oXmlDoc = new ...

From XML to object

I would like to define an asp.net page from xml, then parse/render it by calling a command name. Just like they do in Flex. Does someone has an idea how to do that? Like for example, from XML: <button onClick="DoJavascript()" text="Submit"/> <gridview ......./> To parse: <asp:button runat="server" onClick="DoJavascript()" text="Subm...

Creating a specific XML document using namespaces in C#

We were given a sample document, and need to be able to reproduce the structure of the document exactly for a vendor. However, I'm a little lost with how C# handles namespaces. Here's a sample of the document: <?xml version="1.0" encoding="UTF-8"?> <Doc1 xmlns="http://www.sample.com/file" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in...

Producing valid XML with Java and UTF-8 encoding

I am using JAXP to generate and parse an XML document from which some fields are loaded from a database. Code to serialize the XML: DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.newDocument(); Element root = doc.createElement("test"); root.setAttribute("version", text); doc....

Is it impossible to perform initialization before calling a superclass's constructor?

I'd like for a subclass of a certain superclass with certain constructor parameters to load an XML file containing information that I'd then like to pass to the superconstructor. Is this impossible to achieve? ...

Extract a specific XML message from a log file

Hello! i have a log file which contains hundreds/thousands of seperate XML messages and need to find a way to extract a complete xml message depending on the parameters given (values of nodes). My biggest problem is that even though i program a fair amount i have had very little contact with XML or the XML libraries of the languages i ...

Flex - ActionScript: how do I use SortField to sort my data numericly

From the documentation: SortField () constructor public function SortField(name:String = null, caseInsensitive:Boolean = false, descending:Boolean = false, numeric:Object = null) I'm confused on the last part - numeric:Object = null Here is my function: private function createXMLDataProvider():XMLListCollection{ var sort...

How do I convert Excel OpenXML shared strings to inline strings?

I have a large spreadsheet in Excel 2007 OpenXML format that I want to manipulate in xml programmatically. Excel saves it using the shared strings method which, while more efficient, complicates the process. Does anyone know if there is an option buried in Excel to save using inline strings, or maybe a utility already build to place all ...

python, index errors

I've got some code which draws data from an xml file but it seems to have randomly starting throwing; Traceback (most recent call last): File "C:\Users\mike\Documents\python\arl xml\turn 24 reader", line 52, in <module> unitCount = getText(evoNode.getElementsByTagName("count")[0].childNodes) IndexError: list index out of range ...

How to parse rss-feeds / xml in a shell script

Hi, I'd like to parse rss feeds and download podcasts on my ReadyNas which is running 24/7 anyway. So I'm thinking about having a shell script checking periodically the feeds and spawning wget to download the files. What is the best way to do the parsing? Thanks! ...

Easiest way to validate and read an xml file in .net?

What is the easiest/simplest/cleanest way to: Read an xml file from the filesystem Validate the xml against an xsd Read parts of the xml file into variables Using .net. ...

What are the best functions, practices, and/or techniques to read/write XML with C#/.NET?

The question says it all... looking for the n00b overview w/ best practices. Thanks, -greg ...

Gotchas while bulk loading CouchDB

I've got ~15k rows in MSSQL 2005 that I want to migrate into CouchDB, where 1 row = 1 document. I have a CLR-UDF that writes n rows to an schema-bound XML file. I have an XSL transform that converts the schema-bound XML to JSON. With these existing tools I'm thinking I can go MSSQL to XML to JSON. If I batch n rows per JSON file, I...

Parsing XML into a SQL table WITHOUT predefining structure. Possible?

So using the code below... can I parse @xml_data into a table structure without predefining the structure? DECLARE @receiveTable TABLE(xml_data XML) DECLARE @xml_data XML DECLARE @strSQL NVARCHAR(2000) SET @strSQL = 'SELECT * INTO #tmp1 FROM sysobjects; DECLARE @tbl TABLE(xml_data xml); DECLARE @xml xml; Set @xml = (Select * from #t...