Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-2080

XML Helper Load method fails to return SDO generated class when using the method that takes a java.xml.transform.Source

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Later
    • Java-SDO-1.0
    • None
    • None
    • Windows XP

    Description

      When trying to go from a Document object to a Generated Object using the XML helper only AnyTypeDataObject is being returned. The other SDO operations function propperly. For exampl if I marshall the Document to String and then use the XML load method that takes a string, the correct generated sdo instance is return. Please see the source code example below.

      Thanks in advance!

      try

      { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); System.out.println("Builder is namespace aware " + builder.isNamespaceAware()); Document dom = builder.parse(new File("results.xml")); //Create a scope and register HelperContext scope = HelperProvider.getDefaultContext(); DomainFactoryImpl.INSTANCE.register(scope); //Now load from dom to object DOMSource source = new DOMSource(dom); XMLDocument xml = scope.getXMLHelper().load(source, null, null); Object clazz = xml.getRootObject(); System.out.println(clazz); }

      catch (FactoryConfigurationError e)

      { // TODO Auto-generated catch block e.printStackTrace(); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); }

      catch (SAXException e)

      { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }

      Attachments

        1. tuscany_example.zip
          9 kB
          Jason Dixon

        Activity

          People

            Unassigned Unassigned
            jasonadixon Jason Dixon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: