You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Robert Eberhardt <pr...@yahoo.de> on 2001/10/16 10:07:56 UTC

getElementByID

Hello,

I am trying to use the method getElementById, but I do
not know how to declare a Attribut of the Type ID in
xerces.
I know that the following code can not work, but I do
not know how it can work.

DOM_Attr attrib = _doc.createAttribute("ID");
attrib.setValue(idch);
Node.setAttributeNode(attrib);

 Thanks Robert Eberhardt

__________________________________________________________________

Es ist soweit: das Nokia Game beginnt. Sei bereit für das multimediale Abenteuer. Melde dich bis zum 3. November bei http://de.promotions.yahoo.com/info/nokiagame an!

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: getElementByID

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Robert Eberhardt" <pr...@yahoo.de> writes:

> I am trying to use the method getElementById, but I do not know how
> to declare a Attribut of the Type ID in xerces.  I know that the
> following code can not work, but I do not know how it can work.

In your DTD you have to declare the element, and in the attribute list
you have to define an attribute of type 'ID'.

  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE foo SYSTEM "foo.dtd" [
    <!ELEMENT foo EMPTY>
    <!ATTLIST bar id ID #REQUIRED>
  ]>
  
  <foo id="foo23"/>

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org