xml

How to create an empty DOMElement

I am using Xerces-c in my project, and would like to create a single DOMElement without having to create a whole new DOMDocument. Is such a thing possible? ...

Looking for a good Bulk Insert XML Shredding example for SQL 2005

A little help needed. I'm receiving an xml file similar to this: <?xml version="1.0" encoding="utf-16"?> <dc:GRANTEE xsi:schemaLocation="http://www.blahblahblah.com/FullSchema test.xsd " xmlns:dc="http://www.blahblahblah.com/FullSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; <RPGID>90CU0024</RPGID> <PLANID>01...

How do I write objects for easy XML Serialization in VB.NET?

I'm writing a small application in VB.NET and I would like some of the classes to be able to write themselves out to XML to serve as a "save" feature. I have seen XSD files used to generate VB classes that can serialize themselves into and out of XML very easily. How would I do this if I do have any pre-existing XML format that I need ...

Is there a way to escape a CDATA end token in xml?

I was wondering if there is any way to escape a CDATA end token ( ]]> ) within a CDATA section in an xml document. Or, more generally, if there is some escape sequence for using within a CDATA (but if it exists, I guess it'd probably only make sense to escape begin or end tokens, anyway). Basically, can you have a begin or end token em...

are XML standard parsers faster than other kind of custom written parsers?

Are xML parsers(provided by standard libraries ) faster than custom written parsers if so, Why ? ...

Nested predicates in xslt

Is it possible to do the equivalent of the following in xslt: .//TagA[./TagB/[@AttrA='AttrAValue'] = 'TagBValue'] This is failing within Visual Studio 2008 with the following error: error: Unexpected token '[' in the expression. .//TagA[./TagB/ -->[<-- @AttrA='AttrAValue'] = 'TagBValue'] Should this be working? Is this a problem in...

How to insert/move/delete nodes in xml with Groovy?

for example, I have the following xml document: def CAR_RECORDS = ''' <records> <car name='HSV Maloo' make='Holden' year='2006'/> <car name='P50' make='Peel' year='1962'/> <car name='Royale' make='Bugatti' year='1931'/> </records> ''' and I want to move the car "Royale" up to first one, and insert a new ca...

Best XML serialization library for a MFC C++ app

I have an application, written in C++ using MFC and Stingray libraries. The application works with a wide variety of large data types, which are all currently serialized based on MFC Document/View serialize derived functionality. I have also added options for XML serialization based on the Stingray libraries, which implements DOM via t...

Validating and Extracting XML record by record into Database

Here's the deal. I have an XML document with a lot of records. Something like this: print("<?xml version="1.0" encoding="utf-8" ?> <Orders> <Order> <Phone>1254</Phone> <City>City1</City> <State>State</State> </Order> <Order> <Phone>98764321</Phone> <City>City2</City> ...

Reading a single XML document from a stream using dom4j

I'm trying to read a single XML document from stream at a time using dom4j, process it, then proceed to the next document on the stream. Unfortunately, dom4j's SAXReader (using JAXP under the covers) keeps reading and chokes on the following document element. Is there a way to get the SAXReader to stop reading the stream once it finds ...

ASP.NET: Wrong Code Displayed in Crash Dump

So a webapp I've been working on broke, and I made some fixes... it still crashes, but in the YSOD it shows me the old code. I'm running this from the VS 2005 IDE. It won't hit any breakpoints, and it crashes on line 249, which is clearly commented out. I've cleared out my debug/release folders and rebuilt it; restarted IIS (just in case...

XPath in C# code behind of WPF

You can use XPath if you're binding the XML document in the XAML, but what if you're loading the XML document dynamically in the code behind? Is there any XPath methods available in the C# code behind? (using .NET 3.5 SP1) ...

How do I print a groovy Node with namespace preserved?

When I use this code to output some XML I parsed (and modified) with XmlParser XmlParser parser = new XmlParser() def root = parser.parseText(feedUrl.toURL().text) def writer = new StringWriter() new XmlNodePrinter(new PrintWriter(writer)).print(root) println writer.toString() the namespace declarations on the roo...

How to select unique nodes in XSLT

I found this page describing the Muenchian method, but I think I'm applying it wrong. Consider that this would return a set of ages: /doc/class/person/descriptive[(@name='age')]/value 1..2..2..2..3..3..4..7 But I would like a nodeset only one node for each age. 1..2..3..4..7 Each of these seem to return all of the values, ...

How to ignore whitespace while reading a file to produce an XML DOM

Hello, I'm trying to read a file to produce a DOM Document, but the file has whitespace and newlines and I'm trying to ignore them, but I couldn't: DocumentBuilderFactory docfactory=DocumentBuilderFactory.newInstance(); docfactory.setIgnoringElementContentWhitespace(true); I see in Javadoc that setIgnoringElementContentWhitespace meth...

Ant replace multiple lines of text

I have an xml file where I need to comment out a whole piece of text with Ant. There's this ant task <replace file="${src.dir}/Version.as" token="@revisionPrana" value="${revision}"/> that I use to replace words, but in my case I need to replace a whole block like this: <value> <object class="edumatic.backoffice.view...

Is there an XML language for defining/authoring SQL database schemas?

Is there a dialect of XML for defining the tables, indexes and relations of a relational database, and a "compiler" or stylesheet to transform that definition into SQL CREATE statements (DDL)? EG, something that might look like: <Table Name="orders"> <Column Name="order_id" Type="varchar" Size="20"/> ... etc ... </Table> I'd ...

XSLT XALAN Example

Hi, I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? I am running Wind...

XPath query with PHP

Here's the XML code i'm working with: <inventory> <drink> <lemonade supplier="mother" id="1"> <price>$2.50</price> <amount>20</amount> </lemonade> <lemonade supplier="mike" id="4"> <price>$3.00</price> ...

retrieve xml doc comments programmatically

Visual Studio does it; Reflector does it; and now I want to as well :) I want to retrieve the xml documentation for some members in some framework assemblies (i.e. mscorlib.dll, System.dll, etc). I assume this would involve: finding the xml file for the assembly, navigating to the appropriately named child element, and retrieving th...