xml

prettifying Java XML output

I have a simple question about Java's XML API and I hope there's a simple answer too: Lets say that after processing I have the following XML output: <a> <b><c> <d> <e> some content </e> </d> </c> </b> </a> The structure is correct but whitespaces are all over the place. The question is that how can I prettify the ou...

Custom Schema Validation behaviour - XmlReaderSettings

I am parsing XML with an XMLReader using a XMLReaderSettings object with the event handling setup to carry out schema validation where appropriate. However it seems that the error catching only occurs once per level of XML. This means that any subsequent errors at that level are ignored. Is there any way I can get the Error handling ev...

Can I know how much of a XML document is processed by an XSL transformation?

I have rather large input XML files that must be converted to a given format with XSL. These XSL files have been hand-crafted, and we want to make sure that every non-empty text node in the original document is taken into account, i.e. either value-of'ed, copy-of'ed, or read and concatenated with something else. Is this even possible? I...

XmlDocument and the Formal Public Identifier

Why is my GetEntity function in my overloaded XmlResolver being passed the Formal Public Identifier when I load an xml file into an XmlDocument? Is this a bug or am I supposed to deal with this some how? edit: Here's some code. Say for example I do this: XmlDocument myXmlDoc = new XmlDocument(); myXmlDoc.XmlResolver = new MyXmlResolv...

Open source tool to generate diagrams from XML Schema documents?

I'm looking for an open source tool to generate diagrams from XML Schema documents, similar to the Logical Model View in oXygen or the diagrams in XML Spy's Schema Editor. ...

Why does XAML element-to-xml binding only partially work?

In the below code, the ListBox gets filled with the names of the colors from the XML file, but those names strangely do not appear in the TextBox. However, if you bind the textbox to the static "lbColor2", those names do appear. So what could be different about the names when they come from the XML source which makes them not get passe...

XML Schema - getting around unique tag constraint

I have to make a schema for an XML format that's already being used. The existing XML is being generated already by a different program, and it sounds like it would be difficult to track down all the places that would need to be changed in order to use a more regular XML format. Here's an example similar to our XML structure: <data> ...

Change the node names in an XML file using c#

Hello ! I have a huge bunch of xml files with the following structure : <Stuff1> <Content>someContent</name> <type>someType</type> </Stuff1> <Stuff2> <Content>someContent</name> <type>someType</type> </Stuff2> <Stuff3> <Content>someContent</name> <type>someType</type> </Stuff3> ... ... I need to change the each of the "Co...

Java library for converting XML to syntax colored HTML

I have a Java string of XML content. I use Velocity to generate some HTML reports, and this XML needs to be included into one of those HTML files. It would be nice if this XML is syntax colored and formatted. Does anyone know of a Java library to do this? ...

Validating XML tag by tag

Hi All I'm having some issues validating some XML against a Schema, using .net and C#. I am using XmlReaderSettings with the ValidationEventHandler. However, this seems to stop catching errors after it has encountered the first error at a particular level within the XML file, instead of checking the next tag at the same level, so bas...

meta and img tags, generated in an xlt are not being closed correctly

I'm trying to get the meta and img tags to close in the output from an xlt. I've looked into it, and it seems I need to select an "xml" method rather than "html", but this still doesn't seem to work. I've currently got: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL...

Splitting a large XML file in Python

I'm looking to split a huge XML file into smaller bits. I'd like to scan through the file looking for a specific tag, then grab all info between and , then save that into a file, then continue on through the rest of the file. My issue is trying to find a clean way to note the start and end of the tags, so that I can grab the text insid...

Where is the documentation for Adobe XFL Flash interchange format?

I work at an animation studio that does several productions in Flash. Probably one of the most exciting features of the new Adobe CS4 suite is the XFL file format. At last, I have an ascii format that I can use to tighten our Flash-to-After Effects pipeline, as well as scene plan entire episodes without ever having to have Flash open. ...

"dynamic" XSLT to feed webbrowser control?

I frequently use HTML output in applications, up to now I've used some simple routines to build an HTML string. I want to try something different now: I want to serialize the data to XML, and provide some XSLT templates to generate the HTML for the webbrowser control. I get that to work statically (slowly digging through writing XSL), b...

How to convert XML to JSON in Python

I am importing an XML feed and trying to convert it to JSON for output. I'm getting this error: TypeError: <xml.dom.minidom.Document instance at 0x72787d8> is not JSON serializable Unfortunately I know next to nothing about Python. I'm developing this on the Google App Engine. I could use some help, because my little 2 hour hack that...

How to create XElement with default namespace for children without using XNamespace in all child nodes

I'm trying to use System.Xml.Linq to create XHTML documents. Thus, the vast majority of the nodes in my trees ought to use this namespace: http://www.w3.org/1999/xhtml I can create XElement nodes scoped to this namespace easily enough, using an XNamespace, like this: XNamespace xhtml = "http://www.w3.org/1999/xhtml"; // ... new XElem...

How can I convert a value type cast as an object to a string using XmlConvert?

I'm looking for something equivalent to the code below but for any value type without having to encode a switch statement for each data type. The code below does not compile because XmlConvert.ToString() does not have an overload that accepts and object. int intValue = 10; object boxedValue = (object)intValue; st...

When would you use XML over JSON for Ajax?

Recently, many programmers and that includes me, have taken the X out of AJAX, and by default use JSON as the protocol format. However I'm trying to think of some places where XML would be more appropriate as a protocol format, that doesn't include SOAP (because SOAP could theoretically be done with JSON anyways). Note: I love me XML fo...

Can Xml be compressed with </> to end elements?

Is there any reason why XML such as this : <person> <firstname>Joe</firstname> <lastname>Plumber</lastname> </person> couldn't be compressed like this for client/server transfer. <person> <firstname>Joe</> <lastname>Plumber</> </> It would be smaller - and slightly faster to parse. Assuming that th...

Microsoft.Reporting.* vs XML/XSLT

I would like to add reporting capabilities to a .NET application. My data source is just the data model of the application, i.e. a bunch of objects that may have been generated or loaded from anything (not necessarily from a database). The initial plan was to generate a report data XML file from these objects, and then use XSLT to trans...