You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Racine, Michel" <mi...@hp.com> on 2002/09/12 04:36:40 UTC

Performance hit/exception when top level element has namespace

I saw the thread of the performance hit with Xalan on large XML packets, and it brought me to ask the following question.

I have an XML packet that has the top level element with some namespace declarations/schema. When I use transform on this guy, I see an exception in the debug output, and it takes nearly 2 seconds. If I remove the schema location, it takes 30 ms.

The XML packet is valid, it's been validated by the Xerces parser with a schema clean. But the transform has a hard time with it.

Included below is the top level element with the namespace declaration that's causing me the problem. Also, the same element, omitting the schema location, which then, doesn't cause the problem.

Problematic element:

<Envelope xmlns='http://www.hp.com/swapiv3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.hp.com/swapiv3 /hsvmafiles/schswapiv3.xsd'>

Working Element:

<Envelope xmlns='http://www.hp.com/swapiv3' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>

Problematic declaration in the element:

xsi:schemaLocation='http://www.hp.com/swapiv3 /hsvmafiles/schswapiv3.xsd'

*There is a space between http://www.hp.com/swapiv3 and /hsvmafiles/schswapiv3.xsd.

I am wondering why ? Any pointers would be great. I feel I am doing something wrong there but I am not sure why since the parser likes it.

Thanks.

Michel Racine
System Analyst
Hewlett-Packard


Re: Performance hit/exception when top level element has namespace

Posted by Joseph Kesselman <ke...@us.ibm.com>.
XSLT processes namespace-conformant XML files. The XML is not 
namespace-conformant. The name of a namespace must be a URI, and space is 
not a legal URI character.

Fix your file.

(Note that this complaint is probably a Xerces error message rather than a 
Xalan error message. I don't think we have an explicit check for this. But 
I'm glad Xerces does.)

______________________________________
Joe Kesselman  / IBM Research