You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gary L Peskin <ga...@firstech.com> on 2001/03/01 20:12:15 UTC

[Fwd: Xalan2 with Xerces1.3]

Joe, Scott, Xerces people --

HELP!!  Somsak has submitted the problem below.  I have investigated and
found out the cause.  The short answer, I think, is a confusion between
the null namespace and the "" namespace.  The DOM Level 2 Core document
states that these are two different namespaces:

"Note that because the DOM does no lexical checking, the empty string
will be treated as a real namespace URI in DOM Level 2 methods.
Applications must use the value null as the namespaceURI parameter for
methods if they wish to have no namespace."

The source of Somsak's immediate problem is that, when a schema is
defined on the input XML document, Xerces creates a node with a ""
namespace URI.  When no schema is defined on the input XML document,
Xerces creates a document with a null namespace URI.

The XML Namespace recommendation indicates the the "" namespace URI is
the same as the default namespace
(http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting):

"The default namespace can be set to the empty string. This has the same
effect, within the scope of the declaration, of there being no default
namespace. "

Xerces also uses a null namespace URI to indicate that there is no
default namespace.

As we parse and compile the XPath match pattern in

  <xsl:template match="Class">

we encode this a NodeTest with a null namespaceURI.  Several sections of
Xalan code test for and recognize a null namespaceURI as being the
default namespace.

Now, when we go to match the <Class> node in the input XML, our match
fails when schemas are used because we're matching our null namespaceURI
with the input DOM's namespaceURI of "".  This ends up invoking the
built-in template for <Class> which does an apply-template of the
children which adds a bunch of text strings into the result tree.  These
unparented text strings are what cause the DOM006 error.

If, on the other hand, schemas are not used, Xerces reports a null
namespaceURI in the input XML and our match works fine.

So, on the Xalan team, I guess we have a few options:
1.  Declare the Xerces-J support of schemas to have a bug and ask that
Xerces be corrected to always use a null namespace URI to indicate that
there is no default namespace.  Even if the Xerces people change this
behavior, is this correct?  Will we have problems with other XML
parsers?
2.  The reverse of the above and ask Xerces-J to always use an empty
string to indicate that there is no default namespace.  Same issues as
1.  Also will cause lot's of code changes in Xalan, I suspect.
3.  Have a new compare method for namespaces based on
NodeTest.subPartMatch which tests for either namespace being the empty
string and allowing that to compare equal to null.  This is probably the
most flexible but we will take a performance hit while attempting to
match template match patterns.  Since this is such a heavily used
section of the code, I'm hesitant to add additional path length but
there may be no way around it.

Thoughts?

Gary


-------- Original Message --------
Subject: Xalan2 with Xerces1.3
Date: Wed, 28 Feb 2001 16:39:36 -0500
From: "Somsak AsSawakulpaibool" <so...@comhill.com>
Reply-To: xalan-dev@xml.apache.org
To: xalan-dev@xml.apache.org, xerces-j-dev@xml.apache.org

Hi guys,

I'm testing Xalan2 (xalan-j 2.0.0) with Xerces 1.3.0
I tested the schema validation by modified the DOM2DOM sample's code and
create birds.xsd (see below codes).
It works fine with Xerces 1.2.3 (The one that comes with Xalan2), but I
got below error when I run program.

What did I do wrong?

A.Somsak


-- ERROR MESSAGE --

Exception in thread "main" javax.xml.transform.TransformerException:
DOM006 Hierarchy request error
...

-----------------------------------------------------------------------------

-- DOM2DOM.java --

// Imported TraX classes
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.dom.DOMResult;

// Imported java.io classes
import java.io.IOException;
import java.io.FileNotFoundException;

// Imported SAX classes
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

// Imported DOM classes
import org.w3c.dom.Document;
import org.w3c.dom.Node;

// Imported Serializer classes
import org.apache.xalan.serialize.Serializer;
import org.apache.xalan.serialize.SerializerFactory;

import org.apache.xalan.templates.OutputProperties;

// Imported JAVA API for XML Parsing classes
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

  /**
   * Show how to transform a DOM tree into another DOM tree.
   * This uses the javax.xml.parsers to parse an XML file into a
   * DOM, and create an output DOM.
   */
public class DOM2DOM
{
	public static void main(String[] args)
    throws TransformerException, TransformerConfigurationException,
FileNotFoundException,
           ParserConfigurationException, SAXException, IOException
  {
	  TransformerFactory tFactory = TransformerFactory.newInstance();

    if(tFactory.getFeature(DOMSource.FEATURE) &&
tFactory.getFeature(DOMResult.FEATURE))
    {
      // Process the stylesheet StreamSource and generate a Transformer.
      Transformer transformer = tFactory.newTransformer(new
StreamSource("birds.xsl"));

      //Instantiate a DocumentBuilderFactory.
      DocumentBuilderFactory dFactory =
DocumentBuilderFactory.newInstance();
      
/********* I added the following 2 lines *************/ 
      dFactory.setValidating(true);
      dFactory.setNamespaceAware(true);
/*****************************************************/ 

      //Use the DocumentBuilderFactory to create a DocumentBuilder.
      DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
      

      //Use the DocumentBuilder to parse the XML input.
      Document doc = dBuilder.parse("birds.xml");

      // Use the DOM Document to define a DOMSource object.
      DOMSource domSource = new DOMSource(doc);

      // Set the base URI for the DOMSource so any relative URIs it
contains can
      // be resolved.
      //domSource.setSystemId("birds.xml");

      // Create an empty DOMResult for the Result.
      DOMResult domResult = new DOMResult();

  	  // Perform the transformation, placing the output in the DOMResult.
      transformer.transform(domSource, domResult);

	    //Instantiate an XML serializer and use it to serialize the output
DOM to System.out
	    // using a default output format.
      Serializer serializer = SerializerFactory.getSerializer
                                  
(OutputProperties.getDefaultMethodProperties("xml"));
      serializer.setOutputStream(System.out);
      serializer.asDOMSerializer().serialize(domResult.getNode());
	}
    else
    {
      throw new org.xml.sax.SAXNotSupportedException("DOM node
processing not supported!");
    }
  }
}


-----------------------------------------------------------------------------

-- BIRDS.XSD --
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
elementFormDefault="qualified">
	<xsd:element name="Class">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="Order" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="Family">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="Species" maxOccurs="unbounded"/>
			</xsd:sequence>
			<xsd:attribute name="Name" type="xsd:string"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="Order">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="Family" maxOccurs="unbounded"/>
			</xsd:sequence>
			<xsd:attribute name="Name" type="xsd:string"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="Species">
		<xsd:complexType  mixed="true">
			<xsd:attribute name="Scientific_Name" type="xsd:string"/>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>

-----------------------------------------------------------------------------

-- BIRDS.XML --
<?xml version="1.0" encoding="UTF-8"?>
<Class xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="birds.xsd">
	<Order Name="TINAMIFORMES">
		<Family Name="TINAMIDAE">
			<Species Scientific_Name="Tinamus major"> Great Tinamou.</Species>
			<Species Scientific_Name="Nothocercus">Highland Tinamou.</Species>
			<Species Scientific_Name="Crypturellus soui">Little
Tinamou.</Species>
			<Species Scientific_Name="Crypturellus cinnamomeus">Thicket
Tinamou.</Species>
			<Species Scientific_Name="Crypturellus boucardi">Slaty-breasted
Tinamou.</Species>
			<Species Scientific_Name="Crypturellus kerriae">Choco
Tinamou.</Species>
		</Family>
	</Order>
	<Order Name="GAVIIFORMES">
		<Family Name="GAVIIDAE">
			<Species Scientific_Name="Gavia stellata">Red-throated
Loon.</Species>
			<Species Scientific_Name="Gavia arctica">Arctic Loon.</Species>
			<Species Scientific_Name="Gavia pacifica">Pacific Loon.</Species>
			<Species Scientific_Name="Gavia immer">Common Loon.</Species>
			<Species Scientific_Name="Gavia adamsii">Yellow-billed
Loon.</Species>
		</Family>
	</Order>
	<Order Name="PODICIPEDIFORMES">
		<Family Name="PODICIPEDIDAE">
			<Species Scientific_Name="Tachybaptus dominicus">Least
Grebe.</Species>
			<Species Scientific_Name="Podilymbus podiceps">Pied-billed
Grebe.</Species>
			<Species Scientific_Name="">Atitlan Grebe.</Species>
			<Species Scientific_Name="">Horned Grebe.</Species>
			<Species Scientific_Name="">Red-necked Grebe.</Species>
			<Species Scientific_Name="">Eared Grebe.</Species>
			<Species Scientific_Name="">Western Grebe.</Species>
			<Species Scientific_Name="">Clark's Grebe.</Species>
			<Species Scientific_Name=""/>
		</Family>
	</Order>
	<Order Name="PROCELLARIIFORMES">
		<Family Name="DIOMEDEIDAE">
			<Species Scientific_Name="Thalassarche chlororhynchos">Yellow-nosed
Albatross. (A)</Species>
			<Species Scientific_Name="Thalassarche cauta">Shy Albatross.
(A)</Species>
			<Species Scientific_Name="Thalassarche melanophris">Black-browed
Albatross. (A)</Species>
			<Species Scientific_Name="Phoebetria palpebrata">Light-mantled
Albatross. (A)</Species>
			<Species Scientific_Name="Diomedea exulans">Wandering Albatross.
(A)</Species>
			<Species Scientific_Name="Phoebastria immutabilis">Laysan
Albatross.</Species>
			<Species Scientific_Name="Phoebastria nigripes">Black-footed
Albatross.</Species>
			<Species Scientific_Name="Phoebastria albatrus">Short-tailed
Albatross. (N)</Species>
		</Family>
		<Family Name="PROCELLARIIDAE">
			<Species Scientific_Name="Fulmarus glacialis">Northern
Fulmar.</Species>
			<Species Scientific_Name="Pterodroma neglecta">Kermadec Petrel.
(A)</Species>
			<Species Scientific_Name="Pterodroma arminjoniana">Herald Petrel.
(A)</Species>
			<Species Scientific_Name="Pterodroma ultima">Murphy's Petrel.
(N)</Species>
			<Species Scientific_Name="Pterodroma inexpectata">Mottled Petrel.
(A)</Species>
			<Species Scientific_Name="Pterodroma cahow">Bermuda Petrel.</Species>
			<Species Scientific_Name="Pterodroma hasitata">Black-capped
Petrel.</Species>
			<Species Scientific_Name="Pterodroma externa">Juan Fernandez Petrel.
(N)</Species>
			<Species Scientific_Name="Pterodroma phaeopygia">Dark-rumped
Petrel.</Species>
			<Species Scientific_Name="Pterodroma cervicalis">White-necked Petrel.
(H)</Species>
			<Species Scientific_Name="Pterodroma hypoleuca">Bonin Petrel.
(H)</Species>
			<Species Scientific_Name="Pterodroma nigripennis">Black-winged
Petrel. (H, A)</Species>
			<Species Scientific_Name="Pterodroma cookii">Cook's Petrel.
(N)</Species>
			<Species Scientific_Name="Pterodroma longirostris">Stejneger's
Petrel. (A)</Species>
			<Species Scientific_Name="Bulweria bulwerii">Bulwer's Petrel.
(H)</Species>
			<Species Scientific_Name="Bulweria fallax">Jouanin's Petrel. (H,
A)</Species>
			<Species Scientific_Name="Procellaria parkinsoni">Parkinson's Petrel.
(N)</Species>
			<Species Scientific_Name="Calonectris leucomelas">Streaked
Shearwater. (A)</Species>
			<Species Scientific_Name="Calonectris diomedea">Cory's Shearwater.
(N)</Species>
			<Species Scientific_Name="Puffinus creatopus">Pink-footed Shearwater.
(N)</Species>
			<Species Scientific_Name="Puffinus carneipes">Flesh-footed
Shearwater. (N)</Species>
			<Species Scientific_Name="Puffinus gravis">Greater Shearwater.
(N)</Species>
			<Species Scientific_Name="Puffinus pacificus">Wedge-tailed
Shearwater.</Species>
			<Species Scientific_Name="Puffinus bulleri">Buller's Shearwater.
(N)</Species>
			<Species Scientific_Name="Puffinus griseus">Sooty Shearwater.
(N)</Species>
			<Species Scientific_Name="Puffinus tenuirostris">Short-tailed
Shearwater. (N)</Species>
			<Species Scientific_Name="Puffinus nativitatis">Christmas Shearwater.
(H)</Species>
			<Species Scientific_Name="Puffinus puffinus">Manx
Shearwater.</Species>
			<Species Scientific_Name="Puffinus auricularis">Townsend's
Shearwater.</Species>
			<Species Scientific_Name="Puffinus opisthomelas">Black-vented
