XMLBeans
  1. XMLBeans
  2. XMLBEANS-454

XmlDate.Factory.parse(java.lang.String ) is broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: Version 2.5
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      This program

      import org.apache.xmlbeans.XmlDate;
      public class Z {
      public static void main(String[] argv) throws Exception

      { XmlDate.Factory.parse("2011-04-20"); }

      }

      Throws this exception:

      Exception in thread "main" org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA
      at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3486)
      at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:712)
      at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:696)
      at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:683)
      at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:208)
      at org.apache.xmlbeans.XmlDate$Factory.parse(XmlDate.java:104)
      at Z.main(Z.java:6)
      Caused by: org.xml.sax.SAXParseException: Unexpected element: CDATA
      at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038)
      at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)
      at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3454)
      ... 6 more

        Activity

        Hide
        Cezar Andrei added a comment -

        Closing since is invalid.

        Show
        Cezar Andrei added a comment - Closing since is invalid.
        Hide
        Cezar Andrei added a comment -

        The javadoc is very clear:
        Parses a XmlDate fragment from a String. For example: "<xml-fragment>2003-06-14</xml-fragment>".

        See:
        http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlDate.Factory.html#parse%28java.lang.String%29

        Show
        Cezar Andrei added a comment - The javadoc is very clear: Parses a XmlDate fragment from a String. For example: "<xml-fragment>2003-06-14</xml-fragment>". See: http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlDate.Factory.html#parse%28java.lang.String%29

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Grand
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development