[ http://issues.apache.org/jira/browse/TUSCANY-696?page=comments#action_12433000 ] Scott Boag commented on TUSCANY-696: ------------------------------------
> do you know where is the p0: is from It's a manufactured prefix, 'cause the SDO lost the prefix info I think, which would be sortof OK (maybe not for some applications) if it put in a namespace binding for p0. I ran your code on company.xml and am still just getting: <p0:AnyTypeDataObject> (same as with my code). so my configuration must be off or different from yours. I downloaded the head yesterday, and am running in Eclipse, following the instructions at http://wiki.apache.org/ws/Tuscany/TuscanyJava/GetTuscany. Any ideas? > I got a java.lang.NullPointerException calling xsr.getEventType() in the > switch statement. I had to add the TEXT_STATE event to get past this: public int getEventType() { if (state == START_ELEMENT_STATE) { return START_ELEMENT; } else if (state == END_ELEMENT_STATE) { return END_ELEMENT; } else if (state == TEXT_STATE) { return CHARACTERS; } else { // this is the delegated state return childReader.getEventType(); } } > are you wanting to pursue using this xsd and xml or make some progress using > another schema and data ? I care not a nit about the particular xsd and xml, except if it fails on any valid XML it's a problem. I'm trying to work on a generic DataObject to XML data model adapter for XSLT, for use in BPEL. I first want to see how the XMLStreamHelper does when the source is XML, then I want to see what it does with non-XML sources. Then at some point, I have to investigate the other end, going from SAX events to SDO. If I can get started on what's going on, I may be able to help on some of the issues with XMLStreamHelper. Right now I want to make sure I don't have any configuration issues and I'm not doing anything stupid in regards to my test code. -scott > XMLStreamHelper usage > --------------------- > > Key: TUSCANY-696 > URL: http://issues.apache.org/jira/browse/TUSCANY-696 > Project: Tuscany > Issue Type: Bug > Components: Java SDO Implementation > Environment: Windows XP, java version "1.5.0_07" Java(TM) 2 Runtime > Environment, Standard Edition (build 1.5.0_07-b03) > Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing) > Reporter: Scott Boag > Attachments: robbieResults_1.txt, SimpleRun2.java, > XMLDocumentNoNamespaceSchemaLocation.xsd, XMLDocumentTestCase.xml > > > Not sure if this is a bug or user problem or both. I am trying to work on a > generic lossless adapter from SDO to a XML data model, without intervening > serialization. > I'm running the following code: > XMLHelper xmlHelper = XMLHelper.INSTANCE; > XSDHelper xsdHelper = XSDHelper.INSTANCE; > TypeHelper typeHelper = TypeHelper.INSTANCE; > URL url = SimpleRun2.class.getClassLoader().getResource( > NNS_SCHEMA_LOCATION); > List xsdTypes = xsdHelper > .define(url.openStream(), url.toExternalForm()); > // InputStream is = new FileInputStream(TEST_XML_DOCUMENT); > URL testxmlURL = SimpleRun2.class.getClassLoader().getResource( > TEST_XML_DOCUMENT); > XMLDocument doc = xmlHelper.load(testxmlURL.openStream()); > DataObject rootobj = doc.getRootObject(); > // typeHelper.define(xsdTypes); > XMLStreamHelper xmlStreamHelper = SDOUtil > .createXMLStreamHelper(typeHelper); > XMLStreamReader streamReader = xmlStreamHelper > .createXMLStreamReader(rootobj); > xmlStreamReader2XmlText(streamReader, System.out); > (xmlStreamReader2XmlText is just a utility method I lifted from somewhere) > Raymond told me in a private exchange that I needed to do > "TypeHelper.INSTANCE.define(InputStream xsd, String schemaLocation); " > (though that implies that I know ahead of time the schema). Since TypeHelper > doesn't have a define that takes the schema, I assume the above is what he > meant. If I pass the result of the xsdHelper.define to typeHelper.define, it > crashes in spectacular ways. > When I run this code, the result is: > <p0:AnyTypeDataObject> > Which is clearly wrong. I've included the complete program. -- 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]