Section C and Pointers:
best site for C pointer introduction.
http://www.augustcouncil.com/~tgibson/tutorial/ptr.html
this site describes how the actual evolution of pointers from the need to reference the address of a particular variable.and changing the value of the variable using its address/pointer.
Data Integration :Basics
this tutorial gives the basics of Data Integration.
the foundation of data integration are laid by covering the following topics.
DTD :basics of DTD.
the foundation of data integration are laid by covering the following topics.
DTD :basics of DTD.
Posted by
Ameya
Data Integration Basics:DTD
DTD can be defined within the xml or independently.
a xml file has a document type declaration at the start which specifies the DTD which controls the structure of the xml.
<!DOCTYPE note SYSTEM "note.dtd">
note :root element of the xml
note.dtd is the DTD itself.If the DTD is available at http://www.abc123.com then
<!DOCTYPE note SYSTEM "http://www.abc123.com">
is the declaration the xml.
Building blocks of DTD and XML
Elements :are the primary blocks which can contain data or elements.
<html>
<head></head>
<body bgcolor="red"></body>
</html>
Attributes :associated with elements eg:bgcolor
PCDATA: text in the xml which can be parsed to get other elements.
CDATA : text in the xml which cannot be parsed.
Elements:
there are three types of elements depending on the content type
declaration 1:
<!ELEMENT element-name content-type>
element-name is the name of the element node
content-type can be
EMPTY to indicate the element is empty
ANY to indicate that the element can either be empty or contain other elements
(#PCDATA) indicates that the element would contain other elements and needs to be parsed.
the content-type can also be specified by sequence of the children and the number of occurance can be specified using regular expression notations such as + ,? and * . the children are separated by commas.
"|" is used for union.
Attribute definition
<!ATTLIST element-name attribute-name attribute-type default-value>
the attribute type takes the following values
CDATA indicates character values which need not be parsed.
ID there can be a single attribute in an element with the type as ID.It needs be unique for the all such elements.
IDREF it is analogous to foriegn reference in databases .the value it refers must refer to id of some other element.
(value1|value2) indicates that value of the attribute can be either value1 or value2.
there are other tags associated with the attribute .this inlcudes
#IMPLIED which indicates the attribute is optional
#REQUIRED makes the attribute mandatory
#FIXED "value1" indicates that the value is optional but if not given then the default value is provided.
Entity : this was designed to save space.it acts like the #define declaration in C.
Entities can be external where the entity is replaced by entire xml documents or other resource.
<!Entity ABC "this is the replaced text" >
replaces all occurance of ABC by "this is the replaced text"
References:
An Introduction to XML and Web Technologies by Moller and Schwartzbach.
http://www.w3schools.com/DTD/
back to home
a xml file has a document type declaration at the start which specifies the DTD which controls the structure of the xml.
<!DOCTYPE note SYSTEM "note.dtd">
note :root element of the xml
note.dtd is the DTD itself.If the DTD is available at http://www.abc123.com then
<!DOCTYPE note SYSTEM "http://www.abc123.com">
is the declaration the xml.
Building blocks of DTD and XML
Elements :are the primary blocks which can contain data or elements.
<html>
<head></head>
<body bgcolor="red"></body>
</html>
Attributes :associated with elements eg:bgcolor
PCDATA: text in the xml which can be parsed to get other elements.
CDATA : text in the xml which cannot be parsed.
Elements:
there are three types of elements depending on the content type
declaration 1:
<!ELEMENT element-name content-type>
element-name is the name of the element node
content-type can be
EMPTY to indicate the element is empty
ANY to indicate that the element can either be empty or contain other elements
(#PCDATA) indicates that the element would contain other elements and needs to be parsed.
the content-type can also be specified by sequence of the children and the number of occurance can be specified using regular expression notations such as + ,? and * . the children are separated by commas.
"|" is used for union.
Attribute definition
<!ATTLIST element-name attribute-name attribute-type default-value>
the attribute type takes the following values
CDATA indicates character values which need not be parsed.
ID there can be a single attribute in an element with the type as ID.It needs be unique for the all such elements.
IDREF it is analogous to foriegn reference in databases .the value it refers must refer to id of some other element.
(value1|value2) indicates that value of the attribute can be either value1 or value2.
there are other tags associated with the attribute .this inlcudes
#IMPLIED which indicates the attribute is optional
#REQUIRED makes the attribute mandatory
#FIXED "value1" indicates that the value is optional but if not given then the default value is provided.
Entity : this was designed to save space.it acts like the #define declaration in C.
Entities can be external where the entity is replaced by entire xml documents or other resource.
<!Entity ABC "this is the replaced text" >
replaces all occurance of ABC by "this is the replaced text"
References:
An Introduction to XML and Web Technologies by Moller and Schwartzbach.
http://www.w3schools.com/DTD/
back to home
Labels:
Data Integration Basic,
DTD
Posted by
Ameya
Step II -defining custom tags in taglib.tld
this tutorial gives an overview of all the defining a custom tag in a taglib and the general architecture of tags in javax.servlet.jsp.ext.* package.
Classification of tags.
tags can be classified depending on their characteristics into general categories
Tag:
the tag interface defines two functions
doStartTag
returns EVAL_BODY_INCLUDE to include the contents of the tag.
returns SKIP_BODY if the contents /processing of the tag is not to be carried out.
doEndTag
returns EVAL_JSP to include the contents of the jsp
returns SKIP_JSP to avoid the
defining a custom tag.
defining a custom tag.
Classification of tags.
tags can be classified depending on their characteristics into general categories
- Empty tags
- Iterative tags
- tags with JSP content
Tag:
the tag interface defines two functions
doStartTag
returns EVAL_BODY_INCLUDE to include the contents of the tag.
returns SKIP_BODY if the contents /processing of the tag is not to be carried out.
doEndTag
returns EVAL_JSP to include the contents of the jsp
returns SKIP_JSP to avoid the
defining a custom tag.
defining a custom tag.
Posted by
Ameya
Introduction to listeners [basic servlet container model part II]
There are specific customized tasks which need to carried out in different applications for actions taken by the container like creation of a request object,creation of a session,addition of a object to the sesssion.these tasks and many others can be carried out using listeners.
Depending on the container objects which they listen to the listeners can be boardly classified into three types:
context listener
request listener
response listener
Depending on the container objects which they listen to the listeners can be boardly classified into three types:
context listener
request listener
response listener
Posted by
Ameya
Step I:how the jsp engine finds the tag library definition [the .tld file]
Introduction:
/location
/WEB-INF/location
/location
tag library developement is supported due to two main reasons.
1.to remove the clutter on the presentation layer generated by use of scriplets.
2.follow the golden rule of reuse where the presentation layer logic can be reused over multiple screens.
There are two important goals which need to be considered for tag library.
1.how the jsp engine is going to find the definition of the custom tags
2.how to implemen the classes which would support the custom tags.
Issue I:custom tag discovery by jsp engine.
a mapping is usually used for a tag library.there are three methods of specifying the use of a TL
1.explicit mapping in the web.xml
2.implicit mapping in the tag library .tld file
3.implicit mapping where the container is aware of the tag library.
the three mappings are shown in the image:
EXPLICIT MAPPING
in case of explicit mapping in the web.xml there are two cases
CASE A:
if the location starts with a / it indicates to the jsp engine that the location of the tld file is
<taglib>
<taglib-uri>
<taglib-location>/abc/a.tld
</taglib>
location of the file:[doc_root]/abc/a.tld
CASE B:
if the location does not start with the / then it indicates that the location is under WEB-INF folder.
eg:
<taglib>
<taglib-uri>
<taglib-location>abc/a.tld
</taglib>
location of the file:[doc_root]/WEB-INF/abc/a.tld
actual translation of the tld:
the engine gets the location of the .tld file using the following logic
1.check if a mapping exists in the web.xml file for the uri
2.if a mapping exists
a.if the location is the root search the location from the root of the web application
b.if the location is relative [without the /location],then the location of the file is under the WEB-INF folder
3.if the mapping is not found then the uri is the location of the .tld file.
a.the location is not found and the jsp engine raises an error.
b.if the location is the root search the location from the root of the web application
c.if the location is not absolute then the location is relative to the jsp
if the jsp lies in the location [doc_root]/jsp/a.jsp and the uri is loc_doc/a.tld
then the location of the .tld file is [doc_root]/jsp/loc_doc/a.tld
Types of tags:
1.empty tags :the presence of the tags itself signify the data: <myTag:required/>
2.tags with attributes :<myTag:newTag name="A"/>
3.tags with JSP code :<myTag:fontTag>${name}</myTag:fontTag>
4.tags with nested tags :<myTag:outertag <myTag:innerTag/><myTag:outerTag>
Posted by
Ameya
Subscribe to:
Posts (Atom)