castor
  1. castor
  2. CASTOR-1675

SchemaWriter not serializing anyAttribute child of a complexType

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.4
    • Fix Version/s: 1.0.5
    • Component/s: XML code generator
    • Labels:
      None
    • Environment:
      Any
    • Number of attachments :
      4

      Description

      When serializing a schema using hte SchemaWriter, the anyAttribute child of a complexType (if any) does not get serialized.

      To reproduce, simply create an XSD file that uses <anyAttribute>, deserialize into a Schema object, then serialize using SchemaWriter.

      1. CastorAnyAttributeTest14.java
        3 kB
        Eric Wittmann
      2. patch.c1675.20061102.txt
        0.6 kB
        Werner Guttmann
      3. patch.c1675.sample.20061102.txt
        3 kB
        Werner Guttmann
      4. SchemaWriter.patch
        0.2 kB
        Eric Wittmann

        Activity

        Hide
        Werner Guttmann added a comment -

        Eric, would you mind attaching a fully working (JUnit) test case to reproduce this problem. I know I could do this myself, but I hope you do understand that this gets tedious with an increasing number of bug reports .. .

        Show
        Werner Guttmann added a comment - Eric, would you mind attaching a fully working (JUnit) test case to reproduce this problem. I know I could do this myself, but I hope you do understand that this gets tedious with an increasing number of bug reports .. .
        Hide
        Eric Wittmann added a comment -

        A unit test for anyAttribute serialization.

        Show
        Eric Wittmann added a comment - A unit test for anyAttribute serialization.
        Hide
        Eric Wittmann added a comment -

        I have attached a new version of the unit test that works with Castor 1.4. I wrote the previous unit test attachment against an older version of Castor, my apologies. This latest unit test will fail when run against Castor 1.4.

        Also note that my patch may be a bit off if applied to Castor 1.4 source. But it's simple enough that I'm sure whoever is applying it will figure it out.

        Show
        Eric Wittmann added a comment - I have attached a new version of the unit test that works with Castor 1.4. I wrote the previous unit test attachment against an older version of Castor, my apologies. This latest unit test will fail when run against Castor 1.4. Also note that my patch may be a bit off if applied to Castor 1.4 source. But it's simple enough that I'm sure whoever is applying it will figure it out.
        Hide
        Werner Guttmann added a comment -

        Eric, on line 70 of your test case, you are using the method getComplexType(String, String) on Schema. Apparently, that is a method that does not exist on the Schema class (in SVN trunk).

        Show
        Werner Guttmann added a comment - Eric, on line 70 of your test case, you are using the method getComplexType(String, String) on Schema. Apparently, that is a method that does not exist on the Schema class (in SVN trunk).
        Hide
        Eric Wittmann added a comment -

        You are right.

        See my addendum comment: http://jira.codehaus.org/browse/CASTOR-1675#action_79101

        I attached a new unit test with the corrections.

        Is there a way to remove attachments?

        Show
        Eric Wittmann added a comment - You are right. See my addendum comment: http://jira.codehaus.org/browse/CASTOR-1675#action_79101 I attached a new unit test with the corrections. Is there a way to remove attachments?
        Hide
        Werner Guttmann added a comment -

        Final patch. All tests still execute w/o problems .. . I cannot see a valid way how to add the test case provided to the CTF suite ... .

        Show
        Werner Guttmann added a comment - Final patch. All tests still execute w/o problems .. . I cannot see a valid way how to add the test case provided to the CTF suite ... .
        Hide
        Werner Guttmann added a comment -

        JUnit test case (for historic reasons), relative to src/bugs.

        Show
        Werner Guttmann added a comment - JUnit test case (for historic reasons), relative to src/bugs.
        Hide
        Werner Guttmann added a comment -

        Patch committed as is ...

        Show
        Werner Guttmann added a comment - Patch committed as is ...
        Hide
        Edward Kuns added a comment -

        Should the test case be added to SVN?

        Show
        Edward Kuns added a comment - Should the test case be added to SVN?
        Hide
        Werner Guttmann added a comment -

        I guess it won't be easily addable, as it tests the SchemaWriter in addition to SchemaReader .. . Iow, I'd love to, but don't see a way how.

        Show
        Werner Guttmann added a comment - I guess it won't be easily addable, as it tests the SchemaWriter in addition to SchemaReader .. . Iow, I'd love to, but don't see a way how.
        Hide
        Werner Guttmann added a comment -

        Bulk-closing all issues assigned to 1.0.5. Please feel free to re-open any of those when required.

        Show
        Werner Guttmann added a comment - Bulk-closing all issues assigned to 1.0.5. Please feel free to re-open any of those when required.

          People

          • Assignee:
            Werner Guttmann
            Reporter:
            Eric Wittmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 30 minutes
              30m
              Remaining:
              Time Spent - 20 minutes Remaining Estimate - 10 minutes
              10m
              Logged:
              Time Spent - 20 minutes Remaining Estimate - 10 minutes
              20m