I wrote a web tool in Java EE, performing the following subtasks:
Solution:
First register your site in Google Search Console. Then create a sitemap and submit your site to search engines such as Google Webmaster tools. Sitemap help you to ensure that your pages are indexed by all search engines. You can also create a small tool (e.g. with Node.js) which creates XML sitemaps collecting all URLs on your site and adding automatically keywords and modification time for them. This is for creating and submitting sitemaps more frequently and ensuring that all your sites URLs are listed correctly so that google web crawler can faster index your site. This improves your site visibility in google search engine.
One of the useful tool for visualization of RDF data is WebVOWL - http://visualdataweb.de/webvowl/. It supports RDF data in XML as well as in Turtle (TTL) formats and allows complex visualization of data.
Notepad++ is a free source code editor and Notepad replacement that supports several formats. In its basic edition it can already do some nice things like:
If you download the XML Tools Plugin you can also pretty print XML documents without witespaces. Just select it from the plugins menu or use the keyboard shortcut "Ctrl"+"Alt"+"Shift"+"B". Check out also the other features provided with the plugin.
First of all we have to load the complet XML structures (root of XML Shema) in a variable.
Then wo do a search for the "font"
tag and "/font"
tag and replace it with an empty string.
public void resetfontsize()
{
// XPath to tho root of the XML Shema
string xml_data = this.MainDataSource.CreateNavigator().SelectSingleNode("/my:Befund",NamespaceManager).InnerXml;
// set the Index of the searcher = 1
int nextindex = 1;
//if the search index greater than 0 --> make the search
while (nextindex > 0)
{
//serach for open tag font
nextindex = xml_data.IndexOf(" 0)
{
//search for close tag
int nextklammer = xml_data.IndexOf(">", nextindex);
string replstring = xml_data.Substring(nextindex, nextklammer - nextindex + 1);
//replace the result with empty string
xml_data = xml_data.Replace(replstring, "");
}
}
xml_data = xml_data.Replace("", "");
this.MainDataSource.CreateNavigator().SelectSingleNode("/my:Befund", NamespaceManager).InnerXml = xml_data;
}
The challenge was to get a public transport route, by sending time, date, start and destination address. The problem was solved by using the "Wiener Linien API" (http://akirk.github.com/Wiener-Linien-API/). The PHP-Code sends a XML-request with all details of the appointment and get a XML-respond with the transport connection.
For building a request the PHP-function "buildRequest()" can be used.
The following example illustrates a query from "Seckendorfstrasse 4" to "Wiedner Hauptstr. 8":
$params = array();
$params["outputCoords"] = "WGS84";
$params["from"] = "Seckendorfstrasse 4";
$params["to"] = "Wiedner Hauptstr. 8";
$params["year"] = "2011";
$params["month"] = "12";
$params["day"] = "14";
$params["hour"] = "17";
$params["minute"] = "00";
$params["deparr"] = "arr";
$params["modality"] = "pt";
$params["sourceFrom"] = "gps";
$params["sourceTo"] = "stoplist";
$req = buildRequest("api_get_route", $params);
Afterwards, the XML-request must be sent to the following webservice: http://webservice.qando.at/2.0/webservice.ft.
$response = httpPost("http://webservice.qando.at/2.0/webservice.ft", $req);
Finally, the XML-response must be load into a Document Object Model (DOM). A DOM presents an XML document as a tree-structure, which makes it easy to interpret and evaluate the local public transport route.
$dom = new DOMDocument();
$dom->formatOutput = true;
$dom->preserveWhiteSpace = false;
$dom->loadXML($response);
The complete DOMDocument manual is available on the website: http://php.net/manual/de/class.domdocument.php.
To print out the XML-response of the public transport route, use the following PHP-code:
echo "Response: " .$dom->saveXML(). "";
To implement a custom Ribbon element we have to describe it using an XML file defined by the Microsoft CustomUI schema and load it using the Application.LoadCustomUI() procedure.
The root element of the XML file is customUI
. Inside of it there is the element ribbon
containing all the tabs, buttons etc.
A code snippet for loading of the xml file:
Dim f As Long
Dim strText As String
Dim strOut As String
f = FreeFile
Open "\customUI.xml" For Input As f
Do While Not EOF(f)
Line Input #f, strText
strOut = strOut & strText
Loop
Application.LoadCustomUI "AppRibbon_1", strOut
Sample XML file:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="Tab1" label="Tab1">
<group id="Group" label="Group">
<button id="MyButton1" label="Button1" imageMso="_1"
onAction="doSomeAction"/>
<button id="MyButton2" label="Button2" imageMso="_2"
onAction="doSomeAction2"/>
</group>
<group id="Group2" label="Group2">
<button id="MyButton3" label="Button3" imageMso="_1"
onAction="doSomeAction3"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
There are several tested solutions available on the Internet already: JAVASCRIPT Solution approach: It provides
Download Skript: http://www.thomasfrank.se/downloadableJS/xml2json.js Usage as documented on this site: <head><script type="text/javascript" src="xml2json.js"></script>...</head>Then it can be called in these different variants:
V1 ("compact") can be used for output without linebreaks or tabbing. V2 for normal output with linebreaks ant tabbing. V3 for HTML representation.JAVA solution approach (which is solution I have already tested and which is provided by Json.org): The Source files are available at http://json.org/java/ for many JSON issues in Java. The relevant class is called XML and is viewable at:
It provides
Naturally, the XML has to be well-formed and valid to produce a JSON object. The JSON objcect istself has to be valid again. It can be assumed that always correct outputs for valid inputs are retrieved according its high adoption in real world usage.
json can be seen as a light-weight alternative to XML.
http://www.json.org/index.html
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999.
It is just a very minimalistic generic serialization method of data-structures (objects, lists, or however you call it), so it can be used within (or between) virtually any language(s), but as it is a subset of JavaScript, it is especially suited for use in JavaScript applications and being much leaner (schlanker) than XML it is the interchange-format of choice for AJAX-applications,
which is the explicit main purpose of this format.