Differences between revisions 18 and 19
Revision 18 as of 2006-08-22 07:35:02
Size: 6932
Editor: Gayeon Yoo
Comment:
Revision 19 as of 2009-09-20 22:49:07
Size: 6936
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 '''Mirae [http://ws.apache.org/mirae] provides implementations of SAX that is defined to JSR 172 and StAX that is defined to JSR 280 respectively. This project will be an initial step to implement JSR 280, which enables mobile developers to use an updated SAX and a newly added StAX from JSR 172. '''  '''Mirae [[http://ws.apache.org/mirae]] provides implementations of SAX that is defined to JSR 172 and StAX that is defined to JSR 280 respectively. This project will be an initial step to implement JSR 280, which enables mobile developers to use an updated SAX and a newly added StAX from JSR 172. '''
Line 9: Line 9:
 * Today I met mentor for project starting.[[BR]]
 * He explained to me JSR280.[[BR]]
 * Today I met mentor for project starting.<<BR>>
 * He explained to me JSR280.<<BR>>
Line 16: Line 16:
 * Got everything set up ,[[BR]]
 Mirae Source, Sun WTK2.2, CVS.[[BR]] [[BR]]
 * Built the Mirae API and got things to work in my eclipse.[[BR]]
 * Got everything set up ,<<BR>>
 Mirae Source, Sun WTK2.2, CVS.<<BR>> <<BR>>
 * Built the Mirae API and got things to work in my eclipse.<<BR>>
Line 24: Line 24:
 * I studied JSR280.[[BR]]
 * Mirae need to add SAX2 interface and dom part for JSR 280.[[BR]]
 * I studied JSR280.<<BR>>
 * Mirae need to add SAX2 interface and dom part for JSR 280.<<BR>>
Line 31: Line 31:
 * These days I spend my time understanding the Mirae SAX and StAX API.[[BR]]  * These days I spend my time understanding the Mirae SAX and StAX API.<<BR>>
