Posts Tagged ‘XML’

How To Create An XML Document In C#

Sunday, March 29th, 2009

It is very easy, as there I wondered, here is the code:

?View Code CSHARP
using System.Xml.Linq
protected void CreateDocumentXML ()
{
XDocument TheCodersXML = new XDocument(
new XDeclaration("1.0","utf-8","yes")
new XComment("List of Students")
new XElement("Students"
new XElement("Student"
new XAttribute("Id","No:123")
new XElement("Name","Diana Wallwalker")
new XElement("Age","23")),
 
new XElement("Student"
new XAttribute("Id","No:456")
new XElement("Name","Danny Thomas")
new XElement("Age","27")),
 
new XElement("Student"
new XAttribute("Id","No:789")
new XElement("Name","Roger Benny")
new XElement("Age","20")),
 
new XElement("Student"
new XAttribute("Id","No:012")
new XElement("Name","Venu Thomas"),
new XElement("Age","26"))
)
);
}

In the end it saved in the address you want:

?View Code CSHARP
TheCodersXML.Save(@"c:\TheCodersXML.xml");

 

 Output:

<?xml version="1.0″ encoding="utf-8″ standalone="yes"?>
<!-- List of Students -->
<students>
	<student Id="No:123">
		<name>Diana Wallwalker</name>
		<age>23</age>
	</student>
	<student Id="No:456">
		<name>Danny Thomas</name>
		<age>27</age>
	</student>
	<student Id="No:789">
		<name>Roger Benny</name>
		<age>20</age>
	</student>
	<student Id="No:012">
		<name>Venu Thomas</name>
		<age>26</age>
	</student>
</students>

Intro to ASP.NET Maker, PHPMaker, ASPMaker, JSPMaker, XML/XSLT Maker & CFMMaker.

Monday, March 9th, 2009

ASP.NET Maker : Generate the asymmetric multiprocessing system. Net 2. 0 writes the script from the database

ASP.NET Maker is a powerful yet easy-to-use ASP.NET code generator for ASP.NET 2.0. It can create a full set of ASP.NET 2.0 pages quickly from Microsoft Access, Microsoft SQL Server, MySQL, Oracle and other ODBC data sources. You can instantly create Web sites that allow users to view, edit, search, add and delete records on the Web.
ASP.NET Maker offers numerous useful features, including 3-Tier Architecture, ASP.NET AJAX, Extended Quick Search, Drill-down Master/Detail, Advanced Security, User Registration System, Custom View, Report, Export, File.

Better Quality Video Tutorial: Click Here

Read More..

PHPMaker: Generate PHP from MySQL

PHPMaker is the powerful automation equipment which can generate all matching of PHP directly from the database of MySQL, (because of Windows). Using PHPMaker, in order to compile because the user searches at once, in order to add, it makes that you see, possible, deleting the record of the net data type everything of MySQL, including BLOB, ENUM and set can draw up the web sight which it supports.

Read More..

ASPMaker: Generate the asymmetric multiprocessing system from the database.

ASPMaker the asymmetric multiprocessing system (the be active server page) is the powerful automation equipment which can generate all matching directly from the database of the Microsoft access or data source which supports the noise. Using ASPMaker, at once the user looks at the record of the net, compiles, searches, adds, can draw up the web sight which makes that it deletes possible.

Read More..

JSPMaker: JSP is generated directly from MySQL or Oracle.

JSPMaker however JSP (the page of JavaServer) being powerful draws up all matching directly from MySQL or Oracle, is the cord/code generator which it is easy to use.

Read More..

XML/XSLT Maker: The lattice of DHTML and dynamic XML/XSLT draw up the web sight which it has made be based

As for XMLMaker the lattice of DHTML for the general user and dynamic XML/XSLT for the developer of time it is the cord/code generator which cannot draw up the web sight which it has made be based. The lattice of DHTML is the WEB based lattice part which is based on conduct and XML/XSLT of DHTML, but that the lattice is used, knowledges of XML/XSLT/DHTML is not required.

Read More..

CFMMaker: Generate the template of CFM from the database.

CFMMaker however CFM (the template of ColdFusion) being powerful draws up all matching directly from your data source, is the cord/code generator which it is easy to use. The database which is supported makes a noise and or connection characteristic Microsoft of ODBC access, the Microsoft SQL server, includes Oracle or the database.

Read More..

Ajax Based Search Engine With PHP and XML

Sunday, February 15th, 2009

Here Sample code of Ajax based search engine with PHP and XML

live_preview Live Preview          downloadDownload Code

 

This is the Javascript Code :

?View Code JAVASCRIPT
/* &lt;--------------------------&gt; */
/* XMLHTTPRequest Enable		*/
/* &lt;--------------------------&gt; */
function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}
 
var http = createObject();
 
/* &lt;--------------------------&gt; */
/* 		SEARCH				   */
/* &lt;--------------------------&gt; */
 
function fnSearchName() {
 
txtInput=encodeURI(document.getElementById('txtInput').value);
 
document.getElementById('divmsg').style.display = "block";
document.getElementById('divmsg').innerHTML = "Searching for <strong>" + txtInput+"</strong>";
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'php_Search.php?name='+txtInput+'&amp;nocache = '+nocache);
 
http.onreadystatechange = fnSearchNameReply;
http.send(null);
}
function fnSearchNameReply() {
 
	var response = http.responseText;
	document.getElementById('divResult').innerHTML=response;
 
}

This is the PHP Code :

load("NameList.xml");
$x=$xmlDoc-&gt;getElementsByTagName('NAME');
for ($i=0; $i&lt;=$x-&gt;length-1; $i++)
{
//Process only element nodes
if ($x-&gt;item($i)-&gt;nodeType==1)
  {
  if ($x-&gt;item($i)-&gt;childNodes-&gt;item(0)-&gt;nodeValue == $q)
    {
    $y=($x-&gt;item($i)-&gt;parentNode);
    }
  }
}
$cd=($y-&gt;childNodes);
for ($i=0;$i&lt;$cd-&gt;length;$i++)
{
//Process only element nodes
if ($cd-&gt;item($i)-&gt;nodeType==1)
  {
  echo($cd-&gt;item($i)-&gt;nodeName);
  echo(": ");
  echo($cd-&gt;item($i)-&gt;childNodes-&gt;item(0)-&gt;nodeValue);
  echo("");
  }
}
 
?&gt;