You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by "Gebhardt. Yves" <Y....@seeburger.de> on 2000/03/15 12:22:01 UTC

Problem with Revalidation of xml node

Hi,

I have a problem using the new xerces xml Parser ( Version 1_0_3 ).
Perhaps you could help me.

I used the following code :

	RevalidatingDOMParser parser = new RevalidatingDOMParser();
            
            parser.setFeature("http://xml.org/sax/features/validation",
true);
            
            parser.parse("newtest.xml");
	
	// create new element; element is not correct (DTD)            
            Node node = parser.getDocument().getDocumentElement();
            ElementImpl el = new
ElementImpl((DocumentImpl)parser.getDocument(), "blabla");
            node.appendChild(el);
            
	// validate the new xml tree for DTD
            node =
parser.validate(parser.getDocument().getDocumentElement());

The used xml-file :

<!DOCTYPE BizTalk SYSTEM "newtest.dtd">
<BODY>
  <FOO>
    dfsd
  </FOO>
</BODY>

The uses dtd-file :

<!ELEMENT BODY (FOO)>
<!ELEMENT FOO (#PCDATA)>

After adding the incorrect "blabla" - element, the validation must
return a non-null value, but the returned node is set to "null".

Using the old IBM Parser (Version 2_0_15) the validation works
correctly.

What I'm missing ?

Regards

Yves
> -- 
> SEEBURGER AG, Ruiter Str. 2, D-75015 Bretten, Germany
> Fon:+49(0)7252 9358-292 Fax:+49(0)7252 9358-288
> http://www.seeburger.de
> 
> 

Re: Problem with Revalidation of xml node

Posted by Andy Clark <an...@apache.org>.
RevalidatingDOMParser is currently broken and is *not* supported.
If you fix it, please mail us the diffs to apply.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org