Shearwater.</Species>
			<Species Scientific_Name="Puffinus lherminieri">Audubon's
Shearwater.</Species>
			<Species Scientific_Name="Puffinus assimilis">Little Shearwater.
(A)</Species>
		</Family>
		<Family Name="HYDROBATIDAE">
			<Species Scientific_Name="Oceanites oceanicus">Wilson's Storm-Petrel.
(N)</Species>
			<Species Scientific_Name="Pelagodroma marina">White-faced
Storm-Petrel. (A)</Species>
			<Species Scientific_Name="Hydrobates pelagicus">European
Storm-Petrel. (A)</Species>
			<Species Scientific_Name="Oceanodroma furcata">Fork-tailed
Storm-Petrel.</Species>
			<Species Scientific_Name="Oceanodroma leucorhoa">Leach's
Storm-Petrel.</Species>
			<Species Scientific_Name="Oceanodroma homochroa">Ashy
Storm-Petrel.</Species>
			<Species Scientific_Name="Oceanodroma castro">Band-rumped
Storm-Petrel. (N)</Species>
			<Species Scientific_Name="Oceanodroma tethys">Wedge-rumped
Storm-Petrel. (N)</Species>
			<Species Scientific_Name="Oceanodroma melania">Black
Storm-Petrel.</Species>
			<Species Scientific_Name="Oceanodroma macrodactyla">Guadalupe
Storm-Petrel.</Species>
			<Species Scientific_Name="Oceanodroma markhami">Markham's
Storm-Petrel. (A)</Species>
			<Species Scientific_Name="Oceanodroma tristrami">Tristram's
Storm-Petrel. (H)</Species>
			<Species Scientific_Name="Oceanodroma microsoma">Least
Storm-Petrel.</Species>
		</Family>
	</Order>
	<Order Name="PELECANIFORMES">
		<Family Name="PHAETHONTIDAE">
			<Species Scientific_Name="Phaethon lepturus">White-tailed
Tropicbird.</Species>
			<Species Scientific_Name="Phaethon aethereus">Red-billed
Tropicbird.</Species>
			<Species Scientific_Name="Phaethon rubricauda">Red-tailed
Tropicbird.</Species>
		</Family>
		<Family Name="SULIDAE">
			<Species Scientific_Name="Sula dactylatra">Masked Booby.</Species>
			<Species Scientific_Name="Sula nebouxii">Blue-footed Booby.</Species>
			<Species Scientific_Name="Sula variegata">Peruvian Booby.
(A)</Species>
			<Species Scientific_Name="Sula leucogaster">Brown Booby.</Species>
			<Species Scientific_Name="Sula sula">Red-footed Booby.</Species>
			<Species Scientific_Name="Morus bassanus">Northern Gannet.</Species>
		</Family>
		<Family Name="PELECANIDAE">
			<Species Scientific_Name="Pelecanus erythrorhynchos">American White
