xml

How do you switch on a string in XQuery?

I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery? ...

XML Notepad 2007 breaks MS Access 2007 Help

I tried scouring the web for help on this issue, but there are so many generic words in there, that I couldn't find much of anything that was relevant. I have MS Office 2007 installed on Vista and later installed XML Notepad 2007 (also a Microsoft product). It seems that the MS Access help system is using some sort of XML format that X...

How do you search for an XML comment covering N lines of a file?

I am attempting to find xml files with large swaths of commented out xml. I would like to programmatically search for xml comments that stretch beyond a given number of lines. Is there an easy way of doing this? ...

C# How to check for valid xml in string input before calling .LoadXml()

I would much prefer to do this without catching an exception in .LoadXml() and using this results as part of my logic. Any ideas for a solution that doesn't involve manually parsing the xml myself? I think VB has a return value of false for this function instead of throwing an XmlException. Xml input is provided from the user. Thanks...

Converting SQL Result Sets to XML.

I am looking for a tool that can serialize and/or transform SQL Result Sets into XML. Getting dumbed down XML generation from SQL result sets is simple and trivial, but that's not what I need. The solution has to be database neutral, and accepts only regular SQL query results (no db xml support used). A particular challenge of this tool...

Ruby code for quick-and-dirty XML serialization?

Given a moderately complex XML structure (dozens of elements, hundreds of attributes) with no XSD and a desire to create an object model, what's an elegant way to avoid writing boilerplate from_xml() and to_xml() methods? For instance, given: <Foo bar="1"><Bat baz="blah"/></Foo> How do I avoid writing endless sequences of: class Fo...

Mocking WebResponse's from a WebRequest

I have finally started messing around with creating some apps that work with RESTful web interfaces, however, I am concerned that I am hammering their servers every time I hit F5 to run a series of tests.. Basically, I need to get a series of web responses so I can test I am parsing the varying responses correctly, rather than hit their...

Get list of XML attribute values in Python

I need to get a list of attribute values from child elements in Python. It's easiest to explain with an example. Given some XML like this: <elements> <parent name="CategoryA"> <child value="a1"/> <child value="a2"/> <child value="a3"/> </parent> <parent name="CategoryB"> <child value="b1"/> ...

How do I map XML to C# objects

I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the structure (xsd) that I created. One way to do that is to write my own serializer, but is there a built in support for it or open source in C# that I can use? ...

In AIML, what's the XSD-valid way to use the element <set name="it"> ?

In file Atomic.aiml, part of the annotated ALICE AIML files, there are a lot of categories like this: <category> <pattern>ANSWER MY QUESTION</pattern> <template> Please try asking <set name="it">your question</set> another way. </template> </category> This code isn't valid according to the AIML...

What's the best way to serialize a HashTable for SOAP/XML?

What's the best way to serialize a HashTable (or a data best navigated through a string indexer) with SOAP/XML? Let's say I have an Foo that has an property Bar[] Bars. A Bar object has a key and a value. By default, this serializes to the following XML: <Foo> <Bars> <Bar key="key0" value="value0"/> ... </Bars> </Foo...

Flatten XML to HTML table using XSLT

There must be a generic way to transform some hierachical XML such as: <element1 A="AValue" B="BValue"> <element2 C="DValue" D="CValue"> <element3 E="EValue1" F="FValue1"/> <element3 E="EValue2" F="FValue2"/> </element2> ... </element1> into the flattened XML (html) picking up selected attributes along the way and...

Best Manual Editing Software

I'm writing a manual for our new software product... and M$ Word just doesn't cut it. So what is the best software or language to use for creating/editing a software manual? ...

Change value of attribute on an XML object in AS3

Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own? The ideal would be something like: var myXML:XML; // ... load xml data into the XML object myXML.someAttribute = newValue; ...

Grep and Sed Equivalent for XML Command Line Processing

When doing shell scripting, typically data will be in files of single line records like csv. It's really simple to handle this data with grep and sed. But I have to deal with XML often, so I'd really like a way to script access to that XML data via the command line. What are the best tools? ...

How do I use groovy to search+replace in XML?

How do I use groovy to search+replace in XML? I need something as short/easy as possible, since I'll be giving this code to the testers for their SoapUI scripting. More specifically, how do i turn "<root><data></data></root>" into "<root><data>value</data></root>" ...

How to use node-set function in a platform-independent way?

I'm writing some xlst file which I want to use under linux and Windows. In this file I use node-set function which declared in different namespaces for MSXML and xsltproc ("urn:schemas-microsoft-com:xslt" and "http://exslt.org/common" respectively). Is there any platform independent way of using node-set? ...

Counter inside xsl:for-each loop

How to get a counter inside xsl:for-each loop that would reflect the number of current element processed. For example my source XML is <books> <book> <title>The Unbearable Lightness of Being </title> </book> <book> <title>Narcissus and Goldmund</title> </book> <book> <title>Choke</title> </book> </...

Stripping Invalid XML characters in Java

I have an XML file that's the output from a database. I'm using the Java SAX parser to parse the XML and output it in a different format. The XML contains some invalid characters and the parser is throwing errors like 'Invalid Unicode character (0x5)' Is there a good way to strip all these characters out besides pre-processing the fil...

What's the easiest non-memory intensive way to output XML from Python?

Basically, something similar to System.Xml.XmlWriter - A streaming XML Writer that doesn't incur much of a memory overhead. So that rules out xml.dom and xml.dom.minidom. Suggestions? ...