Line 37: Line 37:
 * Collected implementations codes for SAX2,[[BR]]
 took a look at some of open source that HotSAX[http://hotsax.sourceforge.net/].
 * Collected implementations codes for SAX2,<<BR>>
 took a look at some of open source that HotSAX[[http://hotsax.sourceforge.net/]].
Line 46: Line 46:
 * NonValidatingParser is Mirae SAX's main class and MXParser is Mirae StAX's main class.[[BR]]  * NonValidatingParser is Mirae SAX's main class and MXParser is Mirae StAX's main class.<<BR>>
Line 49: Line 49:
 * I will create to StAX-based SAX code that are implemente[[BR]]
 for following four classes and interface [[BR]]
 * I will create to StAX-based SAX code that are implemente<<BR>>
 for following four classes and interface <<BR>>
Line 56: Line 56:
[[BR]] <<BR>>
Line 63: Line 63:
 * Started to work on the mirae SAX Parser coding [[BR]]
 * I created interafaces and abstract Classes in SAX and StAX package.[[BR]]
[[BR]]
 * Started to work on the mirae SAX Parser coding <<BR>>
 * I created interafaces and abstract Classes in SAX and StAX package.<<BR>>
<<BR>>
Line 72: Line 72:
 * I designed structures for SAX/StAX core[[BR]]
 * I had two problem since then.[[BR]]
 1. Problem of [SAXParserFactory] 's set/getFeature()[[BR]]
  * SAX's set/getFeature() are exists in SAXParserFactory class.[[BR]]
  * And StAX's set/getFeature() are exists in XMLStreamReader class.[[BR]]
  * If use SAX's set/getFeature() by StAX's set/getFeature(), must have StreamReader instnace in SAXParserFactory.[[BR]]
  * But, XMLStreamReader can not instantiate in SAXParserFactory.[[BR]]
  * Because XMLStreamReader must have Reader for InputSource.[[BR]]
 * I designed structures for SAX/StAX core<<BR>>
 * I had two problem since then.<<BR>>
 1. Problem of [SAXParserFactory] 's set/getFeature()<<BR>>
  * SAX's set/getFeature() are exists in SAXParserFactory class.<<BR>>
  * And StAX's set/getFeature() are exists in XMLStreamReader class.<<BR>>
  * If use SAX's set/getFeature() by StAX's set/getFeature(), must have StreamReader instnace in SAXParserFactory.<<BR>>
  * But, XMLStreamReader can not instantiate in SAXParserFactory.<<BR>>
  * Because XMLStreamReader must have Reader for InputSource.<<BR>>
Line 88: Line 88:
 * I created handler class for test.[[BR]]
 * First Goal. [[BR]]
  1. Start Document and EndDocument.[[BR]]
  1. StartElement and EndElement.[[BR]]
 * I created handler class for test.<<BR>>
 * First Goal. <<BR>>
  1. Start Document and EndDocument.<<BR>>
  1. StartElement and EndElement.<<BR>>
Line 106: Line 106:
 * Second Goal.[[BR]]
    1. Processing of charatecre in Element[[BR]]
 * Second Goal.<<BR>>
    1. Processing of charatecre in Element<<BR>>
Line 115: Line 115:
 * Third Goal.[[BR]]
     1. Processing of many element.[[BR]]
 * Third Goal.<<BR>>
     1. Processing of many element.<<BR>>
Line 128: Line 128:
 * Fourth Goal.[[BR]]
   1. Processing of attribute and namespace[[BR]]
   2. Processing of processing instrction[[BR]]
 * Fourth Goal.<<BR>>
   1. Processing of attribute and namespace<<BR>>
   2. Processing of processing instrction<<BR>>
Line 149: Line 149:
 * Future works[[BR]]  * Future works<<BR>>
Line 151: Line 151:
   - Entity[[BR]]
   - Namespace[[BR]]
   - Entity<<BR>>
   - Namespace<<BR>>
Line 155: Line 155:
       - ignorableWhitespace[[BR]]
       - notationDecl[[BR]]
       - resolveEntity[[BR]]
       - skippedEntity[[BR]]
       - unparseEntityDecl[[BR]]
       - startPrefixMapping[[BR]]
       - endPrefixMapping[[BR]]
       - ignorableWhitespace<<BR>>
       - notationDecl<<BR>>
       - resolveEntity<<BR>>
       - skippedEntity<<BR>>
       - unparseEntityDecl<<BR>>
       - startPrefixMapping<<BR>>
       - endPrefixMapping<<BR>>
Line 169: Line 169:
 * Completed work [[BR]]  * Completed work <<BR>>
Line 249: Line 249:
 2. The org.xml.sax.helpers.DefaultHandler has been updated to implement [[BR]]
     ContentHandler, EntityResolver, DTDHandler, and ErrorHandler interfaces.[[BR]]
 2. The org.xml.sax.helpers.DefaultHandler has been updated to implement <<BR>>
     ContentHandler, EntityResolver, DTDHandler, and ErrorHandler interfaces.<<BR>>
Line 257: Line 257:
 1. I implemented XMLReader in StAX-based SAX parser class.[[BR]]
 2. I designed simple DTD parser for SAX.[[BR]]
 1. I implemented XMLReader in StAX-based SAX parser class.<<BR>>
 2. I designed simple DTD parser for SAX.<<BR>>
Line 264: Line 264:
 * package org.apache.mirae.j2me.xml's [[BR]][[BR]]  * package org.apache.mirae.j2me.xml's <<BR>><<BR>>
Line 266: Line 266:
 1. Changes NonValidationParser class to stax-based StAXCoreParser class.[[BR]]
  - StAXCoreParser is implementation class of XMLReader in SAX2.[[BR]]
  - Part of DTD processing is similar almost with previous MIRAE.[[BR]][[BR]]

 2. EntityResolver class is overlapped with SAX2's EntityResolver interface.[[BR]]
  - EntityResolver changes name to Entities.[[BR]]
 ----
 1. Changes NonValidationParser class to stax-based StAXCoreParser class.<<BR>>
  - StAXCoreParser is implementation class of XMLReader in SAX2.<<BR>>
  - Part of DTD processing is similar almost with previous MIRAE.<<BR>><<BR>>

 2. EntityResolver class is overlapped with SAX2's EntityResolver interface.<<BR>>
  - EntityResolver changes name to Entities.<<BR>>
 ----

Integrate SAX and StAX into one Core Timeline

  • Mirae http://ws.apache.org/mirae provides implementations of SAX that is defined to JSR 172 and StAX that is defined to JSR 280 respectively. This project will be an initial step to implement JSR 280, which enables mobile developers to use an updated SAX and a newly added StAX from JSR 172.


12'th June
  • Today I met mentor for project starting.

  • He explained to me JSR280.



17'th June

  • Got everything set up ,
    Mirae Source, Sun WTK2.2, CVS.

  • Built the Mirae API and got things to work in my eclipse.



21'st June
  • I studied JSR280.

  • Mirae need to add SAX2 interface and dom part for JSR 280.



22'nd - 24'th June
  • These days I spend my time understanding the Mirae SAX and StAX API.



26'th June


27 - 29'th June
  • I understood the Mirae SAX and StAX API in detail again.
  • NonValidatingParser is Mirae SAX's main class and MXParser is Mirae StAX's main class.
    These two classes are too complex to understand. I am hard to undertand tham.

  • I will create to StAX-based SAX code that are implemente
    for following four classes and interface

    1. SAXParserFactory
    2. SAXParser
    3. Attribute
    4. Location


  • I think that modified StAX API’s AttributeBase class can substitute implementation codes of Attribute and Location.



3'rd July
  • Started to work on the mirae SAX Parser coding

  • I created interafaces and abstract Classes in SAX and StAX package.




 4'th July
  • I designed structures for SAX/StAX core

  • I had two problem since then.

    1. Problem of [SAXParserFactory] 's set/getFeature()

      • SAX's set/getFeature() are exists in SAXParserFactory class.

      • And StAX's set/getFeature() are exists in XMLStreamReader class.

      • If use SAX's set/getFeature() by StAX's set/getFeature(), must have StreamReader instnace in SAXParserFactory.

      • But, XMLStreamReader can not instantiate in SAXParserFactory.

      • Because XMLStreamReader must have Reader for InputSource.

    2. Unmatched problem of SAX's Locator and Location


 5'th July
  • I created handler class for test.

  • First Goal.

    1. Start Document and EndDocument.

    2. StartElement and EndElement.

     test document (test1.xml)
     ------------------------------------
    <?xml version="1.0" encoding="utf-8"?> 
    <root></root>


 6'th July
  • Second Goal.

    1. Processing of charatecre in Element

     test document (test2.xml)
     ------------------------------------
    <?xml version="1.0" encoding="utf-8" ?> 
    <root><a>1111</a></root>
  • Third Goal.

    1. Processing of many element.

     test document (test3.xml)
     ------------------------------------
    <?xml version="1.0" encoding="utf-8" ?> 
    <root>root<a>a</a><b>b</b></root>


 10'th July
  • Fourth Goal.

    1. Processing of attribute and namespace

    2. Processing of processing instrction

     test document (test4.xml)
     ------------------------------------
    <?xml version="1.0" encoding="utf-8" ?> 
    <document>
       <title>The Publishers </title>
       <publisher>        
           Alfred Publishing
          15535 Morrison
          South Oaks CA 91403
       </publisher>
       <book price="$100" author = "Herold" number = "no_11">eXtensible Markup Language</book>
       <bookurn xmlns='urn:loc.gov:books' xmlns:isbn='urn:ISBN:0-395-36341-6'/> 
       <pb/>
       <pages />
    </document>
  • Future works

    1. Processing of DTD
      • - Entity
        - Namespace

    2. Other handler method
      • - ignorableWhitespace
        - notationDecl
        - resolveEntity
        - skippedEntity
        - unparseEntityDecl
        - startPrefixMapping
        - endPrefixMapping

    3. set/getFeature()


  12'nd July
  • Completed work

    1. XMLInputFactory's get/setFeature() method;
    2. NamespaceAware option.

     test document (test5.xml) by Beginning XML 3rd Edition
     ------------------------------------
     <?xml version = "1.0"?>
    <person xmlns ="http://sernaferna.com/pers">
            <names id ="1">
                    <first>John</first>     
                    <middle>Fitzgerald Johansen</middle>
                    <last>Doe</last>
            </names>
            <position>Vice President of Marketing</position>
            <resume>
                    <html:html xmlns:html = "http://www.w3.org/1999/xhtml">
                            <html:head><html:title>resume of John Doe</html:title></html:head>
                            <html:body>
                                    <html:h1>John Doe</html:h1>
                                    <html:p html:style="font-FAMILY: Arial">
                                            John's a great guy, you know?
                                    </html:p>
                            </html:body>
                    </html:html>
            </resume>
    </person>
  • result
    START_DOCUMENT
    ---------startPrefix : "" = http://sernaferna.com/pers
    <person>
    <names>
     id="1"
    <first>
    </first>
    <middle>
    </middle>
    <last>
    </last>
    </names>
    <position>
    </position>
    <resume>
    ---------startPrefix : "html" = http://www.w3.org/1999/xhtml
    <html:html>
    <html:head>
    <html:title>
    </html:title>
    </html:head>
    <html:body>
    <html:h1>
    </html:h1>
    <html:p>
     style="font-FAMILY: Arial"
    </html:p>
    </html:body>
    </html:html>
    ---------endPrefix : html
    </resume>
    </person>
    ---------endPrefix : null
    END_DOCUMENT


  18 - 19'nd July
  1. Current SAX API adds following interface
  2. The org.xml.sax.helpers.DefaultHandler has been updated to implement

  3. I created XMLFilterImpl class.


  24 - 25'th July
  1. I implemented XMLReader in StAX-based SAX parser class.

  2. I designed simple DTD parser for SAX.



  Final
  • package org.apache.mirae.j2me.xml's

    1. Changes NonValidationParser class to stax-based StAXCoreParser class.

      • - StAXCoreParser is implementation class of XMLReader in SAX2.
        - Part of DTD processing is similar almost with previous MIRAE.

    2. EntityResolver class is overlapped with SAX2's EntityResolver interface.


Mirae/Core (last edited 2009-09-20 22:49:07 by localhost)