1 / 9

PHP

PHP Xml short presentation.

Yell
Download Presentation

PHP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML WithTeacherSachin Zurange VISIONACADEMY(BCA,BBA(CA),BCS,MCA)

  2. WHATISXML? • XMLstandsforExtensibleMarkupLanguage • XMLisamarkuplanguagemuchlikeHTML • XMListext-basedmarkuplanguagethatenablesto storedata • instructureformatbyusingmeaningfultags. • XMLtagsarenotpredefined.Youmustdefineyour owntags • XMLisdesignedtobeself-descriptive • XMLisaW3C(WorldWideWebConsortium Recommendation

  3. FeatureofXML 1.XMLSeparatesDatafromHTMLifyouneedtodisplaydynamicdatainyourHTML document,itwilltakealotofworktoedittheHTMLeachtimethedatachanges.With XML,datacanbestoredinseparateXMLfiles. ThiswayyoucanconcentrateonusingHTML/CSSfordisplayandlayout,andbesure thatchangesintheunderlyingdatawillnotrequireanychangestotheHTML. WithafewlinesofJavaScriptcode,youcanreadanexternalXMLfileandupdatethe datacontentofyourwebpage. 2XMLSimplifiesDataSharingIntherealworld,computersystemsand atabasescontaindatainincompatibleformats.XMLdataisstoredinplain textformat.Thisprovidesasoftwareandhardware-independentwayof storingdata.Thismakesitmucheasiertocreatedatathatcanbeshared bydifferentapplications.

  4. XMLDOCUMENTSTRUCTUREORCOMPONENENTOFXML XMLDECLARATION XML declaration contains details that prepare an XML processor to parse the XML document. It is optional, but when used,itmustappearinthefirstlineofthe XML document. <?xml version = "version_number" encoding = "encoding_declaration"?> It defines the XML version (1.0) and the encodinginformationsuch asISO-8859- 1,UTF-8,UTF-16 e.g <?xmlversion="1.0"encoding="ISO- 8859-1"?> • DOCUMENT PROLOGSECTION • Document Prolog comes at the topofthedocument,beforethe root element. This section contains− • XMLdeclaration • Documenttypedeclaration

  5. DocumentElementsSection • DOCUMENTELEMENTSARETHEBUILDINGBLOCKSOFXML.ELEMENTSCAN BEHAVEASCONTAINERSTOHOLDTEXT,ELEMENTS,ATTRIBUTESETC • <ELEMENT-NAMEATTRIBUTE1ATTRIBUTE2>....CONTENT</ELEMENT- NAME> • ELEMENT-NAMEISTHENAMEOFTHEELEMENT.THENAMEITSCASEIN THESTARTANDENDTAGSMUSTMATCH. • AMARKUPCONSTRUCTTHATBEGINSWITH<ANDENDSWITH>.TAGS COMEINTHREEWAYS • START-TAGS;FOREXAMPLE:<SECTION> • END-TAGS;FOREXAMPLE:</SECTION> • EMPTY-ELEMENTTAGS;FOREXAMPLE:<SECTION/> • ATTRIBUTE1,ATTRIBUTE2AREATTRIBUTESOFTHEELEMENTSEPARATED BYWHITESPACES.ANATTRIBUTEDEFINESAPROPERTYOFTHEELEMENT. IT ASSOCIATES A NAME WITH A VALUE, WHICH IS A STRING OF CHARACTERS.ANATTRIBUTEISWRITTENASNAME=”VALUE”

  6. XMLSYNTAXRULES 1 AllXMLElementsMust Have aClosingTag InHTML,someelementsdo not havetohaveaclosingtag: <p>Thisisaparagraph.InXML,itisillegaltoomit theclosingtag.Allelements musthaveaclosingtag:<p>Thisisaparagraph.</p> XMLTagsareCaseSensitive XMLtagsarecasesensitive.Thetag<Letter>isdifferentfrom the tag<letter>.Opening andclosing tagsmustbewrittenwiththesamecase:<Message>Thisisincorrect</message> <message>Thisiscorrect</message> XMLElementsMustbeProperlyNested In HTML,youmightseeimproperlynestedelements:<b><i>Thistextisboldanditalic</b></i> InXML,allelementsmustbeproperlynestedwithineachother:<b><i>Thistextisboldand italic</i></b XMLDocumentsMust Have aRootElement XMLdocumentsmustcontainoneelementthatis theparent of allotherelements.Thiselementiscalled the rootelement.<root> <child> <subchild>.....</subchild> </child> </root>

  7. XML2typeofreference EntityReferences: SomecharactershaveaspecialmeaninginXML.Ifyouplaceacharacterlike"<"insideanXML element,itwillgenerateanerrorbecause theparserinterpretsitas the start ofanewelement. CharacterReferences: AcharacterreferencegivesthenumberoftheparticularUnicode characteritstandsfor,ineitherdecimalorhexadecimal. Decimalcharacterreferenceslooklike&#hexadecimalcharacterreferences haveanextraxafterthe&#&#;,thatis,theylooklike&#

  8. APPLICATIONOFXML Webpublishing XMLallowsthedeveloperstosavethedataintoXMLfiles&useXSLT transformation API’StogeneratecontentintherequiredformatsuchasHTML,XHTML WebSearching ItcanuseXMLdata&thensearchthedatafromtheXMLfile&displayitto theuser DataTransfer ItcanuseXMLtosaveconfigurationorbusinessdataforourapplication CreatedOtherlanguages ManylanguagearecreatedusingXMLsuchasWML

  9. QUESTIONS? CLARIFICATIONS? EmailAddress sachin.zurange@gmail.com Pleasefeelfreetocontactme, TeacherSachinZurangethroughemailorphone. MobileNumber (9822506209/9823037693) ConsultationHours 4PMto6PM

More Related