On Tue, 10 Apr 2001, Ren� Jensen wrote:

> Hi there.
> 
> I�m trying to build a DOM from scratch, using the classes supplied in the
> org.apache.xerces.dom package, but I didn't get very far.
> actually I only got to instantiating the DocumentImpl-class cause then i 
> wanted 
> to add attributes (namespacedefiniton etc.)
> 
> I thought I should use the AttrNSImpl-class but it only has protected 
> constructors. How do I get passed that...??

You need to use the createElementNS method of the Document object to
create your element nodes, and you can use Element.setAttributeNS to add
attributes to an element.  For example:

Element systemElement = doc.createElementNS("MyNameSpace", "vst:System");
doc.appendChild(systemElement);

etc.

Ian

-- 
Ian Roberts, Software Engineer        DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to