RSS

Most votes on xml questions 8

Most votes on xml questions 8. #71 ImageView in circular through XML #72 Free XML Formatting tool #73 How to get the selected index of a RadioGroup in Android #74 No grammar constraints (DTD or XML schema) detected for the document #75 How to execute XPath one-liners from shell? #76 What's the difference between xsd:include and xsd:import? #77 XMLHttpRequest Origin null is not allowed Access-Control-Allow-Origin for file:/// to file:/// (Serverless) #78 XML parsing of a variable string in JavaScript #79 XPath to select Element by attribute value #80 Best way to compare 2 XML documents in Java

Read all the top votes questions and answers in a single page.

#71: ImageView in circular through XML (Score: 226)

Created: 2014-02-28 Last updated: 2021-04-01

Tags: android, xml, imageview

I’d Like to make any image from my ImageView to be circular with a border.

I searched but couldn’t find any useful information (anything that I tried didn’t work).

How can I achieve this through XML: Create an ImageView with certain src and make it circular with a border?

#71 Best answer 1 of ImageView in circular through XML (Score: 325)

Created: 2016-02-09 Last updated: 2021-02-16

This is the simplest way that I designed. Try this.

dependencies

  • implementation ‘androidx.appcompat:appcompat:1.3.0-beta01’

  • implementation ‘androidx.cardview:cardview:1.0.0’

     <android.support.v7.widget.CardView
         android:layout_width="80dp"
         android:layout_height="80dp"
         android:elevation="12dp"
         android:id="@+id/view2"
        app:cardCornerRadius="40dp"
         android:layout_centerHorizontal="true"
         android:innerRadius="0dp"
         android:shape="ring"
         android:thicknessRatio="1.9">
         <ImageView
             android:layout_height="80dp"
             android:layout_width="match_parent"
             android:id="@+id/imageView1"
             android:src="@drawable/YOUR_IMAGE"
             android:layout_alignParentTop="true"
             android:layout_centerHorizontal="true">
         </ImageView>
      </android.support.v7.widget.CardView>
    

    If you are working on android versions above lollipop

     <android.support.v7.widget.CardView
     android:layout_width="80dp"
     android:layout_height="80dp"
     android:elevation="12dp"
     android:id="@+id/view2"
     app:cardCornerRadius="40dp"
     android:layout_centerHorizontal="true">
     <ImageView
         android:layout_height="80dp"
         android:layout_width="match_parent"
         android:id="@+id/imageView1"
         android:src="@drawable/YOUR_IMAGE"
         android:scaleType="centerCrop"/>
       </android.support.v7.widget.CardView>
    

Adding Border to round ImageView - LATEST VERSION

Wrap it with another CardView slightly bigger than the inner one and set its background color to add a border to your round image. You can increase the size of the outer CardView to increase the thickness of the border.

<androidx.cardview.widget.CardView
  android:layout_width="155dp"
  android:layout_height="155dp"
  app:cardCornerRadius="250dp"
  app:cardBackgroundColor="@color/white">

    <androidx.cardview.widget.CardView
      android:layout_width="150dp"
      android:layout_height="150dp"
      app:cardCornerRadius="250dp"
      android:layout_gravity="center">

        <ImageView
          android:layout_width="150dp"
          android:layout_height="150dp"
          android:src="@drawable/default_user"
          android:scaleType="centerCrop"/>

   </androidx.cardview.widget.CardView>

 </androidx.cardview.widget.CardView>

#71 Best answer 2 of ImageView in circular through XML(Score: 230)

Created: 2014-02-28 Last updated: 2020-01-28

You can make a simple circle with white border and transparent content with shape.

// res/drawable/circle.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:innerRadius="0dp"
    android:shape="ring"
    android:thicknessRatio="1.9"
    android:useLevel="false" >
    <solid android:color="@android:color/transparent" />

    <stroke
        android:width="10dp"
        android:color="@android:color/white" />
</shape>

Then make a layerlist drawable and put it as background to your imageview.

// res/drawable/img.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:drawable="@drawable/circle"/>    
    <item android:drawable="@drawable/ic_launcher"/>

</layer-list>

and put it as background to your imageview.

   <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/img"/>

You’ll have something like that.

enter image description here

See also original question in stackoverflow

#72: Free XML Formatting tool (Score: 225)

Created: 2008-10-11 Last updated: 2009-06-24

Tags: xml, xml-formatting

Is there a free XML formatting (indent) tool available where I can past an XML string and have it formatted so I can read the XML document correctly?

Thanks

Edit ~ I am using XML Notepad on Windows XP.

#72 Best answer 1 of Free XML Formatting tool (Score: 351)

Created: 2008-10-11 Last updated: 2011-09-01

I believe that Notepad++ has this feature.

Edit (for newer versions)
Install the “XML Tools” plugin (Menu Plugins, Plugin Manager)
Then run: Menu Plugins, Xml Tools, Pretty Print (XML only - with line breaks)

Original answer (for older versions of Notepad++)

Notepad++ menu: TextFX -> HTML Tidy -> Tidy: Reindent XML

This feature however wraps XMLs and that makes it look ‘unclean’. To have no wrap,

  • open C:\Program Files\Notepad++\plugins\Config\tidy\TIDYCFG.INI,
  • find the entry [Tidy: Reindent XML] and add wrap:0 so that it looks like this:
[Tidy: Reindent XML] 
input-xml: yes 
indent:yes 
wrap:0 

#72 Best answer 2 of Free XML Formatting tool(Score: 59)

Created: 2008-10-11 Last updated: 2013-07-10

Firstobject’s free XML editor for Windows is called foxe is a great tool.

Open or paste your XML into it and press F8 to indent (you may need to set the number of indent spaces as it may default to 0).

It looks simple, however it contains a custom written XML parser written in C++ that allows it to work efficiently with very large XML files easily (unlike some expensive “espionage” related tools I’ve used).

From the product page:

The full Visual C++ source code for this firstobject XML editor (including the CDataEdit gigabyte edit control MFC component) is available as part of the Advanced CMarkup Developer License. It allows developers to implement custom XML handling functions such as validation, transformation, beautify, and reporting for their own purposes.

See also original question in stackoverflow

#73: How to get the selected index of a RadioGroup in Android (Score: 221)

Created: 2011-06-22 Last updated: 2011-06-22

Tags: java, android, xml, radio-group

Is there an easy way to get the selected index of a RadioGroup in Android or do I have to use OnCheckedChangeListener to listen for changes and have something that holds the last index selected?

example xml:

<RadioGroup android:id="@+id/group1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">
    <RadioButton android:id="@+id/radio1" android:text="option 1" android:layout_width="wrap_content" android:layout_height="wrap_content" />
    <RadioButton android:id="@+id/radio2" android:text="option 2" android:layout_width="wrap_content" android:layout_height="wrap_content" />
    <RadioButton android:id="@+id/radio3" android:text="option 3" android:layout_width="wrap_content" android:layout_height="wrap_content" />
    <RadioButton android:id="@+id/radio4" android:text="option 4" android:layout_width="wrap_content" android:layout_height="wrap_content" />
    <RadioButton android:id="@+id/radio5" android:text="option 5" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</RadioGroup>

if a user selects option 3 I want to get the index, 2.

#73 Best answer 1 of How to get the selected index of a RadioGroup in Android (Score: 496)

Created: 2011-06-22 Last updated: 2018-10-17

You should be able to do something like this:

int radioButtonID = radioButtonGroup.getCheckedRadioButtonId();
View radioButton = radioButtonGroup.findViewById(radioButtonID);
int idx = radioButtonGroup.indexOfChild(radioButton);

If the RadioGroup contains other Views (like a TextView) then the indexOfChild() method will return wrong index.

To get the selected RadioButton text on the RadioGroup:

 RadioButton r = (RadioButton) radioButtonGroup.getChildAt(idx);
 String selectedtext = r.getText().toString();

#73 Best answer 2 of How to get the selected index of a RadioGroup in Android(Score: 112)

Created: 2011-06-22

This should work,

int index = myRadioGroup.indexOfChild(findViewById(myRadioGroup.getCheckedRadioButtonId()));

See also original question in stackoverflow

