November 13, 2007

Understanding XML Query Standards

Filed under: — admin @ 8:53 pm

On Jan. 23, 2007 the W3C granted Recommendation status to XQuery, the XML query language designed to do for Web services what SQL did for relational databases. XQuery allows you to work in one common model no matter what type of data you’re working with — relational, XML or object data. It’s used for queries that must represent results as XML, to query XML stored inside or outside the database, or to span relational and XML sources.

SQL/XML is another standard that uses declarative, portable queries to return XML by querying relational data. It’s an extension of SQL that is part of ANSI/ISO SQL 2003. SQL/XML enables SQL queries to create XML structures with a few XML constructor functions that can be used in the SELECT statement. For a SQL programmer, SQL/XML is easy to learn because it involves additions to the existing SQL language. SQL is a mature language with many tools and infrastructure in place — including Java Database Connectivity — to return results.

Much as SQL has done for relational data, XQuery serves as a unifying interface for access to XML data. XML can represent any kind of data (relational, XML or object) and XQuery makes it possible to bring together both structured and unstructured data sources and process them in a unified way. As such, XQuery offers the potential to speed development, simplify data handling in Web services applications, and serve as a critical tool for service-oriented architectures (SOAs).

Why Standards for XML and Databases?
Enterprise applications access and work with data from multiple, disparate sources. Traditionally, developers haven’t had a standard or easy way to integrate these data sources. For example, most Web applications have connections to databases and use XML to transfer data from the database to the Web applications and vice versa. Every major database vendor has proprietary extensions for using XML with relational databases, but most take completely different approaches and there is no interoperability.

On web pages, XML is useful because the structure of XML closely matches the structure of HTML. But most of the data for these Web pages comes from relational databases and needs to be converted for presentation to the user. For Web messages the format is often specified by a standards organization or a trade partner, and these formats are generally hierarchical.

These examples illustrate the need for developers to have a standard way to work with all data sources — including relational, XML, EDI and other legacy formats.

XQuery goes above and beyond SQL/XML as a query language for several reasons. Because the XQuery language is XML-centric, XQuery code is straightforward, flexible and produces any XML structure. With XQuery, there’s far less code to write and maintain for the resulting XML — providing a faster time to application deployment and lower maintenance costs. XQuery doesn’t care what the data source is — it can be any XML document, Web service, relational data and more — while SQL/XML is limited to querying only relational data. Ultimately, XQuery provides performance and scalability at an enterprise application level that SQL/XML simply can’t support.

Putting XQuery to Use

XQuery significantly simplifies data management and integration in heterogeneous environments and enables developers to build high-performance applications more quickly and efficiently. Traditionally, developers wrote a multi-step process to return data as XML by first querying the data and then writing additional transformation code using other technologies, such as XSLT. Using XQuery, the desired XML is simply returned by the query and requires no additional processing. XQuery was designed for data integration, as well as XML processing, and can easily do joins on data from different sources. For developers working in an enterprise environment comprised of multiple data sources and databases, having a single language that addresses these diverse data sources as XML lowers the costs of application development.

Developers can utilize the power and flexibility of XQuery in many development scenarios:

Data integration — for developers who need to process information from XML, relational and other data sources, XQuery can query them all, integrating information from multiple data sources in one XML query result.
Web services and SOA implementations — Web services depend heavily on XML processing and data integration-tasks for which XQuery was designed. Using XQuery simplifies these tasks dramatically for the programmer and delivers significant performance improvements.
Report generation — The format of the resulting XML is determined by the XQuery query. To return XML formatted differently, simply write another query. There’s no need for additional transformation code to change the format. For publishing and reporting applications, XQuery makes it easy to create any view of the data — the resulting XML can be published as HTML, PDF, PostScript and other formats.
Web publishing — XQuery can be used to quickly and easily create dynamically generated HTML-based Web sites using an XML approach, which works well with AJAX applications.
But not all XQuery implementations are created equal. While the XQuery standard was defined to be data-source independent, developers are limited to the data sources supported by their XQuery engine. Fortunately, there are well-supported, reliable commercial implementations of the XQuery standard that deliver the performance and scalability necessary for large-scale XML processing needs.

