Hi,

> <base xml="http://www.w3.org/XML/1998/namespace"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:noNamespaceSchemaLocation="C:/Test/syntax.xsd">
>   <foo1>
>     <foo3/>
>     <foo2/>
>   </foo1>
> </base>
> 
> 
> <xsd:element name="base">
>   <xsd:complexType >
>     <xsd:sequence >
>        <xsd:element name="foo1">
>            <xsd:complexType>
>              <xsd:sequence>
>                  <xsd:element name="foo2"/> 
>              </xsd:sequence>
>            </xsd:complexType>
>        </xsd:element>
>     </xsd:sequence>
>   </xsd:complexType>
> </xsd:element>
> 
> 
> Obviously, foo3 is invalid since it isn't even in the schema. In this 
> case it returns me a DOMText node. When I get the parent of that DOMText 
> node, it returns me a DOMElement that represents foo1, where I was 
> expecting it to return the DOMElement that represented foo3.

I think this comes down to semantics. The way I would view this is that 
the element that has an error it the first element that is invalid that is 
declared in the schema. 


> Is there a way to get the foo3 DOMElement when I get these errors for foo3?

You can do this but it would require a small amount of customisation. You 
would have to call a custom error method that did not access the 
current node from the parser, but used the one you passed in. This is not 
to bad as long as it was only a few errors you wanted different nodes 
reported for. Give us a shout if you need more info.


Gareth


-- 
Gareth Reakes, Head of Product Development  +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to