[ 
http://issues.apache.org/jira/browse/TUSCANY-696?page=comments#action_12432924 
] 
            
Robbie Minshall commented on TUSCANY-696:
-----------------------------------------

I will take a look at this later this afternoon.

> 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: 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]

Reply via email to