source: http://www.javareport.com/article.aspx?id=20530


November 17, 2007

What makes HTML Dynamic?

Filed under: — Liz @ 7:45 am

To continue answering questions about what’s Dynamic about HTML, Expert Jim Styles says: “Dynamic HTML is a collective term for a combination of new Hypertext Markup Language (HTML) tags and options, that will let you create Web pages more animated and more responsive to user interaction than previous versions of HTML. Much of dynamic HTML is specified in HTML 4.0. Simple examples of dynamic HTML pages would include (1) having the color of a text heading change when a user passes a mouse over it or (2) allowing a user to “drag and drop” an image to another place on a Web page. Dynamic HTML can allow Web documents to look and act like desktop applications or multimedia productions.

The features that constitute dynamic HTML are included in Netscape Communications’ latest Web browser, Navigator 4.0 (part of Netscape’s Communicator suite), and by Microsoft’s browser, Internet Explorer 4.0. While HTML 4.0 is supported by both Netscape and Microsoft browsers, some additional capabilities are supported by only one of the browsers. The biggest obstacle to the use of dynamic HTML is that, since many users are still using older browsers, a Web site must create two versions of each site and serve the pages appropriate to each user’s browser version.

Both Netscape and Microsoft support an object-oriented view of a Web page and its elements Cascading style sheets and the layering of content Programming that can address all or most page elements.”

Read the full article from Allexperts.


November 22, 2007

Line Wrap with CSS and the tag

Filed under: — Liz @ 7:10 pm

Amit Agarwal has a useful formatting trick to share: “The <pre> tag that defines preformatted text is the only tag in HTML that respects and preserves whitespaces like line-breaks, blanks, tabs and multiple spaces between words. Whatever is enclosed inside the pre element will be displayed as-it-is on the web browser.

The pre tag is therefore an excellent choice when you like to show a code snippet in your blog preserving the tabs and line breaks. Infact, most of the Adsense Javscript code snippets that you see on this blog are displayed using the PRE tag.

The only issue with pre tag in IE is that if the a particular line is too long, it could push the right sidebar (if you have any) to the bottom of the page. Firefox is immune to this but it will do extend the line into the sidebar without wrapping it.”

Read the full article at Digital Inspiration.


Adding Audio to a Website

Filed under: — Liz @ 7:10 pm

Say you’d like to record a personal voice greeting for your web visitors, or maybe you’d like to add a song to your home page, Peter Lupton has some information to share on the subject: “Wav is currently the most popular audio file format because it is the format defined and endorsed by Microsoft and used by Windows based computers. Today wav files are supported by most platforms and by Netscape and the Internet Explorer.

Wav files can have a range of sample rates and different sample types. Without going into the technical detail, PCM is the purest audio format, and offers much better sound quality than other compressed formats such as ADPCM or Real Audio. The downside is that file sizes are large. A high sample rate provides better quality audio but has a much larger file size. Similarly, 16 bit PCM gives less hiss but has a file size double that of 8 bit PCM. As a general rule, you will not viably be able to embed an autostart file which is longer than 10 seconds. To have longer recordings you will need to use Real Audio (see below).

For a reasonable quality short voice prompts we recommend 11.025kHz, 8 bit PCM Wav Files.

To record and edit a wav file download a sound editor.”

Read the full text at Audio Amigo. Links so audio editing software are available as well.


Adding Video to a Website

Filed under: — Liz @ 7:12 pm

There are important things to consider when you want to stream videos to your web site: “Before you add any video to your web page, it’s important to understand that videos can take up a lot of web page space (file size) and bandwidth. Every time someone clicks to view the video they will be taking up some of your allocated bandwidth.

Be sure to check with your web host if you’re not sure how much you are provided. If you’re paying a monthly fee for web hosting, you could exceed your limits and be charged an extra fee if enough people view your video file.

Uploading the Video

First you must upload/save your video to your web server. You may want to create a folder called “video” and save it there. So the path to your video will be something like http://yoursite.com/video/movie.avi.
Embedding the Video

One thing you should keep in mind is that every web browser treats videos differently. What may work in one browser, may not work in another. So you should use both old and new HTML embed tags. (<object> and <embed>).”