Pelican.</Species>
			<Species Scientific_Name="Pelecanus occidentalis">Brown
Pelican.</Species>
		</Family>
		<Family Name="PHALACROCORACIDAE">
			<Species Scientific_Name="Phalacrocorax penicillatus">Brandt's
Cormorant.</Species>
			<Species Scientific_Name="Phalacrocorax brasilianus">Neotropic
Cormorant.</Species>
			<Species Scientific_Name="Phalacrocorax auritus">Double-crested
Cormorant.</Species>
			<Species Scientific_Name="Phalacrocorax carbo">Great
Cormorant.</Species>
			<Species Scientific_Name="Phalacrocorax urile">Red-faced
Cormorant.</Species>
			<Species Scientific_Name="Phalacrocorax pelagicus">Pelagic
Cormorant.</Species>
		</Family>
		<Family Name="ANHINGIDAE">
			<Species Scientific_Name="Anhinga anhinga">Anhinga.</Species>
		</Family>
		<Family Name="FREGATIDAE">
			<Species Scientific_Name="Fregata magnificens">Magnificent
Frigatebird.</Species>
			<Species Scientific_Name="Fregata minor">Great Frigatebird.</Species>
			<Species Scientific_Name="Fregata ariel">Lesser Frigatebird.
(A)</Species>
		</Family>
	</Order>
</Class>

Re: [Fwd: Xalan2 with Xerces1.3]

Posted by Anoop Singh Saharan <an...@wipro.com>.
i also faced the same problem but in the end gave up removing the xmlns =""

regds
anoop singh
www.wipro.com


----- Original Message -----
From: "Ian Roberts" <ir...@decisionsoft.com>
To: "Xerces-J Development" <xe...@xml.apache.org>
Cc: "Xalan Development" <xa...@xml.apache.org>
Sent: Friday, March 02, 2001 2:56 PM
Subject: Re: [Fwd: Xalan2 with Xerces1.3]


> On Thu, 1 Mar 2001, Gary L Peskin wrote:
>
> > The XML Namespace recommendation indicates the the "" namespace URI is
> > the same as the default namespace
> > (http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting):
> >
> > "The default namespace can be set to the empty string. This has the same
> > effect, within the scope of the declaration, of there being no default
> > namespace. "
>
> I've had a similar problem in the past where, when validating against a
> schema such as:
>
> --------------
> <xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>             targetNamespace="http://somewhere.com" >
>
> <xsd:element name="elementOne" >
> <xsd:complexType >
> <xsd:any namespace="##local" />
> </xsd:complexType>
> </xsd:element>
>
> </xsd:schema>
> --------------
> (or the equivalent in CR syntax), xerces validates
>
> <sw:elementOne xmlns:sw="http://somewhere.com" >
> <elementTwo />
> </sw:elementOne>
>
> successfully, but
>
> <elementOne xmlns="http://somewhere.com" >
> <elementTwo xmlns="" />
> </elementOne>
>
> fails validation, though they are semantically the same.  Presumably this
> is related to the null != "" problem.  I have mentioned this before, but
> there were no replies.  I'd be happy to have a poke around in the code if
> someone can tell me where to start looking.
>
> Ian
>
> --
> Ian Roberts, Software Engineer        DecisionSoft Ltd.
> tel: +44-1865-203192                  http://www.decisionsoft.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>


Re: [Fwd: Xalan2 with Xerces1.3]

Posted by Anoop Singh Saharan <an...@wipro.com>.
i also faced the same problem but in the end gave up removing the xmlns =""

regds
anoop singh
www.wipro.com


----- Original Message -----
From: "Ian Roberts" <ir...@decisionsoft.com>
To: "Xerces-J Development" <xe...@xml.apache.org>
Cc: "Xalan Development" <xa...@xml.apache.org>
Sent: Friday, March 02, 2001 2:56 PM
Subject: Re: [Fwd: Xalan2 with Xerces1.3]


