Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OpenXml Attribute Type ID

5 views
Skip to first unread message

NAC

unread,
Nov 4, 2005, 6:47:45 AM11/4/05
to
Hello

I want create an Attribute of type ID for an element.
Later a get this element with TDomDocument.GetElementById('String id'),
but for this i have to set the attribute to type ID.
How I do this???

procedure TForm1.Button1Click(Sender: TObject);
var
DomDocument : TDomDocument;
Element : TDomElement;
textNode : TDomText;
RootNode, TmpNode : TDomNode;
Attribute : TDomAttr;
begin

//Create Document
DomDocument := DomImplementation1.CreateDocument('Root', nil);

Element := DomDocument.createElement('Child');
Attribute := DomDocument.createAttribute('ID');
Element .setAttributeNode(Attribute);
Element .setAttribute('ID', '1');
{How set this attribute to Type ID, to later use
DomDocument.GetElementById('1') }


textNode := DomDocument.createTextNode('nuno');
Element .appendChild(TextNode);
DomDocument.documentElement.appendChild(NAluno);

(...)
end;

0 new messages