XML and JSON — Advantages and Disadvantages?

JSON is more compact and can be easily loaded in JavaScript. XML is stricter and has support for schemas and namespaces. On the face of it JSON seems superior in every way – it’s flexible, more compact and in many cases easier to use (especially when working with JavaScript), however it lacks some key features, … Read more

How to fix error: The markup in the document following the root element must be well-formed

General case The markup in the document following the root element must be well-formed. This error indicates that your XML has markup following the root element. In order to be well-formed, XML must have exactly one root element, and there can be no further markup following the single root element. One root element example (GOOD) … Read more

How can I use XPath to find the minimum value of an attribute in a set of elements?

Here’s a slightly shorter solution. Maximum: /foo/bar/@score[not(. < ../../bar/@score)][1] Minimum: /foo/bar/@score[not(. > ../../bar/@score)][1] I’ve edited the predicate so that it’s applicable to any sequence of bar, even if you decide to change the path. Note that parent of attribute is the element to which it belongs. If embedding these queries in XML files like XSLT … Read more

How do I use PowerShell to Validate XML files against an XSD?

I want to comment that the script in current accepted answer doesn’t validate errors about incorrect orders of elements of xs:sequence. For example: test.xml <addresses xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=’test.xsd’> <address> <street>Baker street 5</street> <name>Joe Tester</name> </address> </addresses> test.xsd <xs:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema”> <xs:element name=”addresses”> <xs:complexType> <xs:sequence> <xs:element ref=”address” minOccurs=”1″ maxOccurs=”unbounded”/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name=”address”> <xs:complexType> <xs:sequence> <xs:element ref=”name” … Read more

What browsers support XSLT 2.0?

Browsers do not yet support XSLT 2.0, natively. Saxon 9 CE is a JavaScript-based XSLT 2.0 implementation. Frameless is another, more light-weight XSLT 2.0 implementation in the browser, supporting large parts of the XSLT 2.0 and XPath 2.0 functionality See also: How can I make XSLT work in chrome? https://developer.mozilla.org/en/docs/XSLT_2.0 http://blogs.msdn.com/b/dareobasanjo/archive/2004/05/13/131166.aspx

Using Oracle XMLType column in hibernate

My Direction and Requirements Entity should store XML as a string (java.lang.String) Database should persist XML in an XDB.XMLType column Allows indexing and more efficient xpath/ExtractValue/xquery type queries Consolidate a dozen or so partial solutions I found over the last week Working Environment Oracle 11g r2 x64 Hibernate 4.1.x Java 1.7.x x64 Windows 7 Pro … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)