You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by chodnik <wx...@o2.pl> on 2009/07/15 19:59:31 UTC

Validating a DOM Element

Hi,
I have some code:
try {
			validator
					.validate(new DOMSource(document), new DOMResult(document));
		} catch (SAXException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		ElementPSVI elementPSVI = (ElementPSVI) element;
		XSElementDeclaration declaration = elementPSVI.getElementDeclaration();

It works fine but I've found on this forum that I can validate only a
selected element. I've tryed to change to:
validator
					.validate(new DOMSource(element), new DOMResult(element));
But this time the declaration variable is always null. I don't know why.
Should I set any parameters to have PSVI?
Thank for the reply.
-- 
View this message in context: http://www.nabble.com/Validating-a-DOM-Element-tp24502937p24502937.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: Validation a DOM Element

Posted by chodnik <wx...@o2.pl>.


Michael Glavassevich-3 wrote:
> 
> Can you open a JIRA issue with your test case?
> 

O.K. I did it. http://issues.apache.org/jira/browse/XERCESJ-1387
-- 
View this message in context: http://www.nabble.com/Validating-a-DOM-Element-tp24502937p24699183.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: Validation a DOM Element

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Sounds like this might be a bug. Can you open a JIRA issue [1] with your
test case?

Thanks.

[1] http://issues.apache.org/jira/browse/XERCESJ

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

chodnik <wx...@o2.pl> wrote on 07/15/2009 01:58:26 PM:

>
> Hi,
> I have some code:
> try {
>          validator
>                .validate(new DOMSource(document), new DOMResult
(document));
>       } catch (SAXException e) {
>          e.printStackTrace();
>       } catch (IOException e) {
>          e.printStackTrace();
>       }
>       ElementPSVI elementPSVI = (ElementPSVI) element;
>       XSElementDeclaration declaration =
elementPSVI.getElementDeclaration();
>
> It works fine but I've found on this forum that I can validate only a
> selected element. I've tryed to change to:
> validator
>                .validate(new DOMSource(element), new DOMResult(element));
> But this time the declaration variable is always null. I don't know why.
> Should I set any parameters to have PSVI?
> Thank for the reply.
> --
> View this message in context: http://www.nabble.com/Validation-a-
> DOM-Element-tp24502937p24502937.html
> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org