You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Aleksandar Milanovic <am...@galdosinc.com> on 2003/01/23 23:59:07 UTC

problem with null namespace for local attributes in importNode (DOM level 2)

Hi,

I have a document created using another DOM-compliant parser, which I import
into a Xerces 2.2.1 document. The import fails on the first attribute,
because its namespace is null. This shouldn't be a problem though because
the original document was parsed with namespaces enabled and the attribute
in question is local.

I looked into checkDOMNSErr() code, and it seems that it fails because the
namespace is null. However, it is perfectly normal for local attributes to
have null namespace in DOM level 2 documents. The stack trace is below.

NAMESPACE_ERR: An attempt is made to create or change an object in a way
which is incorrect with regard to namespaces.
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
change an object in a way which is incorrect with regard to namespaces.
	at org.apache.xerces.dom.CoreDocumentImpl.checkDOMNSErr(Unknown Source)
	at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
	at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source)
	at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)

Any help would be appreciated.

thx
Alex


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


Re: How to suppress standard out error in Xalan

Posted by Joseph Kesselman <ke...@us.ibm.com>.
Xalan questions should be routed to the Xalan mailing list, 
xalan-j-users@xml.apache.org.

(As far as I know, most or all Xalan errors should already be going to 
System.err rather than System.out, so when you post there you might want 
to say which error is causing trouble.)

______________________________________
Joe Kesselman  / IBM Research


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


How to suppress standard out error in Xalan

Posted by Kumaravel <nk...@aalayance.com>.
Hi,
  I am using Xalan 1.4 C++ and Java. Whenever any error occurs in the
transformation, Xalan prints the error on console (std out). I donot want it
on console. How to suppress it?

Cheers
Kumaravel


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


RE: problem with null namespace for local attributes in importNode (DOM level 2)

Posted by Aleksandar Milanovic <am...@galdosinc.com>.
Hi,

Eventually I found an error in the method

AttrNSImpl.setName(String namespaceURI, String qname)

However, I am not sure if this has been fixed since 2.2.1. The error is that
the namespace string was interned, but then the original namespace string
used instead of the interned ones. This led to erros in subsequent string
comparisons using ==.

I've never submitted a bug fix before. Since this is really a small one, is
there somebody out there who'd be willing to do this for me? I'd provide the
fixed source file.

thx
Alex


> -----Original Message-----
> From: Aleksandar Milanovic [mailto:amilanovic@galdosinc.com]
> Sent: Thursday, January 23, 2003 3:10 PM
> To: xerces-j-user@xml.apache.org
> Subject: RE: problem with null namespace for local attributes in
> importNode (DOM level 2)
>
>
> False alarm. It seems that the namespace URI is null despite the existence
> of a prefix. Not sure why though. Will investigate :).
> Alex
>
> > -----Original Message-----
> > From: Aleksandar Milanovic [mailto:amilanovic@galdosinc.com]
> > Sent: Thursday, January 23, 2003 2:59 PM
> > To: Xerces-J-User
> > Subject: problem with null namespace for local attributes in importNode
> > (DOM level 2)
> >
> >
> > Hi,
> >
> > I have a document created using another DOM-compliant parser,
> > which I import
> > into a Xerces 2.2.1 document. The import fails on the first attribute,
> > because its namespace is null. This shouldn't be a problem
> though because
> > the original document was parsed with namespaces enabled and
> the attribute
> > in question is local.
> >
> > I looked into checkDOMNSErr() code, and it seems that it fails
> because the
> > namespace is null. However, it is perfectly normal for local
> attributes to
> > have null namespace in DOM level 2 documents. The stack trace is below.
> >
> > NAMESPACE_ERR: An attempt is made to create or change an object in a way
> > which is incorrect with regard to namespaces.
> > org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
> > change an object in a way which is incorrect with regard to namespaces.
> > 	at
> > org.apache.xerces.dom.CoreDocumentImpl.checkDOMNSErr(Unknown Source)
> > 	at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
> > 	at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source)
> > 	at
> > org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
> > 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
> > 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
> > 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
> >
> > Any help would be appreciated.
> >
> > thx
> > Alex
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>


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


RE: problem with null namespace for local attributes in importNode (DOM level 2)

Posted by Aleksandar Milanovic <am...@galdosinc.com>.
False alarm. It seems that the namespace URI is null despite the existence
of a prefix. Not sure why though. Will investigate :).
Alex

> -----Original Message-----
> From: Aleksandar Milanovic [mailto:amilanovic@galdosinc.com]
> Sent: Thursday, January 23, 2003 2:59 PM
> To: Xerces-J-User
> Subject: problem with null namespace for local attributes in importNode
> (DOM level 2)
>
>
> Hi,
>
> I have a document created using another DOM-compliant parser,
> which I import
> into a Xerces 2.2.1 document. The import fails on the first attribute,
> because its namespace is null. This shouldn't be a problem though because
> the original document was parsed with namespaces enabled and the attribute
> in question is local.
>
> I looked into checkDOMNSErr() code, and it seems that it fails because the
> namespace is null. However, it is perfectly normal for local attributes to
> have null namespace in DOM level 2 documents. The stack trace is below.
>
> NAMESPACE_ERR: An attempt is made to create or change an object in a way
> which is incorrect with regard to namespaces.
> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
> change an object in a way which is incorrect with regard to namespaces.
> 	at
> org.apache.xerces.dom.CoreDocumentImpl.checkDOMNSErr(Unknown Source)
> 	at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
> 	at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source)
> 	at
> org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
> 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
> 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
> 	at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
>
> Any help would be appreciated.
>
> thx
> Alex
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>


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