You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(57) |
Apr
(103) |
May
(164) |
Jun
(139) |
Jul
(173) |
Aug
(196) |
Sep
(221) |
Oct
(333) |
Nov
(214) |
Dec
(88) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(163) |
Feb
(165) |
Mar
(98) |
Apr
(93) |
May
(199) |
Jun
(118) |
Jul
(200) |
Aug
(212) |
Sep
(185) |
Oct
(297) |
Nov
(437) |
Dec
(272) |
2006 |
Jan
(542) |
Feb
(329) |
Mar
(267) |
Apr
(332) |
May
(267) |
Jun
(130) |
Jul
(161) |
Aug
(348) |
Sep
(166) |
Oct
(305) |
Nov
(173) |
Dec
(173) |
2007 |
Jan
(199) |
Feb
(118) |
Mar
(133) |
Apr
(200) |
May
(208) |
Jun
(146) |
Jul
(198) |
Aug
(146) |
Sep
(187) |
Oct
(182) |
Nov
(181) |
Dec
(83) |
2008 |
Jan
(252) |
Feb
(124) |
Mar
(124) |
Apr
(101) |
May
(143) |
Jun
(122) |
Jul
(129) |
Aug
(60) |
Sep
(80) |
Oct
(89) |
Nov
(54) |
Dec
(112) |
2009 |
Jan
(88) |
Feb
(145) |
Mar
(105) |
Apr
(164) |
May
(123) |
Jun
(154) |
Jul
(374) |
Aug
(341) |
Sep
(219) |
Oct
(137) |
Nov
(373) |
Dec
(240) |
2010 |
Jan
(197) |
Feb
(270) |
Mar
(253) |
Apr
(150) |
May
(102) |
Jun
(51) |
Jul
(300) |
Aug
(512) |
Sep
(254) |
Oct
(258) |
Nov
(288) |
Dec
(143) |
2011 |
Jan
(238) |
Feb
(179) |
Mar
(253) |
Apr
(332) |
May
(248) |
Jun
(255) |
Jul
(216) |
Aug
(282) |
Sep
(146) |
Oct
(77) |
Nov
(86) |
Dec
(69) |
2012 |
Jan
(172) |
Feb
(234) |
Mar
(229) |
Apr
(101) |
May
(212) |
Jun
(267) |
Jul
(129) |
Aug
(210) |
Sep
(239) |
Oct
(271) |
Nov
(368) |
Dec
(220) |
2013 |
Jan
(179) |
Feb
(155) |
Mar
(59) |
Apr
(47) |
May
(99) |
Jun
(158) |
Jul
(185) |
Aug
(16) |
Sep
(16) |
Oct
(7) |
Nov
(20) |
Dec
(12) |
2014 |
Jan
(21) |
Feb
(17) |
Mar
(18) |
Apr
(13) |
May
(27) |
Jun
(15) |
Jul
(19) |
Aug
(22) |
Sep
(30) |
Oct
(16) |
Nov
(19) |
Dec
(16) |
2015 |
Jan
(14) |
Feb
(24) |
Mar
(33) |
Apr
(41) |
May
(14) |
Jun
(80) |
Jul
(53) |
Aug
(8) |
Sep
(7) |
Oct
(15) |
Nov
(13) |
Dec
(2) |
2016 |
Jan
(22) |
Feb
(12) |
Mar
(30) |
Apr
(6) |
May
(33) |
Jun
(16) |
Jul
(8) |
Aug
(20) |
Sep
(12) |
Oct
(18) |
Nov
(12) |
Dec
(11) |
2017 |
Jan
(24) |
Feb
(26) |
Mar
(47) |
Apr
(23) |
May
(19) |
Jun
(14) |
Jul
(28) |
Aug
(30) |
Sep
(17) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
(73) |
Mar
(90) |
Apr
(42) |
May
(116) |
Jun
(90) |
Jul
(127) |
Aug
(103) |
Sep
(56) |
Oct
(42) |
Nov
(95) |
Dec
(58) |
2020 |
Jan
(102) |
Feb
(31) |
Mar
(93) |
Apr
(60) |
May
(57) |
Jun
(45) |
Jul
(29) |
Aug
(32) |
Sep
(44) |
Oct
(86) |
Nov
(51) |
Dec
(71) |
2021 |
Jan
(44) |
Feb
(25) |
Mar
(78) |
Apr
(130) |
May
(64) |
Jun
(74) |
Jul
(21) |
Aug
(64) |
Sep
(40) |
Oct
(43) |
Nov
(21) |
Dec
(99) |
2022 |
Jan
(154) |
Feb
(64) |
Mar
(45) |
Apr
(95) |
May
(62) |
Jun
(48) |
Jul
(73) |
Aug
(37) |
Sep
(71) |
Oct
(27) |
Nov
(40) |
Dec
(65) |
2023 |
Jan
(89) |
Feb
(130) |
Mar
(124) |
Apr
(50) |
May
(93) |
Jun
(46) |
Jul
(45) |
Aug
(68) |
Sep
(62) |
Oct
(71) |
Nov
(108) |
Dec
(82) |
2024 |
Jan
(53) |
Feb
(76) |
Mar
(64) |
Apr
(75) |
May
(36) |
Jun
(54) |
Jul
(98) |
Aug
(137) |
Sep
(58) |
Oct
(177) |
Nov
(84) |
Dec
(52) |
2025 |
Jan
(70) |
Feb
(53) |
Mar
(72) |
Apr
(47) |
May
(88) |
Jun
(49) |
Jul
(86) |
Aug
(29) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Wolfgang M. M. <wol...@us...> - 2004-08-10 20:28:01
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/util/serializer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24902/src/org/exist/util/serializer Modified Files: DOMStreamer.java Log Message: Refactored some methods to improve performance during storage and indexing. Index: DOMStreamer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/serializer/DOMStreamer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DOMStreamer.java 8 Aug 2004 19:03:25 -0000 1.7 --- DOMStreamer.java 10 Aug 2004 20:27:15 -0000 1.8 *************** *** 156,160 **** nextAttr = (Attr) attrs.item(i); attrName = nextAttr.getName(); - System.out.println("Attr = " + attrName); if (attrName.equals("xmlns")) { if (nsSupport.getURI("") == null) { --- 156,159 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-08-10 20:27:30
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24902/src/org/exist/storage/store Modified Files: BFile.java ItemId.java Added Files: FreeList.java FreeSpace.java Log Message: Refactored some methods to improve performance during storage and indexing. --- NEW FILE: FreeSpace.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2000-04, Wolfgang M. Meier (wol...@ex...) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: FreeSpace.java,v 1.1 2004/08/10 20:27:17 wolfgang_m Exp $ */ package org.exist.storage.store; /** * Used to track the available amount of free space in a data page. * * @see FreeList * @author wolf */ public class FreeSpace { protected int free = 0; protected long page = -1; protected FreeSpace next = null; protected FreeSpace previous = null; public FreeSpace(long pageNum, int space) { page = pageNum; free = space; } public int compareTo(FreeSpace other) { if (free < other.free) return -1; else if (free > other.free) return 1; else return 0; } public boolean equals(FreeSpace other) { return page == other.page; } /** * Returns the amount of unused space in the page (in bytes). * * @return */ public int getFree() { return free; } /** * The unique page number. * * @return */ public long getPage() { return page; } public void setFree(int space) { free = space; } } --- NEW FILE: FreeList.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2000-04, Wolfgang M. Meier (wol...@ex...) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: FreeList.java,v 1.1 2004/08/10 20:27:17 wolfgang_m Exp $ */ package org.exist.storage.store; import java.io.IOException; import java.io.RandomAccessFile; import org.apache.log4j.Logger; /** * Manages a list of pages containing unused sections. * * Class {@link org.exist.storage.store.BFile} stores all data in variable * length records. As records may grow or shrink, the database has to keep * track of the amount of free space currently available in pages. Class * {@link org.exist.storage.store.BFile} will always check if FreeList has a page * that can be filled before creating a new page. * * FreeList implements a linked list of {@link FreeSpace} objects. Each object * in the list describes a page and the unused space in this page. * * @see FreeList * @author wolf */ public class FreeList { private final static Logger LOG = Logger.getLogger(FreeList.class); public final static int MAX_FREE_LIST_LEN = 128; protected FreeSpace header = null; protected FreeSpace last = null; protected int size = 0; public FreeList() { } /** * Append a new {@link FreeSpace} object to the list, * describing the amount of free space available on a page. * * @param free */ public void add( FreeSpace free ) { if(header == null) { header = free; last = free; } else { last.next = free; free.previous = last; last = free; } ++size; } /** * Remove a record from the list. * * @param node */ public void remove(FreeSpace node) { --size; if (node.previous == null) { if (node.next != null) { node.next.previous = null; header = node.next; } else header = null; } else { node.previous.next = node.next; if (node.next != null) node.next.previous = node.previous; else last = node.previous; } } /** * Retrieve the record stored for the given page number. * * @param pageNum * @return */ public FreeSpace retrieve(long pageNum) { FreeSpace next = header; while(next != null) { if(next.page == pageNum) return next; next = next.next; } return null; } /** * Try to find a page that has at least requiredSize bytes * available. This method selects the page with the smallest * possible space. This guarantees that all pages will be filled before * creating a new page. * * @param requiredSize * @return */ public FreeSpace find(int requiredSize) { FreeSpace next = header; FreeSpace found = null; while(next != null) { if(next.free >= requiredSize) { if(found == null || next.free < found.free) found = next; } next = next.next; } return found; } public String toString() { StringBuffer buf = new StringBuffer(); FreeSpace next = header; while(next != null) { buf.append("[").append(next.page).append(", "); buf.append(next.free).append("] "); next = next.next; } return buf.toString(); } /** * Read the list from a {@link RandomAccessFile}. * * @param raf * @throws IOException */ public void read(RandomAccessFile raf) throws IOException { final int fsize = raf.readInt(); long page; int space; for (int i = 0; i < fsize; i++) { page = raf.readLong(); space = raf.readInt(); add(new FreeSpace(page, space)); } } /** * Write the list to a {@link RandomAccessFile}. * * As the list is written to the file header, its maximum length * has to be restricted. The method will thus only store * {@link #MAX_FREE_LIST_LEN} entries and throw away the * rest. Usually, this should not happen very often, so it is ok to * waste some space. * * @param raf * @throws IOException */ public void write(RandomAccessFile raf) throws IOException { // does the free-space list fit into the file header? int skip = 0; if (size > MAX_FREE_LIST_LEN) { LOG.warn("removing " + (size - MAX_FREE_LIST_LEN) + " free pages."); // no: remove some smaller entries to make it fit skip = size - MAX_FREE_LIST_LEN; } raf.writeInt(size - skip); FreeSpace next = header; while(next != null) { if(skip == 0) { raf.writeLong(next.page); raf.writeInt(next.free); } else --skip; next = next.next; } } } Index: BFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/BFile.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** BFile.java 16 Jul 2004 15:36:42 -0000 1.28 --- BFile.java 10 Aug 2004 20:27:17 -0000 1.29 *************** *** 21,26 **** package org.exist.storage.store; - import org.apache.log4j.Logger; - import java.io.ByteArrayOutputStream; import java.io.EOFException; --- 21,24 ---- *************** *** 29,34 **** import java.io.UnsupportedEncodingException; import java.util.ArrayList; ! import java.util.Iterator; import org.dbxml.core.DBException; import org.dbxml.core.data.Value; --- 27,33 ---- import java.io.UnsupportedEncodingException; import java.util.ArrayList; ! import java.util.Arrays; + import org.apache.log4j.Logger; import org.dbxml.core.DBException; import org.dbxml.core.data.Value; *************** *** 52,59 **** import org.exist.util.Lock; import org.exist.util.LockException; - import org.exist.util.OrderedLinkedList; import org.exist.util.ReadOnlyException; import org.exist.util.ReentrantReadWriteLock; - import org.exist.util.OrderedLinkedList.Node; import org.exist.xquery.TerminatedException; --- 51,56 ---- *************** *** 188,192 **** final int valueLen = value.size(); final byte[] data = page.getData(); ! final int offset = findValuePosition(page, tid); if (offset < 0) throw new IOException("tid " + tid --- 185,189 ---- final int valueLen = value.size(); final byte[] data = page.getData(); ! final int offset = page.findValuePosition(tid); if (offset < 0) throw new IOException("tid " + tid *************** *** 328,345 **** } - private final int findValuePosition(final DataPage page, final short tid) - throws IOException { - int pos = 0; - final byte[] data = page.getData(); - final int dlen = page.getPageHeader().getDataLength(); - while (pos < dlen) { - if (ByteConversion.byteToShort(data, pos) == tid) return pos + 2; - pos += ByteConversion.byteToInt(data, pos + 2) + 6; - } - LOG.warn("tid " + tid + " not found. " + page.getPageInfo() + "; pos: " - + pos); - return -1; - } - public boolean flush() throws DBException { dataCache.flush(); --- 325,328 ---- *************** *** 384,388 **** LOG.debug("key " + key + " not found"); } catch (IOException e) { ! LOG.debug(e); } return null; --- 367,371 ---- LOG.debug("key " + key + " not found"); } catch (IOException e) { ! LOG.debug(e.getMessage(), e); } return null; *************** *** 440,444 **** dataCache.add(page.getFirstPage(), 2); final short tid = (short) StorageAddress.tidFromPointer(pointer); ! final int offset = findValuePosition(page, tid); if (offset < 0) { throw new IOException("no data found at tid " + tid + "; page " + page.getPageNum()); } --- 423,427 ---- dataCache.add(page.getFirstPage(), 2); final short tid = (short) StorageAddress.tidFromPointer(pointer); ! final int offset = page.findValuePosition(tid); if (offset < 0) { throw new IOException("no data found at tid " + tid + "; page " + page.getPageNum()); } *************** *** 474,478 **** IOException { final short tid = StorageAddress.tidFromPointer(p); ! final int offset = findValuePosition(page, tid); final byte[] data = page.getData(); if (offset > data.length || offset < 0) { --- 457,461 ---- IOException { final short tid = StorageAddress.tidFromPointer(p); ! final int offset = page.findValuePosition(tid); final byte[] data = page.getData(); if (offset > data.length || offset < 0) { *************** *** 496,499 **** --- 479,486 ---- private DataPage getDataPage(long pos) throws IOException { + return getDataPage(pos, true); + } + + private DataPage getDataPage(long pos, boolean initialize) throws IOException { DataPage wp = null; wp = (DataPage) dataCache.get(pos); *************** *** 508,512 **** return new OverflowPage(page, data); else ! return new SinglePage(page, data); } else if (wp.getPageHeader().getStatus() == MULTI_PAGE) return new OverflowPage(wp); --- 495,499 ---- return new OverflowPage(page, data); else ! return new SinglePage(page, data, initialize); } else if (wp.getPageHeader().getStatus() == MULTI_PAGE) return new OverflowPage(wp); *************** *** 631,635 **** } short tid = StorageAddress.tidFromPointer(p); ! int offset = findValuePosition(page, tid); byte[] data = page.getData(); if (offset > data.length || offset < 0) { --- 618,622 ---- } short tid = StorageAddress.tidFromPointer(p); ! int offset = page.findValuePosition(tid); byte[] data = page.getData(); if (offset > data.length || offset < 0) { *************** *** 650,670 **** // if this page is empty, remove it if (len == 0) { ! final FreeSpace free = fileHeader.getFreeSpace(page.getPageNum()); ! fileHeader.removeFreeSpace(free); dataCache.remove(page); page.delete(); } else { // adjust free space data final int newFree = fileHeader.getWorkSize() - len; if (newFree > minFree) { FreeSpace free = fileHeader.getFreeSpace(page.getPageNum()); ! if (free == null) free = new FreeSpace(page.getPageNum(), newFree); ! else { free.setFree(newFree); - fileHeader.removeFreeSpace(free); } ! if(page.getPageHeader().getCurrentTID() > -1) ! fileHeader.addFreeSpace(free); } dataCache.add(page, 2); --- 637,657 ---- // if this page is empty, remove it if (len == 0) { ! fileHeader.removeFreeSpace(fileHeader.getFreeSpace(page.getPageNum())); dataCache.remove(page); page.delete(); } else { + page.removeTID(tid, l + 6); // adjust free space data final int newFree = fileHeader.getWorkSize() - len; if (newFree > minFree) { FreeSpace free = fileHeader.getFreeSpace(page.getPageNum()); ! if (free == null) { free = new FreeSpace(page.getPageNum(), newFree); ! fileHeader.addFreeSpace(free); ! } else { free.setFree(newFree); } ! // if(page.getPageHeader().getCurrentTID() < 0) ! // fileHeader.removeFreeSpace(free); } dataCache.add(page, 2); *************** *** 676,681 **** - page.getPageHeader().getDataLength(); space.setFree(free); ! fileHeader.removeFreeSpace(space); ! if (free > minFree) fileHeader.addFreeSpace(space); } --- 663,668 ---- - page.getPageHeader().getDataLength(); space.setFree(free); ! if(free < minFree) ! fileHeader.removeFreeSpace(space); } *************** *** 715,718 **** --- 702,706 ---- .getWorkSize() - page.getPageHeader().getDataLength()); + fileHeader.addFreeSpace(free); } else { page = getDataPage(free.getPage()); *************** *** 733,747 **** + realSpace); free.setFree(realSpace); - fileHeader.removeFreeSpace(free); - fileHeader.addFreeSpace(free); continue; } } ! tid = page.getPageHeader().getNextTID(); if (tid < 0) { LOG.info("removing page " + page.getPageNum() + " from free pages"); fileHeader.removeFreeSpace(free); - fileHeader.printFreeSpace(); } } --- 721,732 ---- + realSpace); free.setFree(realSpace); continue; } } ! tid = page.getNextTID(); if (tid < 0) { LOG.info("removing page " + page.getPageNum() + " from free pages"); fileHeader.removeFreeSpace(free); } } *************** *** 752,755 **** --- 737,741 ---- ByteConversion.shortToByte(tid, data, len); len += 2; + page.setOffset(tid, len); // save data length ByteConversion.intToByte(vlen, data, len); *************** *** 865,921 **** } ! private final static class FreeSpace extends OrderedLinkedList.Node { ! ! /** ! * Log4J Logger for this class ! */ ! private static final Logger LOG = Logger.getLogger(FreeSpace.class); ! ! private int free = 0; ! ! private long page = -1; ! ! public FreeSpace(long pageNum, int space) { ! page = pageNum; ! free = space; ! } ! ! public int compareTo(Node node) { ! FreeSpace other = (FreeSpace) node; ! if (free < other.free) ! return -1; ! else if (free > other.free) ! return 1; ! else ! return 0; ! } ! ! public boolean equals(Node other) { ! return page == ((FreeSpace)other).page; ! } ! ! public int getFree() { ! return free; ! } ! ! public long getPage() { ! return page; ! } ! ! public void setFree(int space) { ! free = space; ! } ! ! public String toString() { ! return "page: " + page + ": " + free; ! } } ! private final class BFileHeader extends BTreeFileHeader { - private OrderedLinkedList freeList = new OrderedLinkedList(); - private long lastDataPage = -1; public final static int MAX_FREE_LIST_LEN = 128; --- 851,870 ---- } ! public void debugFreeList() { ! fileHeader.debugFreeList(); } ! ! /** ! * The file header. Most important, the file header stores the list of ! * data pages containing unused space. ! * ! * @author wolf ! */ private final class BFileHeader extends BTreeFileHeader { private long lastDataPage = -1; + private FreeList freeList = new FreeList(); + public final static int MAX_FREE_LIST_LEN = 128; *************** *** 929,947 **** public FreeSpace findFreeSpace(int needed) { ! FreeSpace freeSpace; ! for (Iterator i = freeList.iterator(); i.hasNext();) { ! freeSpace = (FreeSpace) i.next(); ! if (freeSpace.getFree() >= needed) return freeSpace; ! } ! return null; } public FreeSpace getFreeSpace(long page) { ! FreeSpace freeSpace; ! for (Iterator i = freeList.iterator(); i.hasNext();) { ! freeSpace = (FreeSpace) i.next(); ! if (freeSpace.getPage() == page) return freeSpace; ! } ! return null; } --- 878,886 ---- public FreeSpace findFreeSpace(int needed) { ! return freeList.find(needed); } public FreeSpace getFreeSpace(long page) { ! return freeList.retrieve(page); } *************** *** 950,976 **** freeList.remove(space); } ! ! public FreeSpace getMaxFreeSpace() { ! FreeSpace space; ! FreeSpace max = null; ! for (Iterator i = freeList.iterator(); i.hasNext();) { ! space = (FreeSpace) i.next(); ! if (max == null || max.getFree() < space.getFree()) ! max = space; ! } ! return max; ! } ! ! public void printFreeSpace() { ! System.out.print(getFile().getName() + ": "); ! FreeSpace freeSpace; ! for (Iterator i = freeList.iterator(); i.hasNext();) { ! freeSpace = (FreeSpace) i.next(); ! System.out.print("[" + freeSpace.getPage() + ", " ! + freeSpace.getFree() + "] "); ! } ! System.out.println(); } ! public long getLastDataPage() { return lastDataPage; --- 889,897 ---- freeList.remove(space); } ! ! public void debugFreeList() { ! LOG.debug(getFile().getName() + ": " + freeList.toString()); } ! public long getLastDataPage() { return lastDataPage; *************** *** 980,991 **** super.read(raf); lastDataPage = raf.readLong(); ! final int fsize = raf.readInt(); ! long page; ! int space; ! for (int i = 0; i < fsize; i++) { ! page = raf.readLong(); ! space = raf.readInt(); ! freeList.add(new FreeSpace(page, space)); ! } } --- 901,905 ---- super.read(raf); lastDataPage = raf.readLong(); ! freeList.read(raf); } *************** *** 995,1022 **** public void write(java.io.RandomAccessFile raf) throws IOException { - // does the free-space list fit into the file header? - int skip = 0; - if (freeList.size() > MAX_FREE_LIST_LEN) { - LOG.warn("removing " + (freeList.size() - MAX_FREE_LIST_LEN) - + " free pages."); - // no: remove some smaller entries to make it fit - skip = freeList.size() - MAX_FREE_LIST_LEN; - // for (int i = 0; i < freeList.size() - MAX_FREE_LIST_LEN; i++) - // freeList.removeFirst(); - } super.write(raf); raf.writeLong(lastDataPage); ! raf.writeInt(freeList.size() - skip); ! FreeSpace freeSpace; ! Iterator i = freeList.iterator(); ! // skip ! for(int j = 0; j < skip && i.hasNext(); j++) { ! i.next(); ! } ! while (i.hasNext()) { ! freeSpace = (FreeSpace) i.next(); ! raf.writeLong(freeSpace.getPage()); ! raf.writeInt(freeSpace.getFree()); ! } } } --- 909,915 ---- public void write(java.io.RandomAccessFile raf) throws IOException { super.write(raf); raf.writeLong(lastDataPage); ! freeList.write(raf); } } *************** *** 1150,1153 **** --- 1043,1055 ---- public abstract long getPageNum(); + public abstract int findValuePosition(short tid) + throws IOException; + + public abstract short getNextTID(); + + public abstract void removeTID(short tid, int length) throws IOException; + + public abstract void setOffset(short tid, int offset); + public long getKey() { return getPageNum(); *************** *** 1255,1259 **** tid = StorageAddress.tidFromPointer(pointer); page = getDataPage(pos); ! offset = findValuePosition(page, tid); byte[] data = page.getData(); l = ByteConversion.byteToInt(data, offset); --- 1157,1161 ---- tid = StorageAddress.tidFromPointer(pointer); page = getDataPage(pos); ! offset = page.findValuePosition(tid); byte[] data = page.getData(); l = ByteConversion.byteToInt(data, offset); *************** *** 1311,1315 **** page = getDataPage(pos); dataCache.add(page.getFirstPage()); ! offset = findValuePosition(page, tid); data = page.getData(); l = ByteConversion.byteToInt(data, offset); --- 1213,1217 ---- page = getDataPage(pos); dataCache.add(page.getFirstPage()); ! offset = page.findValuePosition(tid); data = page.getData(); l = ByteConversion.byteToInt(data, offset); *************** *** 1335,1339 **** page = getDataPage(pos); dataCache.add(page); ! offset = findValuePosition(page, tid); data = page.getData(); l = ByteConversion.byteToInt(data, offset); --- 1237,1241 ---- page = getDataPage(pos); dataCache.add(page); ! offset = page.findValuePosition(tid); data = page.getData(); l = ByteConversion.byteToInt(data, offset); *************** *** 1376,1380 **** public OverflowPage(Page p, byte[] data) throws IOException { ! firstPage = new SinglePage(p, data); firstPage.getPageHeader().setStatus(MULTI_PAGE); } --- 1278,1282 ---- public OverflowPage(Page p, byte[] data) throws IOException { ! firstPage = new SinglePage(p, data, false); firstPage.getPageHeader().setStatus(MULTI_PAGE); } *************** *** 1393,1397 **** DataPage page; if (next > 0) ! page = (DataPage) getDataPage(next); else page = firstPage; --- 1295,1299 ---- DataPage page; if (next > 0) ! page = (DataPage) getDataPage(next, false); else page = firstPage; *************** *** 1460,1464 **** dataCache.remove(page); page.delete(); ! if (next > 0) page = (SinglePage) getDataPage(next); } while (next > 0); } --- 1362,1366 ---- dataCache.remove(page); page.delete(); ! if (next > 0) page = (SinglePage) getDataPage(next, false); } while (next > 0); } *************** *** 1487,1491 **** if (next > 0) { ! page = (SinglePage) getDataPage(next); dataCache.add(page); } --- 1389,1393 ---- if (next > 0) { ! page = (SinglePage) getDataPage(next, false); dataCache.add(page); } *************** *** 1549,1553 **** if (next > 0) { // load next page in chain ! nextPage = (SinglePage) getDataPage(next); dataCache.add(page); page = nextPage; --- 1451,1455 ---- if (next > 0) { // load next page in chain ! nextPage = (SinglePage) getDataPage(next, false); dataCache.add(page); page = nextPage; *************** *** 1579,1583 **** // remove them while (next > 0) { ! nextPage = (SinglePage) getDataPage(next); next = nextPage.getPageHeader().getNextInChain(); nextPage.setDirty(true); --- 1481,1485 ---- // remove them while (next > 0) { ! nextPage = (SinglePage) getDataPage(next, false); next = nextPage.getPageHeader().getNextInChain(); nextPage.setDirty(true); *************** *** 1587,1590 **** --- 1489,1518 ---- } } + + /* (non-Javadoc) + * @see org.exist.storage.store.BFile.DataPage#findValuePosition(short) + */ + public int findValuePosition(short tid) throws IOException { + return 2; + } + + /* (non-Javadoc) + * @see org.exist.storage.store.BFile.DataPage#getNextTID() + */ + public short getNextTID() { + return 1; + } + + /* (non-Javadoc) + * @see org.exist.storage.store.BFile.DataPage#removeTID(short) + */ + public void removeTID(short tid, int length) { + } + + /* (non-Javadoc) + * @see org.exist.storage.store.BFile.DataPage#setOffset(short, int) + */ + public void setOffset(short tid, int offset) { + } } *************** *** 1728,1732 **** try { lock.acquire(Lock.READ_LOCK); ! nextPage = (SinglePage) getDataPage(next); pageLen = nextPage.ph.getDataLength(); offset = 0; --- 1656,1660 ---- try { lock.acquire(Lock.READ_LOCK); ! nextPage = (SinglePage) getDataPage(next, false); pageLen = nextPage.ph.getDataLength(); offset = 0; *************** *** 1774,1778 **** return i; } ! nextPage = (SinglePage) getDataPage(next); pageLen = nextPage.ph.getDataLength(); offset = 0; --- 1702,1706 ---- return i; } ! nextPage = (SinglePage) getDataPage(next, false); pageLen = nextPage.ph.getDataLength(); offset = 0; *************** *** 1838,1842 **** /** ! * Represents a single data page.. * * @author Wolfgang Meier <wol...@ex...> --- 1766,1770 ---- /** ! * Represents a single data page (as opposed to a overflow page). * * @author Wolfgang Meier <wol...@ex...> *************** *** 1845,1852 **** byte[] data = null; - Page page; - BFilePageHeader ph; public SinglePage() throws IOException { --- 1773,1779 ---- byte[] data = null; Page page; BFilePageHeader ph; + short[] offsets = null; public SinglePage() throws IOException { *************** *** 1864,1870 **** fileHeader.setLastDataPage(page.getPageNum()); data = new byte[fileHeader.getWorkSize()]; } ! public SinglePage(Page p, byte[] data) throws IOException { if (p == null) throw new IOException("illegal page"); if (!(p.getPageHeader().getStatus() == RECORD || p.getPageHeader() --- 1791,1800 ---- fileHeader.setLastDataPage(page.getPageNum()); data = new byte[fileHeader.getWorkSize()]; + offsets = new short[32]; + ph.nextTID = 32; + Arrays.fill(offsets, (short)-1); } ! public SinglePage(Page p, byte[] data, boolean initialize) throws IOException { if (p == null) throw new IOException("illegal page"); if (!(p.getPageHeader().getStatus() == RECORD || p.getPageHeader() *************** *** 1877,1882 **** --- 1807,1866 ---- page = p; ph = (BFilePageHeader) page.getPageHeader(); + if(initialize) { + offsets = new short[ph.nextTID]; + readOffsets(); + } } + public final int findValuePosition(short tid) + throws IOException { + return offsets[tid]; + // final int dlen = ph.getDataLength(); + // for(int pos = 0; pos < dlen; ) { + // if (ByteConversion.byteToShort(data, pos) == tid) return pos + 2; + // pos += ByteConversion.byteToInt(data, pos + 2) + 6; + // } + // LOG.warn("tid " + tid + " not found. " + getPageInfo()); + // return -1; + } + + private void readOffsets() throws IOException { + // Arrays.fill(offsets, -1); + final int dlen = ph.getDataLength(); + for(short pos = 0; pos < dlen; ) { + short tid = ByteConversion.byteToShort(data, pos); + offsets[tid] = (short)(pos + 2); + pos += ByteConversion.byteToInt(data, pos + 2) + 6; + } + } + + public short getNextTID() { + for(short i = 0; i < offsets.length; i++) { + if(offsets[i] == -1) + return i; + } + short tid = (short)offsets.length; + ph.nextTID = (short)(ph.nextTID * 2); + short[] t = new short[ph.nextTID]; + Arrays.fill(t, (short)-1); + System.arraycopy(offsets, 0, t, 0, offsets.length); + offsets = t; + return tid; + } + + public void setOffset(short tid, int offset) { + offsets[tid] = (short)offset; + } + + public void removeTID(short tid, int length) throws IOException { + int offset = offsets[tid] - 2; + offsets[tid] = -1; + for(short i = 0; i < offsets.length; i++) { + if(offsets[i] > offset) + offsets[i] -= length; + } + // readOffsets(start); + } + public void delete() throws IOException { // reset page header fields Index: ItemId.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/ItemId.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ItemId.java 3 May 2004 13:08:45 -0000 1.2 --- ItemId.java 10 Aug 2004 20:27:17 -0000 1.3 *************** *** 23,27 **** package org.exist.storage.store; ! class ItemId { --- 23,32 ---- package org.exist.storage.store; ! /** ! * Provides static methods to set or test the status bits of a record identifier ! * in the dom.dbx persistent DOM store. ! * ! * @author wolf ! */ class ItemId { |
From: Wolfgang M. M. <wol...@us...> - 2004-08-10 20:27:28
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24902/src/org/exist/xquery/parser Modified Files: XQueryParserTokenTypes.txt XQueryLexer.java XQueryParser.java XQueryTreeParser.java XQueryParserTokenTypes.java Log Message: Refactored some methods to improve performance during storage and indexing. Index: XQueryTreeParser.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQueryTreeParser.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** XQueryTreeParser.java 7 Aug 2004 16:28:03 -0000 1.18 --- XQueryTreeParser.java 10 Aug 2004 20:27:17 -0000 1.19 *************** *** 114,118 **** case XPOINTER: { ! AST __t277 = _t; org.exist.xquery.parser.XQueryAST tmp1_AST_in = (org.exist.xquery.parser.XQueryAST)_t; match(_t,XPOINTER); --- 114,118 ---- case XPOINTER: { ! AST __t278 = _t; org.exist.xquery.parser.XQueryAST tmp1_AST_in = (org.exist.xquery.parser.XQueryAST)_t; [...2999 lines suppressed...] private static final long[] mk_tokenSet_0() { ! long[] data = { 1442915454462623632L, -5765733423243055566L, 201850867L, 0L, 0L, 0L}; return data; } public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); private static final long[] mk_tokenSet_1() { ! long[] data = { 1152925765217026048L, 0L, 134217731L, 0L, 0L, 0L}; return data; } --- 5414,5423 ---- private static final long[] mk_tokenSet_0() { ! long[] data = { 1442915454462623632L, -5765733423243055566L, 403177459L, 0L, 0L, 0L}; return data; } public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); private static final long[] mk_tokenSet_1() { ! long[] data = { 1152925765217026048L, 0L, 268435459L, 0L, 0L, 0L}; return data; } Index: XQueryParser.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQueryParser.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** XQueryParser.java 7 Aug 2004 16:28:03 -0000 1.18 --- XQueryParser.java 10 Aug 2004 20:27:16 -0000 1.19 *************** *** 5917,5921 **** { ! _loop268: do { if ((_tokenSet_13.member(LA(1)))) { --- 5917,5921 ---- { ! _loop269: do { [...1208 lines suppressed...] data[1]=-18014400656965633L; ! data[2]=35184372088831L; return data; } public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); private static final long[] mk_tokenSet_13() { ! long[] data = { 1152921504606846976L, 1073741824L, 4194307L, 0L, 0L, 0L}; return data; } --- 7115,7124 ---- data[0]=-16L; data[1]=-18014400656965633L; ! data[2]=70368744177663L; return data; } public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); private static final long[] mk_tokenSet_13() { ! long[] data = { 1152921504606846976L, 1073741824L, 8388611L, 0L, 0L, 0L}; return data; } Index: XQueryParserTokenTypes.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQueryParserTokenTypes.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XQueryParserTokenTypes.java 29 Jun 2004 14:23:26 -0000 1.9 --- XQueryParserTokenTypes.java 10 Aug 2004 20:27:17 -0000 1.10 *************** *** 172,198 **** int END_TAG_START = 147; int QUOT = 148; ! int ATTRIBUTE_CONTENT = 149; ! int ELEMENT_CONTENT = 150; ! int XML_COMMENT_END = 151; ! int XML_PI_END = 152; ! int LITERAL_collection = 153; ! int LITERAL_preceding = 154; ! int COMP_DOC_CONSTRUCTOR = 155; ! int XML_PI_START = 156; ! int LETTER = 157; ! int DIGITS = 158; ! int HEX_DIGITS = 159; ! int NMSTART = 160; ! int NMCHAR = 161; ! int WS = 162; ! int EXPR_COMMENT = 163; ! int PREDEFINED_ENTITY_REF = 164; ! int CHAR_REF = 165; ! int NEXT_TOKEN = 166; ! int CHAR = 167; ! int BASECHAR = 168; ! int IDEOGRAPHIC = 169; ! int COMBINING_CHAR = 170; ! int DIGIT = 171; ! int EXTENDER = 172; } --- 172,199 ---- int END_TAG_START = 147; int QUOT = 148; ! int APOS = 149; ! int ATTRIBUTE_CONTENT = 150; ! int ELEMENT_CONTENT = 151; ! int XML_COMMENT_END = 152; ! int XML_PI_END = 153; ! int LITERAL_collection = 154; ! int LITERAL_preceding = 155; ! int COMP_DOC_CONSTRUCTOR = 156; ! int XML_PI_START = 157; ! int LETTER = 158; ! int DIGITS = 159; ! int HEX_DIGITS = 160; ! int NMSTART = 161; ! int NMCHAR = 162; ! int WS = 163; ! int EXPR_COMMENT = 164; ! int PREDEFINED_ENTITY_REF = 165; ! int CHAR_REF = 166; ! int NEXT_TOKEN = 167; ! int CHAR = 168; ! int BASECHAR = 169; ! int IDEOGRAPHIC = 170; ! int COMBINING_CHAR = 171; ! int DIGIT = 172; ! int EXTENDER = 173; } Index: XQueryLexer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQueryLexer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** XQueryLexer.java 7 Aug 2004 16:28:02 -0000 1.12 --- XQueryLexer.java 10 Aug 2004 20:27:16 -0000 1.13 *************** *** 84,88 **** literals.put(new ANTLRHashString("where", this), new Integer(76)); literals.put(new ANTLRHashString("then", this), new Integer(87)); ! literals.put(new ANTLRHashString("preceding", this), new Integer(154)); literals.put(new ANTLRHashString("document-node", this), new Integer(125)); literals.put(new ANTLRHashString("to", this), new Integer(109)); --- 84,88 ---- literals.put(new ANTLRHashString("where", this), new Integer(76)); literals.put(new ANTLRHashString("then", this), new Integer(87)); ! literals.put(new ANTLRHashString("preceding", this), new Integer(155)); literals.put(new ANTLRHashString("document-node", this), new Integer(125)); literals.put(new ANTLRHashString("to", this), new Integer(109)); *************** *** 112,116 **** literals.put(new ANTLRHashString("following-sibling", this), new Integer(138)); literals.put(new ANTLRHashString("node", this), new Integer(121)); ! literals.put(new ANTLRHashString("collection", this), new Integer(153)); literals.put(new ANTLRHashString("some", this), new Integer(73)); literals.put(new ANTLRHashString("ge", this), new Integer(101)); --- 112,116 ---- literals.put(new ANTLRHashString("following-sibling", this), new Integer(138)); literals.put(new ANTLRHashString("node", this), new Integer(121)); ! literals.put(new ANTLRHashString("collection", this), new Integer(154)); literals.put(new ANTLRHashString("some", this), new Integer(73)); literals.put(new ANTLRHashString("ge", this), new Integer(101)); *************** *** 510,513 **** --- 510,526 ---- } + protected final void mAPOS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = APOS; + int _saveIndex; + + match("'"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + protected final void mLTEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; Token _token=null; int _begin=text.length(); *************** *** 2165,2170 **** { ! int _cnt502=0; ! _loop502: do { if ((_tokenSet_3.member(LA(1)))) { --- 2178,2183 ---- { ! int _cnt504=0; ! _loop504: do { if ((_tokenSet_3.member(LA(1)))) { *************** *** 2172,2179 **** } else { ! if ( _cnt502>=1 ) { break _loop502; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } ! _cnt502++; } while (true); } --- 2185,2192 ---- } else { ! if ( _cnt504>=1 ) { break _loop504; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } ! _cnt504++; } while (true); } *************** *** 2316,2321 **** { ! int _cnt505=0; ! _loop505: do { switch ( LA(1)) { --- 2329,2334 ---- { ! int _cnt507=0; ! _loop507: do { switch ( LA(1)) { *************** *** 2341,2348 **** default: { ! if ( _cnt505>=1 ) { break _loop505; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt505++; } while (true); } --- 2354,2361 ---- default: { ! if ( _cnt507>=1 ) { break _loop507; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt507++; } while (true); } *************** *** 3068,3072 **** mNMSTART(false); { ! _loop512: do { if ((_tokenSet_6.member(LA(1)))) { --- 3081,3085 ---- mNMSTART(false); { ! _loop514: do { if ((_tokenSet_6.member(LA(1)))) { *************** *** 3074,3078 **** } else { ! break _loop512; } --- 3087,3091 ---- } else { ! break _loop514; } *************** *** 3093,3098 **** { ! int _cnt515=0; ! _loop515: do { switch ( LA(1)) { --- 3106,3111 ---- { ! int _cnt517=0; ! _loop517: do { switch ( LA(1)) { *************** *** 3122,3129 **** default: { ! if ( _cnt515>=1 ) { break _loop515; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt515++; } while (true); } --- 3135,3142 ---- default: { ! if ( _cnt517>=1 ) { break _loop517; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt517++; } while (true); } *************** *** 3142,3151 **** match("(:"); { ! _loop521: do { ! boolean synPredMatched520 = false; if (((LA(1)==':') && (_tokenSet_7.member(LA(2))) && (_tokenSet_7.member(LA(3))))) { ! int _m520 = mark(); ! synPredMatched520 = true; inputState.guessing++; try { --- 3155,3164 ---- match("(:"); { ! _loop523: do { ! boolean synPredMatched522 = false; if (((LA(1)==':') && (_tokenSet_7.member(LA(2))) && (_tokenSet_7.member(LA(3))))) { ! int _m522 = mark(); ! synPredMatched522 = true; inputState.guessing++; try { *************** *** 3158,3167 **** } catch (RecognitionException pe) { ! synPredMatched520 = false; } ! rewind(_m520); inputState.guessing--; } ! if ( synPredMatched520 ) { match(':'); } --- 3171,3180 ---- } catch (RecognitionException pe) { ! synPredMatched522 = false; } ! rewind(_m522); inputState.guessing--; } ! if ( synPredMatched522 ) { match(':'); } *************** *** 3170,3174 **** } else { ! break _loop521; } --- 3183,3187 ---- } else { ! break _loop523; } *************** *** 3273,3277 **** match('.'); { ! _loop529: do { if ((_tokenSet_3.member(LA(1)))) { --- 3286,3290 ---- match('.'); { ! _loop531: do { if ((_tokenSet_3.member(LA(1)))) { *************** *** 3279,3283 **** } else { ! break _loop529; } --- 3292,3296 ---- } else { ! break _loop531; } *************** *** 3367,3371 **** match('.'); { ! _loop537: do { if ((_tokenSet_3.member(LA(1)))) { --- 3380,3384 ---- match('.'); { ! _loop539: do { if ((_tokenSet_3.member(LA(1)))) { *************** *** 3373,3377 **** } else { ! break _loop537; } --- 3386,3390 ---- } else { ! break _loop539; } *************** *** 3481,3485 **** text.setLength(_saveIndex); { ! _loop547: do { if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) { --- 3494,3498 ---- text.setLength(_saveIndex); { ! _loop549: do { if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) { *************** *** 3503,3507 **** } else { ! break _loop547; } --- 3516,3520 ---- } else { ! break _loop549; } *************** *** 3519,3523 **** text.setLength(_saveIndex); { ! _loop551: do { if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) { --- 3532,3536 ---- text.setLength(_saveIndex); { ! _loop553: do { if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) { *************** *** 3541,3545 **** } else { ! break _loop551; } --- 3554,3558 ---- } else { ! break _loop553; } *************** *** 3569,3574 **** { ! int _cnt554=0; ! _loop554: do { switch ( LA(1)) { --- 3582,3587 ---- { ! int _cnt556=0; ! _loop556: do { switch ( LA(1)) { *************** *** 3642,3649 **** } else { ! if ( _cnt554>=1 ) { break _loop554; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt554++; } while (true); } --- 3655,3662 ---- } else { ! if ( _cnt556>=1 ) { break _loop556; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt556++; } while (true); } *************** *** 3661,3666 **** { ! int _cnt557=0; ! _loop557: do { switch ( LA(1)) { --- 3674,3679 ---- { ! int _cnt559=0; ! _loop559: do { switch ( LA(1)) { *************** *** 3724,3731 **** } else { ! if ( _cnt557>=1 ) { break _loop557; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt557++; } while (true); } --- 3737,3744 ---- } else { ! if ( _cnt559>=1 ) { break _loop559; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt559++; } while (true); } *************** *** 3746,3751 **** text.setLength(_saveIndex); { ! int _cnt564=0; ! _loop564: do { if ((_tokenSet_12.member(LA(1)))) { --- 3759,3764 ---- text.setLength(_saveIndex); { ! int _cnt566=0; ! _loop566: do { if ((_tokenSet_12.member(LA(1)))) { *************** *** 3755,3762 **** } else { ! boolean synPredMatched563 = false; if (((LA(1)=='-'))) { ! int _m563 = mark(); ! synPredMatched563 = true; inputState.guessing++; try { --- 3768,3775 ---- } else { ! boolean synPredMatched565 = false; if (((LA(1)=='-'))) { ! int _m565 = mark(); ! synPredMatched565 = true; inputState.guessing++; try { *************** *** 3769,3785 **** } catch (RecognitionException pe) { ! synPredMatched563 = false; } ! rewind(_m563); inputState.guessing--; } ! if ( synPredMatched563 ) { match('-'); } else { ! if ( _cnt564>=1 ) { break _loop564; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt564++; } while (true); } --- 3782,3798 ---- } catch (RecognitionException pe) { ! synPredMatched565 = false; } ! rewind(_m565); inputState.guessing--; } ! if ( synPredMatched565 ) { match('-'); } else { ! if ( _cnt566>=1 ) { break _loop566; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt566++; } while (true); } *************** *** 3802,3807 **** match(' '); { ! int _cnt571=0; ! _loop571: do { if ((_tokenSet_13.member(LA(1)))) { --- 3815,3820 ---- match(' '); { ! int _cnt573=0; ! _loop573: do { if ((_tokenSet_13.member(LA(1)))) { *************** *** 3811,3818 **** } else { ! boolean synPredMatched570 = false; if (((LA(1)=='?'))) { ! int _m570 = mark(); ! synPredMatched570 = true; inputState.guessing++; try { --- 3824,3831 ---- } else { ! boolean synPredMatched572 = false; if (((LA(1)=='?'))) { ! int _m572 = mark(); ! synPredMatched572 = true; inputState.guessing++; try { *************** *** 3825,3841 **** } catch (RecognitionException pe) { ! synPredMatched570 = false; } ! rewind(_m570); inputState.guessing--; } ! if ( synPredMatched570 ) { match('?'); } else { ! if ( _cnt571>=1 ) { break _loop571; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt571++; } while (true); } --- 3838,3854 ---- } catch (RecognitionException pe) { ! synPredMatched572 = false; } ! rewind(_m572); inputState.guessing--; } ! if ( synPredMatched572 ) { match('?'); } else { ! if ( _cnt573>=1 ) { break _loop573; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } } ! _cnt573++; } while (true); } *************** *** 3882,3889 **** } else { ! boolean synPredMatched588 = false; if (((_tokenSet_15.member(LA(1))) && (_tokenSet_16.member(LA(2))) && (_tokenSet_17.member(LA(3))))) { ! int _m588 = mark(); ! synPredMatched588 = true; inputState.guessing++; try { --- 3895,3902 ---- } else { ! boolean synPredMatched590 = false; if (((_tokenSet_15.member(LA(1))) && (_tokenSet_16.member(LA(2))) && (_tokenSet_17.member(LA(3))))) { ! int _m590 = mark(); ! synPredMatched590 = true; inputState.guessing++; try { *************** *** 3939,3948 **** } catch (RecognitionException pe) { ! synPredMatched588 = false; } ! rewind(_m588); inputState.guessing--; } ! if ( synPredMatched588 ) { mDOUBLE_LITERAL(false); if ( inputState.guessing==0 ) { --- 3952,3961 ---- } catch (RecognitionException pe) { ! synPredMatched590 = false; } ! rewind(_m590); inputState.guessing--; } ! if ( synPredMatched590 ) { mDOUBLE_LITERAL(false); if ( inputState.guessing==0 ) { *************** *** 3963,3970 **** } else { ! boolean synPredMatched574 = false; if (((LA(1)=='<') && (LA(2)=='?'))) { ! int _m574 = mark(); ! synPredMatched574 = true; inputState.guessing++; try { --- 3976,3983 ---- } else { ! boolean synPredMatched576 = false; if (((LA(1)=='<') && (LA(2)=='?'))) { ! int _m576 = mark(); ! synPredMatched576 = true; inputState.guessing++; try { *************** *** 3974,3983 **** } catch (RecognitionException pe) { ! synPredMatched574 = false; } ! rewind(_m574); inputState.guessing--; } ! if ( synPredMatched574 ) { mXML_PI(false); if ( inputState.guessing==0 ) { --- 3987,3996 ---- } catch (RecognitionException pe) { ! synPredMatched576 = false; } ! rewind(_m576); inputState.guessing--; } ! if ( synPredMatched576 ) { mXML_PI(false); if ( inputState.guessing==0 ) { *************** *** 4008,4015 **** } else { ! boolean synPredMatched576 = false; if (((LA(1)=='.') && (LA(2)=='.') && (true))) { ! int _m576 = mark(); ! synPredMatched576 = true; inputState.guessing++; try { --- 4021,4028 ---- } else { ! boolean synPredMatched578 = false; if (((LA(1)=='.') && (LA(2)=='.') && (true))) { ! int _m578 = mark(); ! synPredMatched578 = true; inputState.guessing++; try { *************** *** 4020,4029 **** } catch (RecognitionException pe) { ! synPredMatched576 = false; } ! rewind(_m576); inputState.guessing--; } ! if ( synPredMatched576 ) { mPARENT(false); if ( inputState.guessing==0 ) { --- 4033,4042 ---- } catch (RecognitionException pe) { ! synPredMatched578 = false; } ! rewind(_m578); inputState.guessing--; } ! if ( synPredMatched578 ) { mPARENT(false); if ( inputState.guessing==0 ) { *************** *** 4115,4122 **** } else { ! boolean synPredMatched579 = false; if (((_tokenSet_15.member(LA(1))) && (true) && (true))) { ! int _m579 = mark(); ! synPredMatched579 = true; inputState.guessing++; try { --- 4128,4135 ---- } else { ! boolean synPredMatched581 = false; if (((_tokenSet_15.member(LA(1))) && (true) && (true))) { ! int _m581 = mark(); ! synPredMatched581 = true; inputState.guessing++; try { *************** *** 4145,4154 **** } catch (RecognitionException pe) { ! synPredMatched579 = false; } ! rewind(_m579); inputState.guessing--; } ! if ( synPredMatched579 ) { mDECIMAL_LITERAL(false); if ( inputState.guessing==0 ) { --- 4158,4167 ---- } catch (RecognitionException pe) { ! synPredMatched581 = false; } ! rewind(_m581); inputState.guessing--; } ! if ( synPredMatched581 ) { mDECIMAL_LITERAL(false); if ( inputState.guessing==0 ) { *************** *** 4157,4164 **** } else { ! boolean synPredMatched581 = false; if (((_tokenSet_15.member(LA(1))) && (true) && (true))) { ! int _m581 = mark(); ! synPredMatched581 = true; inputState.guessing++; try { --- 4170,4177 ---- } else { ! boolean synPredMatched583 = false; if (((_tokenSet_15.member(LA(1))) && (true) && (true))) { ! int _m583 = mark(); ! synPredMatched583 = true; inputState.guessing++; try { *************** *** 4169,4178 **** } catch (RecognitionException pe) { ! synPredMatched581 = false; } ! rewind(_m581); inputState.guessing--; } ! if ( synPredMatched581 ) { mDECIMAL_LITERAL(false); if ( inputState.guessing==0 ) { --- 4182,4191 ---- } catch (RecognitionException pe) { ! synPredMatched583 = false; } ! rewind(_m583); inputState.guessing--; } ! if ( synPredMatched583 ) { mDECIMAL_LITERAL(false); if ( inputState.guessing==0 ) { *************** *** 4181,4188 **** } else { ! boolean synPredMatched583 = false; if (((LA(1)=='.') && (true) && (true))) { ! int _m583 = mark(); ! synPredMatched583 = true; inputState.guessing++; try { --- 4194,4201 ---- } else { ! boolean synPredMatched585 = false; if (((LA(1)=='.') && (true) && (true))) { ! int _m585 = mark(); ! synPredMatched585 = true; inputState.guessing++; try { *************** *** 4192,4201 **** } catch (RecognitionException pe) { ! synPredMatched583 = false; } ! rewind(_m583); inputState.guessing--; } ! if ( synPredMatched583 ) { mSELF(false); if ( inputState.guessing==0 ) { --- 4205,4214 ---- } catch (RecognitionException pe) { ! synPredMatched585 = false; } ! rewind(_m585); inputState.guessing--; } ! if ( synPredMatched585 ) { mSELF(false); if ( inputState.guessing==0 ) { *************** *** 4204,4211 **** } else { ! boolean synPredMatched590 = false; if (((_tokenSet_15.member(LA(1))) && (true) && (true))) { ! int _m590 = mark(); ! synPredMatched590 = true; inputState.guessing++; try { --- 4217,4224 ---- } else { ! boolean synPredMatched592 = false; if (((_tokenSet_15.member(LA(1))) && (true) && (true))) { ! int _m592 = mark(); ! synPredMatched592 = true; inputState.guessing++; try { *************** *** 4216,4225 **** } catch (RecognitionException pe) { ! synPredMatched590 = false; } ! rewind(_m590); inputState.guessing--; } ! if ( synPredMatched590 ) { mDECIMAL_LITERAL(false); if ( inputState.guessing==0 ) { --- 4229,4238 ---- } catch (RecognitionException pe) { ! synPredMatched592 = false; } ! rewind(_m592); inputState.guessing--; } ! if ( synPredMatched592 ) { mDECIMAL_LITERAL(false); if ( inputState.guessing==0 ) { Index: XQueryParserTokenTypes.txt =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQueryParserTokenTypes.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** XQueryParserTokenTypes.txt 4 Aug 2004 19:00:06 -0000 1.11 --- XQueryParserTokenTypes.txt 10 Aug 2004 20:27:16 -0000 1.12 *************** *** 146,171 **** END_TAG_START=147 QUOT=148 ! ATTRIBUTE_CONTENT=149 ! ELEMENT_CONTENT=150 ! XML_COMMENT_END=151 ! XML_PI_END=152 ! LITERAL_collection="collection"=153 ! LITERAL_preceding="preceding"=154 ! COMP_DOC_CONSTRUCTOR=155 ! XML_PI_START=156 ! LETTER=157 ! DIGITS=158 ! HEX_DIGITS=159 ! NMSTART=160 ! NMCHAR=161 ! WS=162 ! EXPR_COMMENT=163 ! PREDEFINED_ENTITY_REF=164 ! CHAR_REF=165 ! NEXT_TOKEN=166 ! CHAR=167 ! BASECHAR=168 ! IDEOGRAPHIC=169 ! COMBINING_CHAR=170 ! DIGIT=171 ! EXTENDER=172 --- 146,172 ---- END_TAG_START=147 QUOT=148 ! APOS=149 ! ATTRIBUTE_CONTENT=150 ! ELEMENT_CONTENT=151 ! XML_COMMENT_END=152 ! XML_PI_END=153 ! LITERAL_collection="collection"=154 ! LITERAL_preceding="preceding"=155 ! COMP_DOC_CONSTRUCTOR=156 ! XML_PI_START=157 ! LETTER=158 ! DIGITS=159 ! HEX_DIGITS=160 ! NMSTART=161 ! NMCHAR=162 ! WS=163 ! EXPR_COMMENT=164 ! PREDEFINED_ENTITY_REF=165 ! CHAR_REF=166 ! NEXT_TOKEN=167 ! CHAR=168 ! BASECHAR=169 ! IDEOGRAPHIC=170 ! COMBINING_CHAR=171 ! DIGIT=172 ! EXTENDER=173 |
From: Wolfgang M. M. <wol...@us...> - 2004-08-10 20:27:27
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24902/src/org/exist/xquery Modified Files: ForExpr.java Log Message: Refactored some methods to improve performance during storage and indexing. Index: ForExpr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/ForExpr.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ForExpr.java 10 Aug 2004 12:53:34 -0000 1.6 --- ForExpr.java 10 Aug 2004 20:27:18 -0000 1.7 *************** *** 114,119 **** context.setContextPosition(p); ! // atVal.setValue(p); // seb: this does not create a new Value. the old Value is referenced from results ! at.setValue(new IntegerValue(p)); contextSequence = contextItem.toSequence(); --- 114,120 ---- context.setContextPosition(p); ! // atVal.setValue(p); // seb: this does not create a new Value. the old Value is referenced from results ! if(positionalVariable != null) ! at.setValue(new IntegerValue(p)); contextSequence = contextItem.toSequence(); |
From: Wolfgang M. M. <wol...@us...> - 2004-08-10 20:27:23
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24902/src/org/exist/util Added Files: XMLReaderObjectFactory.java XMLReaderPool.java Log Message: Refactored some methods to improve performance during storage and indexing. --- NEW FILE: XMLReaderObjectFactory.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2000-04, Wolfgang M. Meier (wol...@ex...) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: XMLReaderObjectFactory.java,v 1.1 2004/08/10 20:27:14 wolfgang_m Exp $ */ package org.exist.util; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.apache.commons.pool.BasePoolableObjectFactory; import org.exist.EXistException; import org.exist.storage.BrokerPool; import org.xml.sax.XMLReader; /** * Factory to create new XMLReader objects on demand. The factory is used * by {@link org.exist.util.XMLReaderPool}. * * @author wolf */ public class XMLReaderObjectFactory extends BasePoolableObjectFactory { private final static int VALIDATION_ENABLED = 0; private final static int VALIDATION_AUTO = 1; private final static int VALIDATION_DISABLED = 2; private BrokerPool pool; /** * */ public XMLReaderObjectFactory(BrokerPool pool) { super(); this.pool = pool; } /* (non-Javadoc) * @see org.apache.commons.pool.BasePoolableObjectFactory#makeObject() */ public Object makeObject() throws Exception { System.out.println("Creating new SAXReader"); Configuration config = pool.getConfiguration(); // get validation settings int validation = VALIDATION_AUTO; String option = (String) config.getProperty("indexer.validation"); if (option != null) { if (option.equals("true")) validation = VALIDATION_ENABLED; else if (option.equals("auto")) validation = VALIDATION_AUTO; else validation = VALIDATION_DISABLED; } // create a SAX parser SAXParserFactory saxFactory = SAXParserFactory.newInstance(); if (validation == VALIDATION_AUTO || validation == VALIDATION_ENABLED) saxFactory.setValidating(true); else saxFactory.setValidating(false); saxFactory.setNamespaceAware(true); try { saxFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", true); saxFactory.setFeature("http://apache.org/xml/features/validation/dynamic", validation == VALIDATION_AUTO); saxFactory.setFeature("http://apache.org/xml/features/validation/schema", validation == VALIDATION_AUTO || validation == VALIDATION_ENABLED); SAXParser sax = saxFactory.newSAXParser(); XMLReader parser = sax.getXMLReader(); return parser; } catch (ParserConfigurationException e) { throw new EXistException(e); } } } --- NEW FILE: XMLReaderPool.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2000-04, Wolfgang M. Meier (wol...@ex...) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: XMLReaderPool.java,v 1.1 2004/08/10 20:27:14 wolfgang_m Exp $ */ package org.exist.util; import org.apache.commons.pool.PoolableObjectFactory; import org.apache.commons.pool.impl.StackObjectPool; import org.xml.sax.XMLReader; /** * Maintains a pool of XMLReader objects. The pool is available through * {@link BrokerPool#getParserPool()}. * * @author wolf */ public class XMLReaderPool extends StackObjectPool { /** * @param arg0 * @param arg1 * @param arg2 */ public XMLReaderPool(PoolableObjectFactory factory, int maxIdle, int initIdleCapacity) { super(factory, maxIdle, initIdleCapacity); } public synchronized XMLReader borrowXMLReader() { try { return (XMLReader)borrowObject(); } catch(Exception e) { throw new IllegalStateException("error while returning XMLReader: " + e.getMessage()); } } public synchronized void returnXMLReader(XMLReader reader) { try { returnObject(reader); } catch (Exception e) { throw new IllegalStateException("error while returning XMLReader: " + e.getMessage()); } } } |
From: Wolfgang M. M. <wol...@us...> - 2004-08-10 20:06:17
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21246/src/org/exist/xmldb Modified Files: LocalXMLResource.java Log Message: BrokerPool object not properly returned in getContentAsSAX (leads to deadlocks). Index: LocalXMLResource.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalXMLResource.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** LocalXMLResource.java 3 Aug 2004 15:25:58 -0000 1.38 --- LocalXMLResource.java 10 Aug 2004 20:06:03 -0000 1.39 *************** *** 246,250 **** } finally { closeDocument(document, Lock.READ_LOCK); - pool.release(broker); } } --- 246,249 ---- *************** *** 255,258 **** --- 254,259 ---- throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e .getMessage(), e); + } finally { + pool.release(broker); } } |
From: shorrall <hor...@im...> - 2004-08-10 16:43:25
|
Hi, I've been having some trouble installing exist 1.0b1 with Tomcat 5.0. I receive the following error when accessing the status page: An Error Occurred Unable to get transformer handler for file:c:/program files/apache software foundation/Tomcat 5.0 /webapps/exist-1.0b1/stylesheets/system/directory2html.xsl (System cannot find the file specified) I've tried re-installing and playing with various settings but I still get the same result. There doesn't appear to be a file named directory2html.xsl, but rather directory2html.xslt. I've seen some posting concerning this problem, but no answers. Thanks |
From: Jean-Marc V. <jm...@us...> - 2004-08-10 14:19:32
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16893/src/org/exist/schema Modified Files: GenericSchemaService.java Log Message: Using XUpdate to update the .index of XSD's versus traget namespaces, it works now also in local mode. Index: GenericSchemaService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/schema/GenericSchemaService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GenericSchemaService.java 7 Aug 2004 14:52:27 -0000 1.1 --- GenericSchemaService.java 10 Aug 2004 14:19:23 -0000 1.2 *************** *** 1,4 **** /* ! * Created on Apr 10, 2004 * */ --- 1,23 ---- /* ! * eXist Open Source Native XML Database ! * Copyright (C) 2001-04 Wolfgang M. Meier ! * wol...@ex... ! * http://exist.sourceforge.net ! * ! * This program is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Lesser General Public License ! * as published by the Free Software Foundation; either version 2 ! * of the License, or (at your option) any later version. ! * ! * This program is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU Lesser General Public License for more details. ! * ! * You should have received a copy of the GNU Lesser General Public License ! * along with this program; if not, write to the Free Software ! * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ! * ! * Created on Apr 10, 2004; Sebastian Bossung, TUHH * */ *************** *** 20,24 **** import org.apache.tools.ant.filters.StringInputStream; import org.apache.xerces.parsers.DOMParser; - import org.exist.xmldb.XQueryService; import org.exolab.castor.xml.schema.AttributeDecl; import org.exolab.castor.xml.schema.ElementDecl; --- 39,42 ---- *************** *** 26,34 **** import org.exolab.castor.xml.schema.XMLType; import org.exolab.castor.xml.schema.reader.SchemaReader; - import org.w3c.dom.Attr; import org.w3c.dom.Document; - import org.w3c.dom.Element; import org.w3c.dom.Node; - import org.w3c.dom.NodeList; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; --- 44,49 ---- *************** *** 38,45 **** --- 53,63 ---- import org.xmldb.api.base.ErrorCodes; import org.xmldb.api.base.Resource; + import org.xmldb.api.base.ResourceIterator; import org.xmldb.api.base.ResourceSet; import org.xmldb.api.base.XMLDBException; import org.xmldb.api.modules.CollectionManagementService; import org.xmldb.api.modules.XMLResource; + import org.xmldb.api.modules.XPathQueryService; + import org.xmldb.api.modules.XUpdateQueryService; /** *************** *** 98,102 **** protected Logger LOG = Logger.getLogger(GenericSchemaService.class); ! private final static String INDEX_RESOURCE_NAME = ".index"; private static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; --- 116,121 ---- protected Logger LOG = Logger.getLogger(GenericSchemaService.class); ! protected final static String INDEX_COLLECTION_NAME = "/db/system/schema/"; ! protected final static String INDEX_RESOURCE_NAME = ".index"; private static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; *************** *** 131,135 **** } ! private XMLResource getIndexResource() throws XMLDBException { XMLResource index = null; try { --- 150,160 ---- } ! /** ! * Test whether the index resource ".index" already exists. If not, creates it and ! * fills it with skeleton contents. Returns the (possible newly created) resource. ! * @return ! * @throws XMLDBException ! */ ! protected XMLResource testAndCreateIndexResource() throws XMLDBException { XMLResource index = null; try { *************** *** 145,174 **** } - private String getSchemaFilename(String targetNamespace) throws XMLDBException { - if (targetNamespace == null) - throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "null is not a valid namespace!"); - - XMLResource index = getIndexResource(); - String filename = null; - - Node root = index.getContentAsDOM(); - - if ("schema-index".equals(root.getNodeName())) { - NodeList schemas = root.getChildNodes(); - for (int i = 0; i < schemas.getLength(); i++) { - Node schema = schemas.item(i); - if ("schema".equals(schema.getNodeName())) { - Node targetNamespaceAttr = schema.getAttributes().getNamedItem("targetNamespace"); - if ((targetNamespaceAttr != null) && (targetNamespace.equals(targetNamespaceAttr.getNodeValue()))) - return schema.getAttributes().getNamedItem("resourceName").getNodeValue(); - } - } - } else { - throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "invalid schema index. Unexpected root element " + root.getNodeName(), null); - } - return filename; - } ! private Collection getSchemasCollection() throws XMLDBException { if (schemasCollection == null) { Collection parent = getParentCollection(); --- 170,175 ---- } ! protected Collection getSchemasCollection() throws XMLDBException { if (schemasCollection == null) { Collection parent = getParentCollection(); *************** *** 191,195 **** } ! private String findTargetNamespace(String schemaContents) throws XMLDBException { String targetNamespace = null; DOMParser parser = new DOMParser(); --- 192,202 ---- } ! /** ! * Finds the target namespace in the given schema. ! * @param schemaContents ! * @return ! * @throws XMLDBException ! */ ! protected String findTargetNamespace(String schemaContents) throws XMLDBException { String targetNamespace = null; DOMParser parser = new DOMParser(); *************** *** 208,213 **** } public void putSchema(String schemaContents) throws XMLDBException { - Collection schemasCollection = getSchemasCollection(); String targetNamespace = findTargetNamespace(schemaContents); --- 215,223 ---- } + /** + * Add a schema to the schema store. The schema must have a target namespace because it can otherwise not + * be indexed. + */ public void putSchema(String schemaContents) throws XMLDBException { Collection schemasCollection = getSchemasCollection(); String targetNamespace = findTargetNamespace(schemaContents); *************** *** 224,248 **** schemasCollection.close(); } ! ! private void addToIndex(String targetNamespace, String filename) throws XMLDBException { ! XMLResource index = getIndexResource(); ! Node rootNode = index.getContentAsDOM(); ! Document doc = rootNode.getOwnerDocument(); ! Element schemaNode = doc.createElement("schema"); ! // Attr targetNamespaceAttr = doc.createAttribute("targetNamespace"); ! // // jmv: targetNamespaceAttr.setNodeValue(targetNamespace); ! // targetNamespaceAttr.setValue(targetNamespace); // jmv ! // Attr resourceNameAttr = doc.createAttribute("resourceName"); ! // resourceNameAttr.setValue(filename); // jmv ! // schemaNode.getAttributes().setNamedItem(targetNamespaceAttr); ! // schemaNode.getAttributes().setNamedItem(resourceNameAttr); ! schemaNode.setAttribute("targetNamespace", targetNamespace); ! schemaNode.setAttribute("resourceName", filename); ! ! rootNode.appendChild(schemaNode); ! index.setContentAsDOM(rootNode); ! getSchemasCollection().storeResource(index); // jmv: this doesn't update the .index document ???!!! ! } ! public XMLResource getSchema(String targetNamespace) throws XMLDBException { String filename = getSchemaFilename(targetNamespace); --- 234,242 ---- schemasCollection.close(); } ! ! /** ! * Retrieves the schema as an XML resources. ! * @return the schema with targetNamespace or null if that schema is not known. ! */ public XMLResource getSchema(String targetNamespace) throws XMLDBException { String filename = getSchemaFilename(targetNamespace); *************** *** 252,255 **** --- 246,256 ---- return null; } + + /** + * Validates the passed contents. Schemas are automatically obtained from the schema store. You can + * add transient ("temporary") schemas with the <code>registerTransientSchema</code> method. + * @throws XMLDBException if a database error occurs or the contents contains validation errors (these are + * wrapped in XMLDBExceptions). + */ public boolean validateContents(String contents) throws XMLDBException { try { *************** *** 303,306 **** --- 304,310 ---- } + /** + * Validates a resource given its id. Uses <code>validateContents</code>. + */ public boolean validateResource(String id) throws XMLDBException { Resource doc = getParentCollection().getResource(id); *************** *** 322,325 **** --- 326,331 ---- /** + * Searches an instance document for namespaces. All discovered namespaces are added to the + * <code>namespaces</code> Set. * @param root * @return *************** *** 348,370 **** */ public AttributeDecl getAttribute(QName qname) throws XMLDBException { ! String xquery = ! "declare namespace xs=\"" ! + W3C_XML_SCHEMA ! + "\";" ! + "/xs:schema[@targetNamespace=\"" ! + qname.getNamespaceURI() ! + "\"]/xs:attribute[@name=\"" ! + qname.getLocalPart() ! + "\"]"; ! XQueryService service = (XQueryService) getSchemasCollection().getService("XQueryService", "1.0"); ! ResourceSet result = service.query(xquery); ! if (result.getSize() == 0) ! return null; ! else if (result.getSize() > 1) ! throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "Found multiple types by name " + qname, null); ! else { ! //return result.getResource(0); ! return null; ! } } --- 354,358 ---- */ public AttributeDecl getAttribute(QName qname) throws XMLDBException { ! return getCastorSchema(qname.getNamespaceURI()).getAttribute(qname.getLocalPart()); } *************** *** 373,395 **** */ public ElementDecl getElement(QName qname) throws XMLDBException { ! String xquery = ! "declare namespace xs=\"" ! + W3C_XML_SCHEMA ! + "\";" ! + "/xs:schema[@targetNamespace=\"" ! + qname.getNamespaceURI() ! + "\"]/xs:element[@name=\"" ! + qname.getLocalPart() ! + "\"]"; ! XQueryService service = (XQueryService) getSchemasCollection().getService("XQueryService", "1.0"); ! ResourceSet result = service.query(xquery); ! if (result.getSize() == 0) ! return null; ! else if (result.getSize() > 1) ! throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "Found multiple types by name " + qname, null); ! else { ! //return result.getResource(0); ! return null; ! } } --- 361,365 ---- */ public ElementDecl getElement(QName qname) throws XMLDBException { ! return getCastorSchema(qname.getNamespaceURI()).getElementDecl(qname.getLocalPart()); } *************** *** 398,421 **** */ public XMLType getType(QName qname) throws XMLDBException { ! /*String xquery = "declare namespace xs=\"" + W3C_XML_SCHEMA + "\";" + ! "/xs:schema[@targetNamespace=\"" + qname.getNamespaceURI() + ! "\"]/(xs:complexType|xs:simpleType)[@name=\"" + qname.getLocalPart() + "\"]"; ! XQueryService service = (XQueryService) getSchemasCollection().getService("XQueryService", "1.0"); ! ResourceSet result = service.query(xquery); ! if (result.getSize() == 0) return null; ! else if (result.getSize() > 1) throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "Found multiple types by name " + qname, null); ! else { ! //return result.getResource(0); ! return new Object(); ! }*/ ! XMLResource resource = getSchema(qname.getNamespaceURI()); try { Schema schema = (new SchemaReader((String) resource.getContent())).read(); ! return schema.getType(qname.getLocalPart()); } catch (IOException e) { ! throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "Error reading schema information for target namespace: " + qname.getNamespaceURI(), e); } } ! /** * --- 368,385 ---- */ public XMLType getType(QName qname) throws XMLDBException { ! return getCastorSchema(qname.getNamespaceURI()).getType(qname.getLocalPart()); ! } ! ! private Schema getCastorSchema(String namespaceURI) throws XMLDBException { ! XMLResource resource = getSchema(namespaceURI); try { Schema schema = (new SchemaReader((String) resource.getContent())).read(); ! return schema; } catch (IOException e) { ! throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "Error reading schema information for target namespace: " + namespaceURI, e); } + } ! /** * *************** *** 440,442 **** --- 404,476 ---- } + XUpdateQueryService updateService = null; + + XPathQueryService queryService = null; + + protected String getDocumentExpression() { + return "document('" + INDEX_COLLECTION_NAME + INDEX_RESOURCE_NAME + "')"; + } + + protected String getRetrieveIndexRecordQuery(String targetNamespace) { + return "/schema-index/schema[@targetNamespace=\"" + targetNamespace + "\"]"; + } + + protected String getAppendSchemaXUpdate(String targetNamespace, String resourceName) { + return "<xupdate:modifications version=\"1.0\" xmlns:xupdate=\"http://www.xmldb.org/xupdate\">" + + "<xupdate:append select=\"" + getDocumentExpression() + "/schema-index\">" + + "<xupdate:element name=\"schema\">" + "<xupdate:attribute name=\"targetNamespace\">" + targetNamespace + + "</xupdate:attribute>" + "<xupdate:attribute name=\"resourceName\">" + resourceName + "</xupdate:attribute>" + + "</xupdate:element>" + "</xupdate:append>" + "</xupdate:modifications>"; + } + + /** + * Retrieve the filename of the resource that stores the schema for <code>targetNamespace</code> + * @param targetNamespace + * @return the resource name or null if the schema is not in the index. + * @throws XMLDBException + */ + protected String getSchemaFilename(String targetNamespace) throws XMLDBException { + if (targetNamespace == null) + throw new XMLDBException(ErrorCodes.VENDOR_ERROR, "null is not a valid namespace!"); + // make sure, the index resource exists: + testAndCreateIndexResource(); + // try to find the name of the resource that stores the respective schema: + String query = getRetrieveIndexRecordQuery(targetNamespace) + "/@resourceName"; + ResourceSet set = getXQueryService().queryResource(INDEX_RESOURCE_NAME, query); + if (set.getSize() == 1) { + ResourceIterator iterator = set.getIterator(); + return iterator.nextResource().getContent().toString(); + } else if (set.getSize() == 0) { + return null; + } else + throw new XMLDBException(ErrorCodes.VENDOR_ERROR, + "Multiple index entries for one targetNamespace in the schema index. The index is corrupt."); + } + + /** + * Insert a new element in the schema-index. This method is called only if a new schema with a previously + * unknown target namespace is indexed. Known schemas are indexed by updating the existent resource. + * @param targetNamespace of the schema + * @param resourceName the name of the resource that stores the schema + * @throws XMLDBException + * + */ + protected void addToIndex(String targetNamespace, String resourceName) throws XMLDBException { + getXUpdateService().update(getAppendSchemaXUpdate(targetNamespace, resourceName)); + } + + protected XUpdateQueryService getXUpdateService() throws XMLDBException { + if (updateService == null) + updateService = (XUpdateQueryService) getSchemasCollection().getService("XUpdateQueryService", "1.0"); + ; + return updateService; + } + + protected XPathQueryService getXQueryService() throws XMLDBException { + if (queryService == null) + queryService = (XPathQueryService) getSchemasCollection().getService("XPathQueryService", "1.0"); + ; + return queryService; + } + } |
From: Jean-Marc V. <jm...@us...> - 2004-08-10 12:53:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1272/src/org/exist/xquery Modified Files: ForExpr.java Log Message: BUG: for $b at $p in /* return $p } returned: 7 7 7 7 Index: ForExpr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/ForExpr.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ForExpr.java 28 May 2004 10:54:12 -0000 1.5 --- ForExpr.java 10 Aug 2004 12:53:34 -0000 1.6 *************** *** 113,118 **** contextItem = i.nextItem(); context.setContextPosition(p); ! atVal.setValue(p); ! contextSequence = contextItem.toSequence(); if(sequenceType != null) --- 113,120 ---- contextItem = i.nextItem(); context.setContextPosition(p); ! ! // atVal.setValue(p); // seb: this does not create a new Value. the old Value is referenced from results ! at.setValue(new IntegerValue(p)); ! contextSequence = contextItem.toSequence(); if(sequenceType != null) |
From: Wolfgang M. M. <wol...@us...> - 2004-08-10 06:07:37
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5069/src/org/exist/security Modified Files: security.properties Log Message: Switched password encoding back to md5. I set this to simple-md5 by mistake. Index: security.properties =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/security/security.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** security.properties 28 Jul 2004 18:55:05 -0000 1.5 --- security.properties 10 Aug 2004 06:07:19 -0000 1.6 *************** *** 10,12 **** # the database will not recognize the old passwords. ! passwords.encoding=simple-md5 --- 10,12 ---- # the database will not recognize the old passwords. ! passwords.encoding=md5 |
From: Wolfgang M. M. <wol...@us...> - 2004-08-09 11:43:18
|
Update of /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14425/src/org/dbxml/core/filer Modified Files: Paged.java Log Message: Removed an exensive check in unlinkPages, which slowed down document and collection removal. Index: Paged.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/Paged.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Paged.java 28 Jul 2004 18:55:05 -0000 1.25 --- Paged.java 9 Aug 2004 11:43:09 -0000 1.26 *************** *** 432,437 **** // if(getFile().getName().equals("words.dbx")) // LOG.debug("freeing page " + page.getPageNum()); ! if(isRemovedPage(page.getPageNum())) ! return; // Walk the chain and add it to the unused list page.header.setStatus(UNUSED); --- 432,437 ---- // if(getFile().getName().equals("words.dbx")) // LOG.debug("freeing page " + page.getPageNum()); ! // if(isRemovedPage(page.getPageNum())) ! // return; // Walk the chain and add it to the unused list page.header.setStatus(UNUSED); |
From: Wolfgang M. M. <wol...@us...> - 2004-08-09 10:25:42
|
Update of /cvsroot/exist/eXist-1.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2227 Modified Files: build.xml Log Message: target test should create junit output dir or it will fail. Index: build.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/build.xml,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** build.xml 28 May 2004 10:54:12 -0000 1.50 --- build.xml 9 Aug 2004 10:25:17 -0000 1.51 *************** *** 244,247 **** --- 244,248 ---- <fileset dir="webapp/WEB-INF/data" includes="*.dbx"/> </delete> + <mkdir dir="${junit.reports}"/> <junit haltonfailure="yes" printsummary="yes" showoutput="${junit.output}"> |
From: Wolfgang M. M. <wol...@us...> - 2004-08-09 10:24:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/test/results In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1996/src/org/exist/xupdate/test/results Added Files: append_child.xml append_attribute.xml Log Message: Fixed: append an attribute to an element. Added corresponding XUpdate test cases. --- NEW FILE: append_attribute.xml --- <?xml version="1.0" encoding="UTF-8"?> <addressbook> <address> <fname>John</fname> <lname>Jekyll</lname> <company id="555">Johnny's Car Wash</company> <city>Bloomington</city> <email type="work">jo...@ca...</email> </address> <address> <fname>Andrew</fname> <lname>Hyde</lname> <company>Null-Devices</company> <city>Washington</city> </address> </addressbook> --- NEW FILE: append_child.xml --- <?xml version="1.0" encoding="UTF-8"?> <addressbook> <address> <fname>John</fname> <lname>Jekyll</lname> <email type="home">je...@fo...</email> <company>Johnny's Car Wash</company> <city>Bloomington</city> <email type="work">jo...@ca...</email> </address> <address> <email type="home">an...@fo...</email> <fname>Andrew</fname> <lname>Hyde</lname> <company>Null-Devices</company> <city>Washington</city> </address> </addressbook> |
From: Wolfgang M. M. <wol...@us...> - 2004-08-09 10:24:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/test/modifications In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1996/src/org/exist/xupdate/test/modifications Added Files: append_child.xml append_attribute.xml Log Message: Fixed: append an attribute to an element. Added corresponding XUpdate test cases. --- NEW FILE: append_attribute.xml --- <?xml version="1.0" encoding="UTF-8"?> <xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate"> <xu:append select="//address[lname &= 'jekyll']/company"> <xu:attribute name="id">555</xu:attribute> </xu:append> </xu:modifications> --- NEW FILE: append_child.xml --- <?xml version="1.0" encoding="UTF-8"?> <xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate"> <xu:append select="//address[lname &= 'hyde']" child="1"> <xu:element name="email"> <xu:attribute name="type">home</xu:attribute> an...@fo... </xu:element> </xu:append> <xu:append select="//address[lname &= 'jekyll']" child="3"> <xu:element name="email"> <xu:attribute name="type">home</xu:attribute> je...@fo... </xu:element> </xu:append> </xu:modifications> |
From: Wolfgang M. M. <wol...@us...> - 2004-08-09 10:24:42
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1996/src/org/exist/dom Modified Files: ElementImpl.java Log Message: Fixed: append an attribute to an element. Added corresponding XUpdate test cases. Index: ElementImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/ElementImpl.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ElementImpl.java 12 Jul 2004 17:17:40 -0000 1.44 --- ElementImpl.java 9 Aug 2004 10:24:31 -0000 1.45 *************** *** 281,288 **** } else { NodeImpl lastAttrib = getLastAttribute(); ! if(lastAttrib.gid == lastChildID()) node = appendChildren(lastChildID() + 1, lastAttrib, getPath(), attribs, true); else ! node = insertAfter(attribs, lastAttrib); } ownerDocument.broker.update(this); --- 281,288 ---- } else { NodeImpl lastAttrib = getLastAttribute(); ! if(lastAttrib != null && lastAttrib.gid == lastChildID()) node = appendChildren(lastChildID() + 1, lastAttrib, getPath(), attribs, true); else ! node = appendChildren(firstChildID() + 1, this, getPath(), attribs, true); } ownerDocument.broker.update(this); *************** *** 1112,1120 **** */ public Node insertAfter(NodeList nodes, Node refChild) throws DOMException { - if (!(refChild instanceof NodeImpl)) - throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, "wrong node type"); - final DocumentImpl prevDoc = new DocumentImpl(ownerDocument); if (refChild == null) return appendChildren(nodes, -1); final NodeImpl ref = (NodeImpl) refChild; final long first = firstChildID(); --- 1112,1120 ---- */ public Node insertAfter(NodeList nodes, Node refChild) throws DOMException { if (refChild == null) return appendChildren(nodes, -1); + if (!(refChild instanceof NodeImpl)) + throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, "wrong node type: "); + final DocumentImpl prevDoc = new DocumentImpl(ownerDocument); final NodeImpl ref = (NodeImpl) refChild; final long first = firstChildID(); |
From: Wolfgang M. M. <wol...@us...> - 2004-08-09 10:24:42
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1996/src/org/exist/xmldb Modified Files: LocalCollection.java Log Message: Fixed: append an attribute to an element. Added corresponding XUpdate test cases. Index: LocalCollection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalCollection.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** LocalCollection.java 7 Aug 2004 14:55:59 -0000 1.40 --- LocalCollection.java 9 Aug 2004 10:24:31 -0000 1.41 *************** *** 37,41 **** import org.apache.log4j.Logger; import org.exist.EXistException; - import org.exist.Indexer; import org.exist.collections.Collection; import org.exist.collections.IndexInfo; --- 37,40 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-08-09 10:24:42
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1996/src/org/exist/xupdate/test Modified Files: XUpdateTestCases.java AllTests.java Log Message: Fixed: append an attribute to an element. Added corresponding XUpdate test cases. Index: XUpdateTestCases.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/test/XUpdateTestCases.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** XUpdateTestCases.java 15 Dec 2003 13:15:10 -0000 1.2 --- XUpdateTestCases.java 9 Aug 2004 10:24:31 -0000 1.3 *************** *** 26,31 **** --- 26,34 ---- public void remove() throws Exception { test.doTest("remove", "address.xml"); }; public void update() throws Exception { test.doTest("update", "address.xml"); }; + public void appendAttribute() throws Exception { test.doTest("append_attribute", "address.xml"); }; + public void appendChild() throws Exception { test.doTest("append_child", "address.xml"); }; public void insertafter_big() throws Exception { test.doTest("insertafter_big", "address_big.xml"); }; + // <add a new TestCase Method here> Index: AllTests.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/test/AllTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AllTests.java 24 May 2003 21:01:40 -0000 1.1 --- AllTests.java 9 Aug 2004 10:24:31 -0000 1.2 *************** *** 25,29 **** suite.addTest(new XUpdateTestCases("remove", test)); suite.addTest(new XUpdateTestCases("update", test)); ! suite.addTest(new XUpdateTestCases("insertafter_big", test)); --- 25,30 ---- suite.addTest(new XUpdateTestCases("remove", test)); suite.addTest(new XUpdateTestCases("update", test)); ! suite.addTest(new XUpdateTestCases("appendAttribute", test)); ! suite.addTest(new XUpdateTestCases("appendChild", test)); suite.addTest(new XUpdateTestCases("insertafter_big", test)); |
From: Wolfgang M. M. <wol...@us...> - 2004-08-08 19:03:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv796/src/org/exist/xquery/parser Modified Files: XQuery.g Log Message: Fixed wrong handling of default namespaces, introduced by my previous changes. Index: XQuery.g =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQuery.g,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** XQuery.g 7 Aug 2004 16:28:03 -0000 1.22 --- XQuery.g 8 Aug 2004 19:03:26 -0000 1.23 *************** *** 844,855 **** } : ! name=q:qName! EQ! QUOT! ! { lexer.inAttributeContent= true; } ! value:attributeValue { lexer.inAttributeContent= false; } ! QUOT! { lexer.parseStringLiterals= true; } { ! #attributeDef= #(#[ATTRIBUTE, name], #value); ! #attributeDef.copyLexInfo(#q); ! } ; --- 844,862 ---- } : ! name=q:qName! EQ! ! ( ! QUOT! ! { lexer.inAttributeContent= true; } ! attributeValue { lexer.inAttributeContent= false; } ! QUOT! { lexer.parseStringLiterals= true; } ! | ! APOS! { lexer.inAttributeContent= true; } ! attributeValue { lexer.inAttributeContent= false; } ! APOS! { lexer.parseStringLiterals= true; } ! ) { ! #attributeDef= #(#[ATTRIBUTE, name], #attributeDef); ! #attributeDef.copyLexInfo(#q); ! } ; *************** *** 2633,2636 **** --- 2640,2644 ---- protected GTEQ : ">=" ; protected QUOT : '"' ; + protected APOS : "'"; protected LTEQ : "<=" ; |
From: Wolfgang M. M. <wol...@us...> - 2004-08-08 19:03:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv796/src/org/exist/xquery Modified Files: XQuery.java ElementConstructor.java Log Message: Fixed wrong handling of default namespaces, introduced by my previous changes. Index: XQuery.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XQuery.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XQuery.java 7 Aug 2004 16:28:02 -0000 1.3 --- XQuery.java 8 Aug 2004 19:03:26 -0000 1.4 *************** *** 84,88 **** AST ast = parser.getAST(); ! LOG.debug("Generated AST: " + ast.toStringTree()); PathExpr expr = new PathExpr(context); treeParser.xpath(ast, expr); --- 84,88 ---- AST ast = parser.getAST(); ! // LOG.debug("Generated AST: " + ast.toStringTree()); PathExpr expr = new PathExpr(context); treeParser.xpath(ast, expr); Index: ElementConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/ElementConstructor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ElementConstructor.java 7 Aug 2004 16:28:02 -0000 1.6 --- ElementConstructor.java 8 Aug 2004 19:03:26 -0000 1.7 *************** *** 64,68 **** public void addAttribute(AttributeConstructor attr) { if(attr.isNamespaceDeclaration()) { ! addNamespaceDecl(QName.extractLocalName(attr.getQName()), attr.getLiteralValue()); } else if(attributes == null) { attributes = new AttributeConstructor[1]; --- 64,71 ---- public void addAttribute(AttributeConstructor attr) { if(attr.isNamespaceDeclaration()) { ! if(attr.getQName().equals("xmlns")) ! addNamespaceDecl("", attr.getLiteralValue()); ! else ! addNamespaceDecl(QName.extractLocalName(attr.getQName()), attr.getLiteralValue()); } else if(attributes == null) { attributes = new AttributeConstructor[1]; *************** *** 77,80 **** --- 80,84 ---- public void addNamespaceDecl(String prefix, String uri) { + System.out.println(prefix + "=" + uri); if(namespaceDecls == null) { namespaceDecls = new QName[1]; *************** *** 127,131 **** constructor = (AttributeConstructor)attributes[i]; attrValues = constructor.eval(contextSequence, contextItem); ! attrQName = QName.parse(context, constructor.getQName()); attrs.addAttribute(attrQName.getNamespaceURI(), attrQName.getLocalName(), attrQName.toString(), "CDATA", attrValues.getStringValue()); --- 131,135 ---- constructor = (AttributeConstructor)attributes[i]; attrValues = constructor.eval(contextSequence, contextItem); ! attrQName = QName.parse(context, constructor.getQName(), ""); attrs.addAttribute(attrQName.getNamespaceURI(), attrQName.getLocalName(), attrQName.toString(), "CDATA", attrValues.getStringValue()); |
From: Wolfgang M. M. <wol...@us...> - 2004-08-08 19:03:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv796/src/org/exist/xmldb/test Modified Files: DOMTestJUnit.java Log Message: Fixed wrong handling of default namespaces, introduced by my previous changes. Index: DOMTestJUnit.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/DOMTestJUnit.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DOMTestJUnit.java 7 Aug 2004 16:59:31 -0000 1.1 --- DOMTestJUnit.java 8 Aug 2004 19:03:25 -0000 1.2 *************** *** 1,4 **** /* ! * Created on 7 août 2004 $Id$ */ --- 1,4 ---- /* ! * Created on 7 ao�t 2004 $Id$ */ *************** *** 16,19 **** --- 16,20 ---- import junit.framework.TestCase; + import junit.textui.TestRunner; /** *************** *** 99,101 **** --- 100,106 ---- assertEquals( "One more element after update", 2, rootElem.getChildNodes().getLength() ); } + + public static void main(String[] args) { + TestRunner.run(DOMTestJUnit.class); + } } |
From: Wolfgang M. M. <wol...@us...> - 2004-08-08 19:03:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/util/serializer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv796/src/org/exist/util/serializer Modified Files: DOMStreamer.java Log Message: Fixed wrong handling of default namespaces, introduced by my previous changes. Index: DOMStreamer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/serializer/DOMStreamer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DOMStreamer.java 7 Aug 2004 16:28:02 -0000 1.6 --- DOMStreamer.java 8 Aug 2004 19:03:25 -0000 1.7 *************** *** 155,160 **** for (int i = 0; i < attrs.getLength(); i++) { nextAttr = (Attr) attrs.item(i); - System.out.println("attr = " + nextAttr.getName()); attrName = nextAttr.getName(); if (attrName.equals("xmlns")) { if (nsSupport.getURI("") == null) { --- 155,160 ---- for (int i = 0; i < attrs.getLength(); i++) { nextAttr = (Attr) attrs.item(i); attrName = nextAttr.getName(); + System.out.println("Attr = " + attrName); if (attrName.equals("xmlns")) { if (nsSupport.getURI("") == null) { *************** *** 164,168 **** } } else if (attrName.startsWith("xmlns:")) { - System.out.println("Found " + attrName); prefix = attrName.substring(6); if (nsSupport.getURI(prefix) == null) { --- 164,167 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-08-08 19:03:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/memtree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv796/src/org/exist/memtree Modified Files: NodeImpl.java NamespaceNode.java Log Message: Fixed wrong handling of default namespaces, introduced by my previous changes. Index: NodeImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/memtree/NodeImpl.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NodeImpl.java 7 Aug 2004 16:28:02 -0000 1.17 --- NodeImpl.java 8 Aug 2004 19:03:25 -0000 1.18 *************** *** 156,160 **** while (next > nodeNumber) { next = document.next[next]; - System.out.println(next); } if (next < 0) --- 156,159 ---- Index: NamespaceNode.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/memtree/NamespaceNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NamespaceNode.java 7 Aug 2004 16:28:02 -0000 1.2 --- NamespaceNode.java 8 Aug 2004 19:03:25 -0000 1.3 *************** *** 65,73 **** return qn != null ? qn.getLocalName() : null; } - - public String getNamespaceURI() { - QName qn = getQName(); - return qn != null ? qn.getNamespaceURI() : null; - } public boolean getSpecified() { --- 65,68 ---- *************** *** 83,86 **** --- 78,82 ---- } + /* (non-Javadoc) * @see org.w3c.dom.Attr#getValue() |
From: Wolfgang M. M. <wol...@us...> - 2004-08-07 18:49:27
|
Update of /cvsroot/exist/eXist-1.0/lib/optional In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5189/lib/optional Added Files: isorelax.jar xsdlib.jar castor-0.9.5-xml.jar msv.jar Log Message: Added jars required to compile with new schema feature. --- NEW FILE: msv.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: castor-0.9.5-xml.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xsdlib.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: isorelax.jar --- (This appears to be a binary file; contents omitted.) |
From: Jean-Marc V. <jm...@us...> - 2004-08-07 16:59:40
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20297/src/org/exist/xmldb/test Added Files: DOMTestJUnit.java Log Message: test: modifying a resource wtih DOM interface --- NEW FILE: DOMTestJUnit.java --- (This appears to be a binary file; contents omitted.) |
From: Jean-Marc V. <jm...@us...> - 2004-08-07 16:48:13
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18278/src/org/exist/xmldb/test Modified Files: DOMTest.java Log Message: JUnit test: Update of an existing document through DOM: currently **FAILS** Index: DOMTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/DOMTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DOMTest.java 7 Aug 2004 15:38:44 -0000 1.3 --- DOMTest.java 7 Aug 2004 16:48:03 -0000 1.4 *************** *** 14,17 **** --- 14,20 ---- import org.w3c.dom.*; + /** + * @author jmv + */ public class DOMTest { *************** *** 33,36 **** --- 36,45 ---- } + /** + * - Storing XML resource from XML string + * - simple XQuery + * - removing resource + * - shutdown with the DatabaseInstanceManager + */ public void runTest1() { try { *************** *** 88,92 **** } } ! public void runTest2() { try { --- 97,105 ---- } } ! /** ! * - create and fill a simple document via DOM and JAXP ! * - store it with setContentAsDOM() ! * - simple access via getContentAsDOM() ! * */ public void runTest2() { try { *************** *** 161,165 **** } } ! public void runTest3() { try { --- 174,179 ---- } } ! ! /** like test 2 but add attribute and text as well */ public void runTest3() { try { *************** *** 215,218 **** --- 229,233 ---- } + /** like test 3 but uses the DOM as input to an (identity) XSLT transform */ public void runTest4(boolean getContentAsDOM) { Database database = null; |