#74: No grammar constraints (DTD or XML schema) detected for the document (Score: 215)

Created: 2010-12-29 Last updated: 2011-05-26

Tags: xml, eclipse, validation, dtd

I have this dtd : http://fast-code.sourceforge.net/template.dtd But when I include in an xml I get the warning : No grammar constraints (DTD or XML schema) detected for the document. The xml is :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE templates PUBLIC "//UNKNOWN/" "http://fast-code.sourceforge.net/template.dtd">

<templates>
<template type="INSTANCE_OF_CLASS">
	<description>Used to Create instance of class</description>
	<variation>asasa</variation>
	<variation-field>asasa</variation-field>
	<class-pattern>asasa</class-pattern>
	<getter-setter>setter</getter-setter>
	<allowed-file-extensions>java</allowed-file-extensions>
	<number-required-classes>1</number-required-classes>
	<allow-multiple-variation>false</allow-multiple-variation>
	<template-body>
        <![CDATA[
            // Creating new instance of ${class_name}
            final ${class_name} ${instance} = new ${class_name}();
            #foreach ($field in ${fields})
                ${instance}.${field.setter}(${field.value});
            #end
        ]]>
	</template-body>
</template>
</templates>

EDIT : I changed the xml, I am getting this error now:

The content of element type “template” must match “(description,variation?,variation-field?,allow- multiple-variation?,class-pattern?,getter-setter?,allowed-file-extensions?,number-required- classes?,template-body)”.

#74 Best answer 1 of No grammar constraints (DTD or XML schema) detected for the document (Score: 429)

Created: 2014-03-10 Last updated: 2017-06-17

In my case I have solved this annoying warning by simply adding the <!DOCTYPE xml> after the <?xml ... > tag.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>

#74 Best answer 2 of No grammar constraints (DTD or XML schema) detected for the document(Score: 163)

Created: 2011-10-10

This worked for me in Eclipse 3.7.1: Go to the Preferences window, then XML -> XML Files -> Validation. Then in the Validating files section of the preferences panel on the right, choose Ignore in the drop down box for the “No grammar specified” preference. You may need to close the file and then reopen it to make the warning go away.

(I know this question is old but it was the first one I found when searching on the warning, so I’m posting the answer here for other searchers.)

See also original question in stackoverflow

#75: How to execute XPath one-liners from shell? (Score: 211)

Created: 2013-03-17 Last updated: 2014-05-14

Tags: xml, shell, xpath, cross-platform

Is there a package out there, for Ubuntu and/or CentOS, that has a command-line tool that can execute an XPath one-liner like foo //[email protected] filename.xml or foo //[email protected] < filename.xml and return the results line by line?

I’m looking for something that would allow me to just apt-get install foo or yum install foo and then just works out-of-the-box, no wrappers or other adaptation necessary.

Here are some examples of things that come close:

Nokogiri. If I write this wrapper I could call the wrapper in the way described above:

#!/usr/bin/ruby

require 'nokogiri'

Nokogiri::XML(STDIN).xpath(ARGV[0]).each do |row|
  puts row
end

XML::XPath. Would work with this wrapper:

#!/usr/bin/perl

use strict;
use warnings;
use XML::XPath;

my $root = XML::XPath->new(ioref => 'STDIN');
for my $node ($root->find($ARGV[0])->get_nodelist) {
  print($node->getData, "\n");
}

xpath from XML::XPath returns too much noise, -- NODE -- and attribute = "value".

xml_grep from XML::Twig cannot handle expressions that do not return elements, so cannot be used to extract attribute values without further processing.

EDIT:

echo cat //element/@attribute | xmllint --shell filename.xml returns noise similar to xpath.

xmllint --xpath //element/@attribute filename.xml returns attribute = "value".

xmllint --xpath 'string(//element/@attribute)' filename.xml returns what I want, but only for the first match.

For another solution almost satisfying the question, here is an XSLT that can be used to evaluate arbitrary XPath expressions (requires dyn:evaluate support in the XSLT processor):

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn">
  <xsl:output omit-xml-declaration="yes" indent="no" method="text"/>
  <xsl:template match="/">
    <xsl:for-each select="dyn:evaluate($pattern)">
      <xsl:value-of select="dyn:evaluate($value)"/>
      <xsl:value-of select="'&#10;'"/>
    </xsl:for-each> 
  </xsl:template>