> On Thu, 1 Mar 2001, Gary L Peskin wrote:
>
> > The XML Namespace recommendation indicates the the "" namespace URI is
> > the same as the default namespace
> > (http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting):
> >
> > "The default namespace can be set to the empty string. This has the same
> > effect, within the scope of the declaration, of there being no default
> > namespace. "
>
> I've had a similar problem in the past where, when validating against a
> schema such as:
>
> --------------
> <xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>             targetNamespace="http://somewhere.com" >
>
> <xsd:element name="elementOne" >
> <xsd:complexType >
> <xsd:any namespace="##local" />
> </xsd:complexType>
> </xsd:element>
>
> </xsd:schema>
> --------------
> (or the equivalent in CR syntax), xerces validates
>
> <sw:elementOne xmlns:sw="http://somewhere.com" >
> <elementTwo />
> </sw:elementOne>
>
> successfully, but
>
> <elementOne xmlns="http://somewhere.com" >
> <elementTwo xmlns="" />
> </elementOne>
>
> fails validation, though they are semantically the same.  Presumably this
> is related to the null != "" problem.  I have mentioned this before, but
> there were no replies.  I'd be happy to have a poke around in the code if
> someone can tell me where to start looking.
>
> Ian
>
> --
> Ian Roberts, Software Engineer        DecisionSoft Ltd.
> tel: +44-1865-203192                  http://www.decisionsoft.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>


Re: [Fwd: Xalan2 with Xerces1.3]

Posted by Ian Roberts <ir...@decisionsoft.com>.
On Thu, 1 Mar 2001, Gary L Peskin wrote:

> The XML Namespace recommendation indicates the the "" namespace URI is
> the same as the default namespace
> (http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting):
> 
> "The default namespace can be set to the empty string. This has the same
> effect, within the scope of the declaration, of there being no default
> namespace. "

I've had a similar problem in the past where, when validating against a
schema such as:

--------------
<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema"
            targetNamespace="http://somewhere.com" >

<xsd:element name="elementOne" >
	<xsd:complexType >
		<xsd:any namespace="##local" />
	</xsd:complexType>
</xsd:element>

</xsd:schema>
--------------
(or the equivalent in CR syntax), xerces validates

<sw:elementOne xmlns:sw="http://somewhere.com" >
	<elementTwo />
</sw:elementOne>

successfully, but

<elementOne xmlns="http://somewhere.com" >
	<elementTwo xmlns="" />
</elementOne>

fails validation, though they are semantically the same.  Presumably this
is related to the null != "" problem.  I have mentioned this before, but
there were no replies.  I'd be happy to have a poke around in the code if
someone can tell me where to start looking.

Ian

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



Re: [Fwd: Xalan2 with Xerces1.3]

Posted by Ian Roberts <ir...@decisionsoft.com>.
On Thu, 1 Mar 2001, Gary L Peskin wrote:

> The XML Namespace recommendation indicates the the "" namespace URI is
> the same as the default namespace
> (http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting):
> 
> "The default namespace can be set to the empty string. This has the same
> effect, within the scope of the declaration, of there being no default
> namespace. "

I've had a similar problem in the past where, when validating against a
schema such as:

--------------
<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema"
            targetNamespace="http://somewhere.com" >

<xsd:element name="elementOne" >
	<xsd:complexType >
		<xsd:any namespace="##local" />
	</xsd:complexType>
</xsd:element>

</xsd:schema>
--------------
(or the equivalent in CR syntax), xerces validates

<sw:elementOne xmlns:sw="http://somewhere.com" >
	<elementTwo />
</sw:elementOne>

successfully, but

<elementOne xmlns="http://somewhere.com" >
	<elementTwo xmlns="" />
</elementOne>

fails validation, though they are semantically the same.  Presumably this
is related to the null != "" problem.  I have mentioned this before, but
there were no replies.  I'd be happy to have a poke around in the code if
someone can tell me where to start looking.

Ian

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