Changeset 155

Show
Ignore:
Timestamp:
06/01/05 10:13:03 (8 years ago)
Author:
leo
Message:

attributeの出力を追加

Location:
XerialJ/trunk/XerialJ
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • XerialJ/trunk/XerialJ/src/org/xerial/index/DataGuide.java

    r154 r155  
    9999                    int tagID = getTagID(parser.getName()); 
    100100                    moveCursor(tagID); 
     101                    // attributeの処理 
     102                    for(int i=0; i<parser.getAttributeCount(); i++) 
     103                    { 
     104                        int attributeID = getTagID("@" + parser.getAttributeName(i)); 
     105                        moveCursor(attributeID); 
     106                        traceBack(); 
     107                    } 
    101108                    break; 
    102109                case END_TAG: 
  • XerialJ/trunk/XerialJ/src/org/xerial/util/xml/XMLGenerator.java

    r154 r155  
    116116                return this; 
    117117        } 
     118    public XMLGenerator element(String tagName, XMLAttribute attribute, String textContent) throws InvalidXMLException 
     119    { 
     120        startTag(tagName, attribute); 
     121        text(textContent); 
     122        endTag(); 
     123        return this; 
     124    } 
    118125         
    119126        public XMLGenerator endTag() throws InvalidXMLException 
  • XerialJ/trunk/XerialJ/test/org/xerial/index/DataGuideTest.java

    r154 r155  
    1919import org.xerial.util.XMLParserException; 
    2020import org.xerial.util.xml.InvalidXMLException; 
     21import org.xerial.util.xml.XMLAttribute; 
    2122import org.xerial.util.xml.XMLException; 
    2223import org.xerial.util.xml.XMLGenerator; 
     
    3637        XMLGenerator xout = new XMLGenerator(xmlWriter); 
    3738        xout.startTag("booklist"); 
    38         xout.startTag("book"). 
     39        xout.startTag("book", new XMLAttribute().add("isbn", "20424142342")). 
    3940            startTag("author"). 
    4041                element("first-name", "Peter"). 
    4142                element("last-name", "Buneman"). 
    4243            endTag(). 
    43             element("author", "leoleo"). 
     44            element("author", new XMLAttribute().add("id", "3214"), "leoleo"). 
    4445            element("year", "2005"). 
    4546            startTag("publisher"). 
     
    4950        xout.startTag("book"). 
    5051            startTag("authors"). 
    51                 element("author", "taro"). 
     52                startTag("author").element("id", "4234").text("taro").endTag(). 
    5253                element("author", "yui"). 
    5354            endTag().