Read the full article from 2 Create a Website. See the examples and pay special attention to the tips.


Making PHP/CGI appear as HTML

Filed under: — Liz @ 7:12 pm

“Once in a way, I get the occasional query from visitors to thesitewizard.com asking how they can hide their CGI or PHP scripts so that while the visitor thinks he/she is receiving a page like http://example.com/pagename.html, he/she is actually getting the output of your script at http://example.com/scriptname.cgi. The URL that is displayed in the visitor’s browser remains “pagename.html”, but the web server actually executes “scriptname.cgi”. There are a few ways in which this can be accomplished without the visitor knowing any different. This article will show you a couple of methods, depending on what you’re trying to accomplish.

System Requirements

For the methods listed below to work, the following are required:

1. Your site must be hosted on an Apache Web Server.
2. The server must be configured to allow .htaccess overrides.
3. For the first method listed below to work, the Apache module mod_rewrite must be installed.

A. Masking Individual Dynamic Pages as Static Pages

Steps to Changing the File Type Without Changing the Extension

This section deals with one way to make certain dynamically generated pages appear as static HTML pages. To mask, say, http://example.com/scripts/scriptname.php as http://example.com/scripts/pagename.html, take the following steps:

1. Use an ASCII text editor and type in the following lines:
RewriteEngine on
RewriteBase /scripts/
RewriteRule ^pagename\.html$ scriptname.php [T=application/x-httpd-php]”

Read the full article Thesitewizard.com to see the rest of the instructions.


Using SQLXML and .Net for data integration

Filed under: — Liz @ 7:13 pm

“The SqlClient data provider supports ExecuteXmlReader, a provider-specific method on the SqlCommand class. Rather than provide a SqlDataReader to process the result of a SQL query, ExecuteXmlReader produces an XmlReader, which can be used to directly consume the results of a SELECT … FOR XML query. The XmlReader might be used directly—for example, to serialize the resulting document to a Stream for transmission to a BizTalk server. The document could be serialized to disk by using an XmlTextReader. It could be read directly into the DataSet by using the DataSet’s ReadXml method. Listing 7–39 shows an example. The interesting point of ExecuteXmlReader is that, if you use a FOR XML query that produces nested hierarchies of XML output (AUTO or EXPLICIT mode), it takes only a single SELECT statement to produce multiple Data-Tables with the appropriate DataRelations in the DataSet.
Listing 7–39 Using SQLXML through ExecuteXmlReader

SqlConnection conn = new SqlConnection(
“server=.;uid=sa;database=pubs”);
SqlCommand cmd = new SqlCommand(
“select * from authors for xml auto, xmldata”,
conn);
conn.Open();

XmlTextReader rdr;
rdr = (XmlTextReader)cmd.ExecuteXmlReader();

DataSet ds = new DataSet();
ds.ReadXml(rdr,
XmlReadMode.Fragment);

When using ExecuteXmlReader to obtain an XmlReader followed by DataSet.ReadXml to populate a DataSet, you must take certain precautions because the XML produced by SQL Server does not contain a root element. To obtain all the XML nodes, you must use XmlReadMode.XmlFragment, a special XmlReadMode. In addition, you must either prepopulate the DataSet’s schema with information that matches the incoming fragment or use the XMLDATA keyword in your SQL statement to prepend an XDR schema to your fragment.”

Read the full article from InformIT.


Efficient CSS Shorthand

Filed under: — Liz @ 7:13 pm

Roger Johansson has been working with Web Standards long enough to fully understand the importances of coding efficiency. He shares some of his tips: “Shorthand properties can be used to set several properties at once, in a single declaration, instead of using a separate declaration for each individual property. As you’ll see, this can save a lot of space in your CSS file.

Quite a few shorthand properties are available – for details I suggest the W3C CSS specifications of the background, border, border-color, border-style, border sides (border-top, border-right, border-bottom, border-left), border-width, font, list-style, margin, outline, and padding properties.
Colours

