Citat [EMAIL PROTECTED]:
> Are there any tutorials/documentation/samples/FAQs for generating DOMs
> that
> use namespaces with xerces-j, or does all that exist reside in the API
> docs?
>
> I'm new to this list, so my appologies if this has been gone over
> before.
>
> Thanks
>
> Tim
Hi Tim
This has been answered before, but I think the archives is down, so here is the
answer I got when asking basicly the same ;o)
-------------------------------------------------------------------
Hello Ren�,
try this:
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbFactory.newDocumentBuilder();
Document document = db.newDocument();
Element root = document.createElementNS("MyNameSapce",
"System");
root.setPrefix("vst");
root.setAttribute ("xmlns:vst", "MyNameSpace");
...
document.appendChild (root);
Element error = document.createElementNS("MyNameSpace",
"error");
error.setPrefix("vst");
root.appendChild(error);
Birgit mailto:[EMAIL PROTECTED]
Tuesday, April 10, 2001, 3:56:57 PM, you 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...??
>
> What I need is a DOM that I can serialize to this xml-document..
>
> <?xml version="1.0" encoding="UTF-8"?>
> <vst:System
> xmlns:vst='MyNameSpace'
> xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
> xsi:schemaLocation='MyNameSpace vSystemTree-Schema.xsd'>
> <error />
> </vst:System>
>
> Am I on a totally wrong track, or..??
> plz, I could really need a push in the right direction.
---------------------------------------------------------------------------
\\|//
(@ @)
-----oOOo-(_)-oOOo-----
Ren� Jensen
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]