|
Help with validating a new instance: msg#00044text.xml.xmlbeans.user
I am having problems validating an new instance of a document. Has to be something I am missing. Can anyone help? // Set options for new instance XmlOptions opts = new XmlOptions(); opts = opts.setDocumentType ( CustomerDocument.type ); opts = opts.setDocumentSourceName("customer"); ArrayList errorList = new ArrayList(); opts = opts.setErrorListener(errorList); xmlRoot = XmlObject.Factory.newInstance( opts ); if (! xmlRoot.validate( opts )) { ... The error I get from validation is "Expected element customer at the end of the content" location = "<xml-fragment/> I have added the customer element before validating but then get errors that sub-elements are missing. I put this code before validation XmlCursor cursor = xmlRoot.newCursor(); cursor.toEndDoc(); QName q = new QName (null, "customer"); cursor.insertElement( q ); How far do I have to go before successful validation and how do I get rid of <xml-fragment>? Must be missing something... Thanks, -- Brian |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE : newDOMNode trouble: 00044, Stéphane Rault |
|---|---|
| Next by Date: | Re: Help with validating a new instance: 00044, Anila Kardhashi |
| Previous by Thread: | invalid type error?i: 00044, Mark Womack |
| Next by Thread: | Re: Help with validating a new instance: 00044, Anila Kardhashi |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |