What is an empty element?

But since both these parts are optional, it would mean that nothing (as in, absence of characters) matches this production. That may be true, but the wording in the spec on this issue is quite clear. There are even examples for empty elements in the next paragraph. <IMG align=”left” src=”http://www.w3.org/Icons/WWW/w3c_home” /> <br></br> <br/> So the … Read more

Spring v3 no declaration can be found for element ‘mvc:resources’

In your spring context xml mvc namespace url should match url in schemaLocation. Something like this: <?xml version=”1.0″ encoding=”UTF-8″?> <beans xmlns=”http://www.springframework.org/schema/beans” xmlns:mvc=”http://www.springframework.org/schema/mvc” xsi:schemaLocation=” http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd”> This is a standard XML namespace declaration. The namespace url is sort of an unique id, which is then mapped to the actual schema location in xsi:schemaLocation.

SharedPreferences value is not updated

Instead of using edit.commit();, you should use edit.apply();. Apply will update the preference object instantly and will save the new values asynchronously, so allowing you to read the latest values. commit() Commit your preferences changes back from this Editor to the SharedPreferences object it is editing. This atomically performs the requested modifications, replacing whatever is … Read more

IIS7 URL Rewrite – Add “www” prefix

To make it more generic you can use following URL Rewrite rule which working for any domain: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <rewrite> <rules> <rule name=”Add WWW” stopProcessing=”true”> <match url=”^(.*)$” /> <conditions> <add input=”{HTTP_HOST}” pattern=”^(?!www\.)(.*)$” /> </conditions> <action type=”Redirect” url=”http://www.{C:0}{PATH_INFO}” redirectType=”Permanent” /> </rule> </rules> </rewrite> </system.webServer>

How to get values inside using php DOM?

Working with PHP DOM is fairly straightforward, and is very similar to Javascript’s DOM. Here are the important classes: DOMNode — The base class for anything that can be traversed inside an XML/HTML document, including text nodes, comment nodes, and CDATA nodes DOMElement — The base class for tags. DOMDocument — The base class for … Read more

Get line number from xml node – java

I have got this working by following this example: http://eyalsch.wordpress.com/2010/11/30/xml-dom-2/ This solution follows the method suggested by Michael Kay. Here is how you use it: // XmlTest.java import java.io.ByteArrayInputStream; import java.io.InputStream; import org.w3c.dom.Document; import org.w3c.dom.Node; public class XmlTest { public static void main(final String[] args) throws Exception { String xmlString = “<foo>\n” + ” <bar>\n” … Read more