Artikel Terbaru

DOM API

XML DOM API in Hindi


Introduction to XML DOM API
XML DOM API (Application Program Interface) XML documents को programatically manage (read, create, modify आदि ) करने के लिए प्रयोग किया जाता  है।

XML DOM API में programmers के लिए interfaces define किये गए है जो XML document में available information को represent करते है। इसके अलावा इन interfaces में properties और methods provide किये गए है।



इन properties और methods का प्रयोग करते हुए आप XML document से data को access और modify कर सकते है।



XML DOM API कई levels के रूप में available है। इस API का latest level XML DOM Level 2 है।



XML DOM API Interfaces

XML DOM API में available interfaces के बारे में निचे बताया जा रहा है।



DOMImplementation 

इस interface में कुछ ऐसी properties और methods provide किये गए है जो current DOM level में available features के बारे में जानकारी प्राप्त करने के लिए प्रयोग किये जाते है।



Node

जैसा की आपको पता है XML document के सभी elements nodes के रूप में present किये जाते है। Node interface DOM द्वारा create किये गए सभी node objects के लिए base object होता है।



NodeList 

यह interface nodes objects की sequence (list) को represent करता है। जब अलग अलग methods द्वारा किसी document की nodes access की जाती है तो इस type के रूप में return की जाती है।



DocumentType

यह interface document से related information को represent करता है। उदाहरण के लिए किसी document द्वारा declare की गयी notations और entities इस interface द्वारा represent की जाती है।



Document 

यह interface पुरे document को represent करता है। इस interface द्वारा document के elements, attributes, processing instructions और comments आदि represent किये जाते है। इस interface द्वारा वह सब information represent की जाती है जो किसी XML document को process करने के लिए प्रयोग की जाती है।



Element

इस interface द्वारा document hierarchy में available element nodes represent की जाती है।



Attr

यह interface elements के लिए define किये गए attributes को represent करता है।



Comment

यह interface XML document में define किये गए comments को represent करता है।



Text

यह interface elements द्वारा hold किये जाने वाले text data को represent करता है। इस document में text को handle करने के लिए properties और methods provide किये गए है।



ProcessingInstruction

इस interface द्वारा document में define किये गए processing instructions represent किये जाते है।



XML DOM API Properties

XML DOM API में available कुछ महत्वपूर्ण properties के बारे में निचे बताया जा रहा है। 


nodeName 

यह property किसी node का नाम access करने के लिए प्रयोग की जाती है। 

nodeValue 

यह property किसी node की value access करने के लिए प्रयोग की जाती है। 

parentNode 

यह property किसी node की parent node के बारे में information प्राप्त करने के लिए प्रयोग की जाती है। 

childNodes 

यह property किसी node की child nodes को access करने के लिए प्रयोग की जाती है। 

attributes 

यह property किसी node की attribute nodes को access करने के लिए प्रयोग की जाती है। 


XML DOM API Methods 

XML DOM API में available कुछ महत्वपूर्ण methods के बारे में निचे बताया जा रहा है। 

getElementsByTagName(name)

यह method specify किये गए नाम वाले सभी methods को return करता है। इस element को xmlDoc object के साथ call किया जाता है जो पुरे document को represent करता है। 

appendChild(node)

यह method जिस node के साथ call किया जाता है उसमे specify किये गए नाम वाली child node add कर देता है। 

removeChild(node)

Post a Comment

0 Comments