The most common way of specifying a colour in CSS is to use hexadecimal notation: an octothorpe (#) followed by six digits. You can also use keywords and RBG notation, but I always use hexadecimal. One great shortcut that many don’t know about is that when a colour consists of three pairs of hexadecimal digits, you can omit one digit from each pair:

#000000 becomes #000, #336699 becomes #369.
Box dimensions

The properties that affect box dimensions share the same syntax: the shorthand property followed by one to four space separated values:

* property:value1;
* property:value1 value2;
* property:value1 value2 value3;
* property:value1 value2 value3 value4;

Which sides of the box the values affect depends on how many values you specify. Here’s how it works:

* One value: all sides
* Two values: top and bottom, right and left
* Three values: top, right and left, bottom
* Four values: top, right, bottom, left”

Read the full article at 456 Berea St and prepare to be informed.


Dynamically Changing Backgrounds

Filed under: — Liz @ 7:14 pm

Changing backgrounds with CSS isn’t too difficult to do, but browser compatibility is an issue. “To get started, let’s look at the way to do this in Internet Explorer. Basically, we just need to have a table and define a style sheet for the cell we want to change. Then we can change it using some properties that allow us access to the CSS attributes of the cell:

<TABLE width=”200″ border=”1″ cellspacing=”0″ cellpadding=”0″>
<TR>
<TD style=”width:100%; background-color:lightblue”
onMouseover=”this.style.backgroundColor=’yellow’;”
onMouseout=”this.style.backgroundColor=’lightblue’;”>
Watch me get scared!
</TD>
</TR>
</TABLE>

Internet Explorer makes this easy by allowing the style attribute to work in a <TD> tag, as well as allowing the tag to use the onMouseover and onMouseout event handlers. Let’s take a look at the what we added to the <TD> tag:

style=”width:100%; background-color:lightblue”

This is the style we will use for the cell. We used the width of 100% to make sure the style included the entire width of the cell. The background color is set to light blue here.

onMouseover=”this.style.backgroundColor=’yellow’;”

This is where the color of the cell is changed. We access the properties of the cell by using “this”, meaning “this object”. We then use the “style” to access the style sheet for that object. Now, we use a trick in Internet Explorer that allows us access to the specific style sheet property we are after.

In IE, you can take the name of a style property (in our case, background-color) and remove the dash. Then capitalize the letter that came after the dash. which here gives us:

backgroundColor

You can do this for just about any CSS property in IE, we may cover that in more detail in a separate section soon. After we have this, we just give the property a new color, and we chose yellow.

onMouseout=”this.style.backgroundColor=’lightblue’;”

This works just like the onMouseover event, but it changes the color back to light blue.”

Read the full article from Page Resource. Information for Netscape and multiple cells are also included in this informational article.


Introduction to DHTML

Filed under: — Liz @ 7:17 pm

There’s a lot of questions about what exactly makes HTML become Dynamic. To answer some of your DHTML questions, read the following: “Dynamic HTML, or DHTML, is not something that can easily be pointed out, or separated from other technologies. It is a group of technologies, when brought together, enable a Web developer to bring a Web page to life.

The three main technologies that make up DHTML are HTML, JavaScript and Cascading Style Sheets (CSS). HTML is used for the basic structure of the document, JavaScript to manipulate the Document Object Model (DOM), and CSS to define the presentation and style of the document.

Before version 4 browsers, it could be argued that we already had some form of DHTML with image swapping in NN3. MSIE3 supported the first version of JavaScript (i.e., JavaScript first appeared in NN2), so neither of these two browsers had support for the JavaScript Image object.

This isn’t to say that these two browsers couldn’t display images — they could, but those images couldn’t be manipulated. To enable images to be manipulated required two basic changes to the browsers — a change to the DOM to add an Image object to the document structure, and the inclusion of this object within the JavaScript language.

However, the last part is not entirely true. Once an object is available in the document or window, no extra JavaScript code is required to support it. As long as the object has its own methods and properties, it can be used, manipulated, and examined using the existing JavaScript functionality.”

Read the full article from Internet Related Technologies.


« Previous PageNext Page »

 
Indelv.com is for sale!
 
ERP systemen
Alle ERP-systemen op een rij, compleet met ERP-nieuws en ERP-software informatie.
www.ERPcentraal.nl
ERP systemen
Alle ERP-systemen op een rij.
www.erpmatrix.nl


Quick Links
Our Friends
Cool Places
Visit also
About Us