Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

XML Namespace handling?

843834Jul 18 2001 — edited Jul 25 2001
Hi,
I am having a typical problem here. Is there any way I can set a namespace to an XML string before I convert it into a Document. The problem is I have this XML string and I am trying to parse it, but I get a java.io.Nullpointer Exception because one of the tags in the XML string has a name space and I need to assign a name space to it here.

here's an example...

Following is my XML string say....

<metadata>
<schema>Schema 1</schema>
<schemaversion>DX:MD1.0 S:1.0</schemaversion>
<dlmd:record>Record</dlmd:record>
</metadata>

I need to parse this string, but I can not do it without setting a namespace for dlmd:record! Or is there a way I can do it without the namespace...I tried using the setNamespaceaware() option but it does not seem to work.

It's sort of strange as to why I need to assign a name space to it here...but thats the problem I have to deal with...

any help would be very much appreciated.

Thanks in advance
Prashanth
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 22 2001
Added on Jul 18 2001
14 comments
108 views