XML referens

DOM

<XML id="dso1" src="dta1.xml">

doc = dso1.XMLDocument;
rootElement = doc.documentElement;

doc.async = true | false // true standard. Om false hämtas dok synkront
doc.doctype //
doc.url //
doc.parseError.errorCode //
doc.schemas = XMLSchemaCascheObj // se exempel nedan
doc.getElementsByTagName("tagName") // "*" alla
dok.nodeFromID("id")

numChildNodes = rootElement.childNodes.length;
el = rootElement.childNodes(0);
el.ownerDocument; /* rotnod */ el.parentNode;/* förälder */
el.firstChild; el.lastChild;
el.nextSibling; el.previousSibling;

el.nodeName; el.nodeValue;
el.nodeType; /* numerisk kod */ el.nodeTypeString;
el.text; el.xml; el.text.length; el.text.subStringData(2,3);

el.childnodes.reset(); el.childnodes.nextNode(); el.childnodes.item(i);

n = el.attributes.length;
attr = el.attributes(i) eller attr = el.attributes.item(i);
attr.nodeName; attr.nodeValue; attr.dataType=="entity";

el.attributes.reset(); el.attributes.nextNode();

el.attributes.getNamedItem("attrName");
val = el.getAttribute("attr1");
nod = el.getAttributeNode("attr1");

XMLSchemacache = new ActiveXObject("Msxml2.XMLSchemaCache.4.0");
XMLSchemacache.add(XMLNamespaceName,"fil.xsd");
Dokument.schemas = XMLSchemaCache;
NodtypNodeNameNodeValue
Document#documentnull
Elementnamnnull
Text#textTexten
AttributeAttributnamnAttributvärde
Processing-Instructiont.ex xmlInnehåll i bearbetningsinstruktionen
Comment#commentKommentartexten
CDATASection#cdata-sectionCDATA innehåll
DocumentTypenamn rotelementetnull
EntityEntitetsnamnet t.ex. bildnull
NotationNotationsnamnet t.ex JPGnull
Tillbaka