How do I comment out a block of tags in XML?

How do I comment out a block of tags in XML? I.e. How can I comment out <staticText> and everything inside it, in the code below? <detail> <band height=”20″> <staticText> <reportElement x=”180″ y=”0″ width=”200″ height=”20″/> <text><![CDATA[Hello World!]]></text> </staticText> </band> </detail> I could use <!– staticText–> but that’s just for single tags (as what I know), … Read more

What’s “tools:context” in Android layout files?

Starting with a recent new version of ADT, I’ve noticed this new attribute on the layout XML files, for example: <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent” tools:context=”.MainActivity” /> What is “tools:context” used for? How does it even know the exact path to the activity that is written there? Does it look at the package of … Read more

Text editor to open big (giant, huge, large) text files [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

How to add post featured image to RSS item tag?

I am able to add a post featured image to the RSS feed like so: function insertThumbnailRSS($content) { global $post; if(has_post_thumbnail($post->ID)){ $content=””.get_the_post_thumbnail($post->ID, ‘thumbnail’, array(‘alt’ => get_the_title(), ‘title’ => get_the_title(), ‘style’ => ‘float:right;’)).”.$content; } return $content; } add_filter(‘the_excerpt_rss’, ‘insertThumbnailRSS’); add_filter(‘the_content_feed’, ‘insertThumbnailRSS’); However, upon examining the XML generated for the RSS feed, I noticed it sticks the … Read more

How to parse XML and get instances of a particular node attribute?

I have many rows in XML and I’m trying to get instances of a particular node attribute. <foo> <bar> <type foobar=”1″/> <type foobar=”2″/> </bar> </foo> How do I access the values of the attribute foobar? In this example, I want “1” and “2”. 18 s 18 I suggest ElementTree. There are other compatible implementations of … Read more

What does in XML mean?

I often find this strange CDATA tag in XML files: <![CDATA[some stuff]]> I have observed that this CDATA tag always comes at the beginning, and then followed by some stuff. But sometimes it is used, sometimes it is not. I assume it is to mark that some stuff is the “data” that will be inserted … Read more

“Content is not allowed in prolog” when parsing perfectly valid XML on GAE

The encoding in your XML and XSD (or DTD) are different.XML file header: <?xml version=’1.0′ encoding=’utf-8′?>XSD file header: <?xml version=’1.0′ encoding=’utf-16′?> Another possible scenario that causes this is when anything comes before the XML document type declaration. i.e you might have something like this in the buffer: helloworld<?xml version=”1.0″ encoding=”utf-8″?> or even a space or special character. … Read more