</xsl:stylesheet>

Run with xsltproc --stringparam pattern //element/@attribute --stringparam value . arbitrary-xpath.xslt filename.xml.

#75 Best answer 1 of How to execute XPath one-liners from shell? (Score: 295)

Created: 2013-03-17 Last updated: 2020-06-28

You should try these tools :

  • xmlstarlet : can edit, select, transform… Not installed by default, xpath1
  • xmllint : often installed by default with libxml2-utils, xpath1 (check my wrapper to have --xpath switch on very old releases and newlines delimited output (v < 2.9.9)
  • xpath : installed via perl’s module XML::XPath, xpath1
  • xml_grep : installed via perl’s module XML::Twig, xpath1 (limited xpath usage)
  • xidel: xpath3
  • saxon-lint : my own project, wrapper over @Michael Kay’s Saxon-HE Java library, xpath3

xmllint comes with libxml2-utils (can be used as interactive shell with the --shell switch)

xmlstarlet is xmlstarlet.

xpath comes with perl’s module XML::Xpath

xml_grep comes with perl’s module XML::Twig

xidel is xidel

saxon-lint using SaxonHE 9.6 ,XPath 3.x (+retro compatibility)

Ex :

xmllint --xpath '//element/@attribute' file.xml
xmlstarlet sel -t -v "//element/@attribute" file.xml
xpath -q -e '//element/@attribute' file.xml
xidel -se '//element/@attribute' file.xml
saxon-lint --xpath '//element/@attribute' file.xml

.

#75 Best answer 2 of How to execute XPath one-liners from shell?(Score: 24)

Created: 2013-03-17 Last updated: 2016-10-15

You can also try my Xidel. It is not in a package in the repository, but you can just download it from the webpage (it has no dependencies).

It has simple syntax for this task:

xidel filename.xml -e '//element/@attribute' 

And it is one of the rare of these tools that supports XPath 2.

See also original question in stackoverflow

#76: What's the difference between xsd:include and xsd:import? (Score: 211)

Created: 2010-03-01 Last updated: 2014-06-18

Tags: xml, xsd

What’s the difference between xsd:include and xsd:import? When would you use one instead of the other, and when might it not matter?

#76 Best answer 1 of What's the difference between xsd:include and xsd:import? (Score: 211)

Created: 2010-03-01 Last updated: 2016-08-28

The fundamental difference between include and import is that you must use import to refer to declarations or definitions that are in a different target namespace and you must use include to refer to declarations or definitions that are (or will be) in the same target namespace.

Source: https://web.archive.org/web/20070804031046/http://xsd.stylusstudio.com/2002Jun/post08016.htm

#76 Best answer 2 of What's the difference between xsd:include and xsd:import?(Score: 56)

Created: 2014-04-16

Use xsd:include to bring in an XSD from the same or no namespace.

Use xsd:import to bring in an XSD from a different namespace.

See also original question in stackoverflow

#77: XMLHttpRequest Origin null is not allowed Access-Control-Allow-Origin for file:/// to file:/// (Serverless) (Score: 209)

Created: 2010-11-17 Last updated: 2019-02-02

Tags: jquery, xml, xslt, cors, xmlhttprequest

I’m trying to create a website that can be downloaded and run locally by launching its index file.

All the files are local, no resources are used online.

When I try to use the AJAXSLT plugin for jQuery to process an XML file with an XSL template (in sub directories), I receive the following errors:

XMLHttpRequest cannot load file:///C:/path/to/XSL%20Website/data/home.xml. Origin null is not allowed by Access-Control-Allow-Origin.

XMLHttpRequest cannot load file:///C:/path/to/XSL%20Website/assets/xsl/main.xsl. Origin null is not allowed by Access-Control-Allow-Origin.

The index file making the request is file:///C:/path/to/XSL%20Website/index.html while the JavaScript files used are stored in file:///C:/path/to/XSL%20Website/assets/js/.

How can I do to fix this issue?

#77 Best answer 1 of XMLHttpRequest Origin null is not allowed Access-Control-Allow-Origin for file:/// to file:/// (Serverless) (Score: 177)

Created: 2011-01-20 Last updated: 2017-05-23

For instances where running a local webserver is not an option, you can allow Chrome access to file:// files via a browser switch. After some digging, I found this discussion, which mentions a browser switch in opening post. Run your Chrome instance with:

chrome.exe --allow-file-access-from-files

This may be acceptable for development environments, but little else. You certainly don’t want this on all the time. This still appears to be an open issue (as of Jan 2011).

See also: Problems with jQuery getJSON using local files in Chrome

#77 Best answer 2 of XMLHttpRequest Origin null is not allowed Access-Control-Allow-Origin for file:/// to file:/// (Serverless)(Score: 87)

Created: 2010-11-25

Essentially the only way to deal with this is to have a webserver running on localhost and to serve them from there.

It is insecure for a browser to allow an ajax request to access any file on your computer, therefore most browsers seem to treat “file://” requests as having no origin for the purpose of “Same Origin Policy

Starting a webserver can be as trivial as cding into the directory the files are in and running:

python -m SimpleHTTPServer

See also original question in stackoverflow

#78: XML parsing of a variable string in JavaScript (Score: 208)

Created: 2009-03-16 Last updated: 2012-06-17

Tags: javascript, xml, parsing

I have a variable string that contains well-formed and valid XML. I need to use JavaScript code to parse this feed.

How can I accomplish this using (browser-compatible) JavaScript code?

#78 Best answer 1 of XML parsing of a variable string in JavaScript (Score: 327)

Created: 2011-12-07 Last updated: 2017-12-04

Updated answer for 2017

The following will parse an XML string into an XML document in all major browsers. Unless you need support for IE <= 8 or some obscure browser, you could use the following function:

function parseXml(xmlStr) {
   return new window.DOMParser().parseFromString(xmlStr, "text/xml");
}

If you need to support IE <= 8, the following will do the job:

var parseXml;

if (typeof window.DOMParser != "undefined") {
    parseXml = function(xmlStr) {
        return new window.DOMParser().parseFromString(xmlStr, "text/xml");
    };
} else if (typeof window.ActiveXObject != "undefined" &&
       new window.ActiveXObject("Microsoft.XMLDOM")) {
    parseXml = function(xmlStr) {
        var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = "false";
        xmlDoc.loadXML(xmlStr);
        return xmlDoc;
    };
} else {
    throw new Error("No XML parser found");
}

Once you have a Document obtained via parseXml, you can use the usual DOM traversal methods/properties such as childNodes and getElementsByTagName() to get the nodes you want.

Example usage:

var xml = parseXml("<foo>Stuff</foo>");
alert(xml.documentElement.nodeName);

If you’re using jQuery, from version 1.5 you can use its built-in parseXML() method, which is functionally identical to the function above.

var xml = $.parseXML("<foo>Stuff</foo>");
alert(xml.documentElement.nodeName);

#78 Best answer 2 of XML parsing of a variable string in JavaScript(Score: 91)

Created: 2009-03-16 Last updated: 2017-08-18

Update: For a more correct answer see Tim Down’s answer.

Internet Explorer and, for example, Mozilla-based browsers expose different objects for XML parsing, so it’s wise to use a JavaScript framework like jQuery to handle the cross-browsers differences.

A really basic example is:

var xml = "<music><album>Beethoven</album></music>";

var result = $(xml).find("album").text();

Note: As pointed out in comments; jQuery does not really do any XML parsing whatsoever, it relies on the DOM innerHTML method and will parse it like it would any HTML so be careful when using HTML element names in your XML. But I think it works fairly good for simple XML ‘parsing’, but it’s probably not suggested for intensive or ‘dynamic’ XML parsing where you do not upfront what XML will come down and this tests if everything parses as expected.

See also original question in stackoverflow

#79: XPath to select Element by attribute value (Score: 208)

Created: 2013-01-09 Last updated: 2015-06-01

Tags: xml, xpath

I have following XML.

<?xml version="1.0" encoding="UTF-8"?>
<Employees>
	<Employee id="3">
        <age>40</age>
        <name>Tom</name>
        <gender>Male</gender>
        <role>Manager</role>
	</Employee>
	<Employee id="4">
        <age>25</age>
        <name>Meghna</name>
        <gender>Female</gender>
        <role>Manager</role>
	</Employee>
</Employees>

I want to select Employee element with id=“4”.

I am using below XPath expression which is not returning anything.

//Employee/[@id='4']/text()

I checked it at http://chris.photobooks.com/xml/default.htm and it says invalid xpath, not sure where is the issue.

#79 Best answer 1 of XPath to select Element by attribute value (Score: 301)

Created: 2013-01-09 Last updated: 2017-11-28

You need to remove the / before the [. Predicates (the parts in [ ]) shouldn’t have slashes immediately before them. Also, to select the Employee element itself, you should leave off the /text() at the end or otherwise you’d just be selecting the whitespace text values immediately under the Employee element.

//Employee[@id='4']

Edit: As Jens points out in the comments, // can be very slow because it searches the entire document for matching nodes. If the structure of the documents you’re working with is going to be consistent, you are probably best off using a full path, for example:

/Employees/Employee[@id='4']

#79 Best answer 2 of XPath to select Element by attribute value(Score: 15)

Created: 2019-02-07 Last updated: 2019-11-05

As a follow on, you could select “all nodes with a particular attribute” like this:

//*[@id='4']

See also original question in stackoverflow

#80: Best way to compare 2 XML documents in Java (Score: 205)

Created: 2008-09-26

Tags: java, xml, testing, parsing, comparison

I’m trying to write an automated test of an application that basically translates a custom message format into an XML message and sends it out the other end. I’ve got a good set of input/output message pairs so all I need to do is send the input messages in and listen for the XML message to come out the other end.

When it comes time to compare the actual output to the expected output I’m running into some problems. My first thought was just to do string comparisons on the expected and actual messages. This doens’t work very well because the example data we have isn’t always formatted consistently and there are often times different aliases used for the XML namespace (and sometimes namespaces aren’t used at all.)

I know I can parse both strings and then walk through each element and compare them myself and this wouldn’t be too difficult to do, but I get the feeling there’s a better way or a library I could leverage.

So, boiled down, the question is:

Given two Java Strings which both contain valid XML how would you go about determining if they are semantically equivalent? Bonus points if you have a way to determine what the differences are.

#80 Best answer 1 of Best way to compare 2 XML documents in Java (Score: 201)

Created: 2008-09-26 Last updated: 2020-02-20

Sounds like a job for XMLUnit

Example:

public class SomeTest extends XMLTestCase {
  @Test
  public void test() {
    String xml1 = ...
    String xml2 = ...

    XMLUnit.setIgnoreWhitespace(true); // ignore whitespace differences

    // can also compare xml Documents, InputSources, Readers, Diffs
    assertXMLEqual(xml1, xml2);  // assertXMLEquals comes from XMLTestCase
  }
}

#80 Best answer 2 of Best way to compare 2 XML documents in Java(Score: 36)

Created: 2010-11-18

The following will check if the documents are equal using standard JDK libraries.

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setCoalescing(true);
dbf.setIgnoringElementContentWhitespace(true);
dbf.setIgnoringComments(true);
DocumentBuilder db = dbf.newDocumentBuilder();

Document doc1 = db.parse(new File("file1.xml"));
doc1.normalizeDocument();

Document doc2 = db.parse(new File("file2.xml"));
doc2.normalizeDocument();

Assert.assertTrue(doc1.isEqualNode(doc2));

normalize() is there to make sure there are no cycles (there technically wouldn’t be any)

The above code will require the white spaces to be the same within the elements though, because it preserves and evaluates it. The standard XML parser that comes with Java does not allow you to set a feature to provide a canonical version or understand xml:space if that is going to be a problem then you may need a replacement XML parser such as xerces or use JDOM.

See also original question in stackoverflow


Notes:
  1. This page use API to get the relevant data from stackoverflow community.
  2. Content license on this page is CC BY-SA 3.0.
  3. score = up votes - down votes.