Can you provide xml file. 

-----Original Message-----
From: rafiq ahmad (JIRA) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 02, 2006 11:25 AM
To: [EMAIL PROTECTED]
Subject: [jira] Created: (XMLBEANS-250) Validation fails on an xml whose
root node is unknown

Validation fails on an xml whose root node is unknown
-----------------------------------------------------

         Key: XMLBEANS-250
         URL: http://issues.apache.org/jira/browse/XMLBEANS-250
     Project: XMLBeans
        Type: Bug
  Components: Validator  
    Versions: Version 2    
    Reporter: rafiq ahmad
     Fix For: Version 2


I am trying to validate an xml file whose root node is unknown. So I am
using the following code to parse and validate but validation fails.

XMLObject xmlObject = XmlObject.Factory.parse(new FileReader(file));
boolean isValid = xmlObject.validate(); //isValid becomes false
eventhough file is valid

When I looked at closely, I notice xmlObject is not pointing to the root
document object (In my case ReturnDataDocument since ReturnData is the
root node  of xml) but pointing to XmlAnyTypeImpl. 

When I use the specific object , it works.
ReturnDataDocument xmlObject = ReturnDataDocument .Factory.parse(new
FileReader(file)); boolean isValid = xmlObject.validate(); //isValid is
true

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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




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

Reply via email to