Výukový program XML

XML HOME Úvod do XML XML Jak používat XML strom Syntaxe XML Prvky XML Atributy XML Jmenné prostory XML Zobrazení XML XML HttpRequest XML Parser XML DOM XML XPath XML XSLT XML XQuery XML XLlink XML Validator XML DTD Schéma XML XML server Příklady XML XML kvíz XML certifikát

XML AJAX

Úvod do AJAX AJAX XMLHttp Požadavek AJAX Odpověď AJAX Soubor XML AJAX AJAX PHP AJAX ASP Databáze AJAX Aplikace AJAX Příklady AJAX

XML DOM

Úvod do DOM DOM uzly Přístup k DOM Informace o uzlu DOM Seznam uzlů DOM DOM Traversing Navigace DOM DOM získat hodnoty DOM změnit uzly DOM Remove Nodes DOM nahradit uzly DOM Vytvořte uzly DOM Přidat uzly Klonovací uzly DOM Příklady DOM

Výukový program XPath

Úvod do XPath Uzly XPath Syntaxe XPath osy XPath Operátoři XPath Příklady XPath

Kurz XSLT

Úvod do XSLT Jazyky XSL Transformace XSLT XSLT <šablona> XSLT <hodnota-of> XSLT <pro každého> XSLT <sort> XSLT <if> XSLT <vyberte> Použít XSLT XSLT u klienta XSLT na serveru XSLT Úprava XML Příklady XSLT

Výukový program XQuery

Úvod do XQuery Příklad XQuery XQuery FLWOR HTML XQuery Podmínky XQuery Syntaxe XQuery Přidat XQuery XQuery Select Funkce XQuery

XML DTD

Úvod do DTD Stavební bloky DTD DTD prvky Atributy DTD DTD Elements vs Attr DTD entity Příklady DTD

XSD schéma

Úvod do XSD XSD Jak na to XSD <schéma> XSD prvky XSD atributy Omezení XSD

XSD komplex

XSD prvky XSD Prázdné Pouze prvky XSD Pouze text XSD XSD smíšené XSD indikátory XSD <libovolné> XSD <jakýkoliAtribut> Náhrada XSD Příklad XSD

XSD data

XSD řetězec Datum XSD Číselné XSD XSD Různé XSD reference

Webové služby

Služby XML XML WSDL XML SOAP XML RDF XML RSS

Reference

Typy uzlů DOM Uzel DOM DOM NodeList DOM NamedNodeMap Dokument DOM Prvek DOM Atribut DOM Text DOM DOM CDATA Komentář DOM DOM XMLHttpRequest DOM Parser Prvky XSLT Funkce XSLT/XPath

XML DOM – objekt dokumentu


Objekt Document představuje celý dokument XML.


Objekt dokumentu XML

Objekt Document je kořenem stromu dokumentů XML a poskytuje nám primární přístup k datům dokumentu.

Protože uzly prvků, textové uzly, komentáře, instrukce pro zpracování atd. nemohou existovat mimo dokument, obsahuje objekt Document také metody k vytvoření těchto objektů. Objekty Node mají vlastnost ownerDocument, která je přidružuje k dokumentu, kde byly vytvořeny.

Vlastnosti objektu dokumentu

Property Description
childNodes Returns a NodeList of child nodes for the document
doctype Returns the Document Type Declaration associated with the document
documentElement Returns the root node of the document
documentURI Sets or returns the location of the document
domConfig Returns the configuration used when normalizeDocument() is invoked
firstChild Returns the first child node of the document
implementation Returns the DOMImplementation object that handles this document
inputEncoding Returns the encoding used for the document (when parsing)
lastChild Returns the last child node of the document
nodeName Returns the name of a node (depending on its type)
nodeType Returns the node type of a node
nodeValue Sets or returns the value of a node (depending on its type)
xmlEncoding Returns the XML encoding of the document
xmlStandalone Sets or returns whether the document is standalone
xmlVersion Sets or returns the XML version of the document

Metody objektu dokumentu

Method Description
adoptNode(sourcenode) Adopts a node from another document to this document, and returns the adopted node
createAttribute(name) Creates an attribute node with the specified name, and returns the new Attr object
createAttributeNS(uri,name) Creates an attribute node with the specified name and namespace, and returns the new Attr object
createCDATASection() Creates a CDATA section node
createComment() Creates a comment node
createDocumentFragment() Creates an empty DocumentFragment object, and returns it
createElement() Creates an element node
createElementNS() Creates an element node with a specified namespace
createEntityReference(name) Creates an EntityReference object, and returns it
createProcessingInstruction(target,data) Creates a ProcessingInstruction object, and returns it
createTextNode() Creates a text node
getElementById(id) Returns the element that has an ID attribute with the given value. If no such element exists, it returns null
getElementsByTagName() Returns a NodeList of all elements with a specified name
getElementsByTagNameNS() Returns a NodeList of all elements with a specified name and namespace
importNode(nodetoimport,deep) Imports a node from another document to this document. This method creates a new copy of the source node. If the deep parameter is set to true, it imports all children of the specified node. If set to false, it imports only the node itself. This method returns the imported node
normalizeDocument()  
renameNode() Renames an element or attribute node


Vlastnosti objektu DocumentType

Každý dokument má atribut DOCTYPE, jehož hodnota je buď null, nebo objekt DocumentType.

Objekt DocumentType poskytuje rozhraní pro entity definované pro dokument XML.

Property Description
name Returns the name of the DTD
publicId Returns the public identifier of the DTD
systemId Returns the system identifier of the external DTD

Metody objektu implementace dokumentu

Objekt DOMImplementation provádí operace, které jsou nezávislé na jakékoli konkrétní instanci modelu objektu dokumentu.

Method Description
createDocument(nsURI, name, doctype) Creates a new DOM Document object of the specified doctype
createDocumentType(name, pubId, systemId) Creates an empty DocumentType node
getFeature(feature, version) Returns an object which implements the APIs of the specified feature and version, if the is any
hasFeature(feature, version) Checks whether the DOM implementation implements a specific feature and version

Vlastnosti objektu ProcessingInstruction

Objekt ProcessingInstruction představuje instrukci zpracování.

Instrukce pro zpracování se používá jako způsob, jak zachovat informace specifické pro procesor v textu dokumentu XML.

Property Description
data Sets or returns the content of this processing instruction
target Returns the target of this processing instruction