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 Dirk Reinshagen_C <DR...@zaplet.com> on 2001/03/09 23:12:44 UTC
RE: problems with xpath and schema validation
I was just curious if anyone could confirm
this issue with the namespace being
set to "" when validation is turned on.
Here's the test case:
<?xml version="1.0"?>
<customer xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='customer.xsd'
>
<firstname>john</firstname>
</customer>
<?xml version="1.0"?>
<schema>
<element name="customer">
<complexType>
<sequence>
<element name="firstname" type="string" maxOccurs="1"
minOccurs="1"/>
<element name="lastname" type="string" maxOccurs="1"
minOccurs="0"/>
</sequence>
</complexType>
</element>
</schema>
I've tried with Xerces 1.2.3 and Xerces 1.3.0 both with the same result.
-----Original Message-----
From: Gary L Peskin [mailto:garyp@firstech.com]
Sent: Thursday, March 08, 2001 8:23 PM
To: xalan-dev@xml.apache.org
Subject: Re: problems with xpath and schema validation
Dirk Reinshagen_C wrote:
>
> This may be an FAQ or a known problem....
>
> I have a very simple XML document that I'm encountering an
> issue when evaluating an XPath expression when parser validation
> is turned on. I'm using Xalan 2.0 with Xerces 1.2.3 when
> executing the following XPath:
>
> child::firstname/text()
>
> I get null, but when I turn off parser validation it works as
> expected returning "john". Any ideas/suggestions?
>
I believe that this is the same problem that I reported over to the
Xerces-J list previously. With schema validation on, the DOM node
<firstname> is given a namespaceURI of the empty string (""). Xalan
expects a null namespaceURI indicating that there is no namespace for
<firstname>.
I've reported this over to the Xerces people but I haven't heard
anything back. Perhaps I'll resend the message over there and try to
get a response.
Gary
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org