+ Implementation of TDOMDocument.DocumentURI and TDOMAttr.IsID + tests.

git-svn-id: trunk@13291 -
This commit is contained in:
sergei 2009-06-18 21:34:07 +00:00
parent 69ac9cb44e
commit dbd2759da9
3 changed files with 18 additions and 3 deletions

View File

@ -431,6 +431,7 @@ type
FNodeLists: THashTable;
FMaxPoolSize: Integer;
FPools: PNodePool;
FDocumentURI: DOMString;
function GetDocumentElement: TDOMElement;
function GetDocType: TDOMDocumentType;
function GetNodeType: Integer; override;
@ -473,6 +474,8 @@ type
function CreateAttributeNS(const nsURI, QualifiedName: DOMString): TDOMAttr;
function GetElementsByTagNameNS(const nsURI, alocalName: DOMString): TDOMNodeList;
function GetElementById(const ElementID: DOMString): TDOMElement;
// DOM level 3:
property documentURI: DOMString read FDocumentURI write FDocumentURI;
// Extensions to DOM interface:
constructor Create;
destructor Destroy; override;
@ -542,6 +545,7 @@ type
function GetNodeValue: DOMString; override;
function GetNodeType: Integer; override;
function GetSpecified: Boolean;
function GetIsID: Boolean;
procedure SetNodeValue(const AValue: DOMString); override;
public
destructor Destroy; override;
@ -550,6 +554,7 @@ type
property Specified: Boolean read GetSpecified;
property Value: DOMString read GetNodeValue write SetNodeValue;
property OwnerElement: TDOMElement read FOwnerElement;
property IsID: Boolean read GetIsID;
// extensions
// TODO: this is to be replaced with DOM 3 TypeInfo
property DataType: TAttrDataType read FDataType write FDataType;
@ -2578,6 +2583,11 @@ begin
Result := nfSpecified in FFlags;
end;
function TDOMAttr.GetIsID: Boolean;
begin
Result := FDataType = dtID;
end;
// -------------------------------------------------------
// Element
// -------------------------------------------------------

View File

@ -1444,6 +1444,7 @@ end;
procedure TXMLReader.ProcessXML(ASource: TXMLCharSource);
begin
doc := TXMLDocument.Create;
doc.documentURI := ASource.SystemID; // TODO: to be changed to URI or BaseURI
FCursor := doc;
FState := rsProlog;
FNesting := 0;

View File

@ -195,7 +195,7 @@
<arg>namespaceURI</arg>
<arg>qualifiedName</arg>
</item>
<item id="createDocument">
<item id="createDocument" gc="yes">
<arg>namespaceURI</arg>
<arg>qualifiedName</arg>
<arg>doctype</arg>
@ -258,8 +258,10 @@
<item id="canSetParameter"/>
<item id="setParameter"/>
<item id="normalizeDocument"/>
-->
<item id="isId"/>
<item id="documentURI" type="prop"/>
<!--
// assertNotEquals
// assertLowerSeverity
@ -267,9 +269,11 @@
<item id="setUserData"/>
<item id="isEqualNode"/>
<item id="isSameNode"/>
-->
<item id="lookupNamespaceURI">
<arg>prefix</arg>
</item>
<!--
<item id="lookupPrefix"/>
<item id="isDefaultNamespace"/>
<item id="adoptNode"/>
@ -703,4 +707,4 @@
</api>
</test-data>
</test-data>