From fcbf63e62c627deae76c1b8cb8c0876c536ed811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 16 Mar 2020 18:49:26 +0900 Subject: Fresh start --- jni/ruby/test/rexml/data/LostineRiver.kml.gz | Bin 0 -> 50154 bytes jni/ruby/test/rexml/data/ProductionSupport.xml | 29 + jni/ruby/test/rexml/data/axis.xml | 25 + jni/ruby/test/rexml/data/bad.xml | 5 + jni/ruby/test/rexml/data/basic.xml | 11 + jni/ruby/test/rexml/data/basicupdate.xml | 47 + jni/ruby/test/rexml/data/broken.rss | 20 + jni/ruby/test/rexml/data/contents.xml | 70 + jni/ruby/test/rexml/data/dash.xml | 12 + jni/ruby/test/rexml/data/defaultNamespace.xml | 6 + jni/ruby/test/rexml/data/doctype_test.xml | 34 + jni/ruby/test/rexml/data/documentation.xml | 542 + jni/ruby/test/rexml/data/euc.xml | 296 + jni/ruby/test/rexml/data/evaluate.xml | 28 + jni/ruby/test/rexml/data/fibo.xml | 29 + jni/ruby/test/rexml/data/foo.xml | 10 + jni/ruby/test/rexml/data/google.2.xml | 156 + jni/ruby/test/rexml/data/id.xml | 21 + jni/ruby/test/rexml/data/iso8859-1.xml | 4 + jni/ruby/test/rexml/data/jaxen24.xml | 2 + jni/ruby/test/rexml/data/jaxen3.xml | 15 + jni/ruby/test/rexml/data/lang.xml | 11 + jni/ruby/test/rexml/data/lang0.xml | 18 + jni/ruby/test/rexml/data/message.xml | 27 + jni/ruby/test/rexml/data/moreover.xml | 244 + jni/ruby/test/rexml/data/much_ado.xml | 6850 +++++++++ jni/ruby/test/rexml/data/namespaces.xml | 18 + jni/ruby/test/rexml/data/nitf.xml | 67 + jni/ruby/test/rexml/data/numbers.xml | 18 + jni/ruby/test/rexml/data/ofbiz-issues-full-177.xml | 13971 +++++++++++++++++++ jni/ruby/test/rexml/data/pi.xml | 13 + jni/ruby/test/rexml/data/pi2.xml | 6 + jni/ruby/test/rexml/data/project.xml | 1 + jni/ruby/test/rexml/data/simple.xml | 2 + jni/ruby/test/rexml/data/stream_accents.xml | 4 + jni/ruby/test/rexml/data/t63-1.xml | Bin 0 -> 161690 bytes jni/ruby/test/rexml/data/t63-2.svg | 2828 ++++ jni/ruby/test/rexml/data/t75.xml | 31 + jni/ruby/test/rexml/data/test/tests.xml | 683 + jni/ruby/test/rexml/data/test/tests.xsl | 369 + jni/ruby/test/rexml/data/testNamespaces.xml | 22 + jni/ruby/test/rexml/data/testsrc.xml | 64 + jni/ruby/test/rexml/data/text.xml | 10 + jni/ruby/test/rexml/data/ticket_61.xml | 4 + jni/ruby/test/rexml/data/ticket_68.xml | 590 + jni/ruby/test/rexml/data/tutorial.xml | 678 + jni/ruby/test/rexml/data/underscore.xml | 6 + jni/ruby/test/rexml/data/utf16.xml | Bin 0 -> 207464 bytes jni/ruby/test/rexml/data/web.xml | 42 + jni/ruby/test/rexml/data/web2.xml | 7 + jni/ruby/test/rexml/data/working.rss | 202 + jni/ruby/test/rexml/data/xmlfile-bug.xml | 15 + jni/ruby/test/rexml/data/xp.tst | 27 + jni/ruby/test/rexml/data/yahoo.xml | 80 + jni/ruby/test/rexml/listener.rb | 50 + .../rexml/parse/test_document_type_declaration.rb | 49 + .../test/rexml/parse/test_notation_declaration.rb | 99 + jni/ruby/test/rexml/parser/test_sax2.rb | 202 + jni/ruby/test/rexml/parser/test_tree.rb | 42 + jni/ruby/test/rexml/parser/test_ultra_light.rb | 69 + jni/ruby/test/rexml/rexml_test_utils.rb | 6 + jni/ruby/test/rexml/test_attributes.rb | 222 + jni/ruby/test/rexml/test_attributes_mixin.rb | 31 + jni/ruby/test/rexml/test_changing_encoding.rb | 44 + jni/ruby/test/rexml/test_comment.rb | 25 + jni/ruby/test/rexml/test_contrib.rb | 584 + jni/ruby/test/rexml/test_core.rb | 1467 ++ jni/ruby/test/rexml/test_doctype.rb | 106 + jni/ruby/test/rexml/test_document.rb | 415 + jni/ruby/test/rexml/test_elements.rb | 118 + jni/ruby/test/rexml/test_encoding.rb | 107 + jni/ruby/test/rexml/test_entity.rb | 205 + jni/ruby/test/rexml/test_functions.rb | 224 + jni/ruby/test/rexml/test_functions_number.rb | 34 + jni/ruby/test/rexml/test_jaxen.rb | 129 + jni/ruby/test/rexml/test_light.rb | 106 + jni/ruby/test/rexml/test_lightparser.rb | 15 + jni/ruby/test/rexml/test_listener.rb | 130 + jni/ruby/test/rexml/test_martin_fowler.rb | 39 + jni/ruby/test/rexml/test_namespace.rb | 40 + jni/ruby/test/rexml/test_order.rb | 109 + jni/ruby/test/rexml/test_preceding_sibling.rb | 40 + jni/ruby/test/rexml/test_pullparser.rb | 102 + jni/ruby/test/rexml/test_rexml_issuezilla.rb | 18 + jni/ruby/test/rexml/test_sax.rb | 286 + jni/ruby/test/rexml/test_stream.rb | 129 + jni/ruby/test/rexml/test_text.rb | 21 + jni/ruby/test/rexml/test_ticket_80.rb | 58 + jni/ruby/test/rexml/test_validation_rng.rb | 792 ++ jni/ruby/test/rexml/test_xml_declaration.rb | 35 + jni/ruby/test/rexml/xpath/test_attribute.rb | 29 + .../rexml/xpath/test_axis_preceding_sibling.rb | 39 + jni/ruby/test/rexml/xpath/test_base.rb | 1089 ++ jni/ruby/test/rexml/xpath/test_node.rb | 42 + jni/ruby/test/rexml/xpath/test_predicate.rb | 82 + jni/ruby/test/rexml/xpath/test_text.rb | 74 + 96 files changed, 35773 insertions(+) create mode 100644 jni/ruby/test/rexml/data/LostineRiver.kml.gz create mode 100644 jni/ruby/test/rexml/data/ProductionSupport.xml create mode 100644 jni/ruby/test/rexml/data/axis.xml create mode 100644 jni/ruby/test/rexml/data/bad.xml create mode 100644 jni/ruby/test/rexml/data/basic.xml create mode 100644 jni/ruby/test/rexml/data/basicupdate.xml create mode 100644 jni/ruby/test/rexml/data/broken.rss create mode 100644 jni/ruby/test/rexml/data/contents.xml create mode 100644 jni/ruby/test/rexml/data/dash.xml create mode 100644 jni/ruby/test/rexml/data/defaultNamespace.xml create mode 100644 jni/ruby/test/rexml/data/doctype_test.xml create mode 100644 jni/ruby/test/rexml/data/documentation.xml create mode 100644 jni/ruby/test/rexml/data/euc.xml create mode 100644 jni/ruby/test/rexml/data/evaluate.xml create mode 100644 jni/ruby/test/rexml/data/fibo.xml create mode 100644 jni/ruby/test/rexml/data/foo.xml create mode 100644 jni/ruby/test/rexml/data/google.2.xml create mode 100644 jni/ruby/test/rexml/data/id.xml create mode 100644 jni/ruby/test/rexml/data/iso8859-1.xml create mode 100644 jni/ruby/test/rexml/data/jaxen24.xml create mode 100644 jni/ruby/test/rexml/data/jaxen3.xml create mode 100644 jni/ruby/test/rexml/data/lang.xml create mode 100644 jni/ruby/test/rexml/data/lang0.xml create mode 100644 jni/ruby/test/rexml/data/message.xml create mode 100644 jni/ruby/test/rexml/data/moreover.xml create mode 100644 jni/ruby/test/rexml/data/much_ado.xml create mode 100644 jni/ruby/test/rexml/data/namespaces.xml create mode 100644 jni/ruby/test/rexml/data/nitf.xml create mode 100644 jni/ruby/test/rexml/data/numbers.xml create mode 100644 jni/ruby/test/rexml/data/ofbiz-issues-full-177.xml create mode 100644 jni/ruby/test/rexml/data/pi.xml create mode 100644 jni/ruby/test/rexml/data/pi2.xml create mode 100644 jni/ruby/test/rexml/data/project.xml create mode 100644 jni/ruby/test/rexml/data/simple.xml create mode 100644 jni/ruby/test/rexml/data/stream_accents.xml create mode 100644 jni/ruby/test/rexml/data/t63-1.xml create mode 100644 jni/ruby/test/rexml/data/t63-2.svg create mode 100644 jni/ruby/test/rexml/data/t75.xml create mode 100644 jni/ruby/test/rexml/data/test/tests.xml create mode 100644 jni/ruby/test/rexml/data/test/tests.xsl create mode 100644 jni/ruby/test/rexml/data/testNamespaces.xml create mode 100644 jni/ruby/test/rexml/data/testsrc.xml create mode 100644 jni/ruby/test/rexml/data/text.xml create mode 100644 jni/ruby/test/rexml/data/ticket_61.xml create mode 100644 jni/ruby/test/rexml/data/ticket_68.xml create mode 100644 jni/ruby/test/rexml/data/tutorial.xml create mode 100644 jni/ruby/test/rexml/data/underscore.xml create mode 100644 jni/ruby/test/rexml/data/utf16.xml create mode 100644 jni/ruby/test/rexml/data/web.xml create mode 100644 jni/ruby/test/rexml/data/web2.xml create mode 100644 jni/ruby/test/rexml/data/working.rss create mode 100644 jni/ruby/test/rexml/data/xmlfile-bug.xml create mode 100644 jni/ruby/test/rexml/data/xp.tst create mode 100644 jni/ruby/test/rexml/data/yahoo.xml create mode 100644 jni/ruby/test/rexml/listener.rb create mode 100644 jni/ruby/test/rexml/parse/test_document_type_declaration.rb create mode 100644 jni/ruby/test/rexml/parse/test_notation_declaration.rb create mode 100644 jni/ruby/test/rexml/parser/test_sax2.rb create mode 100644 jni/ruby/test/rexml/parser/test_tree.rb create mode 100644 jni/ruby/test/rexml/parser/test_ultra_light.rb create mode 100644 jni/ruby/test/rexml/rexml_test_utils.rb create mode 100644 jni/ruby/test/rexml/test_attributes.rb create mode 100644 jni/ruby/test/rexml/test_attributes_mixin.rb create mode 100644 jni/ruby/test/rexml/test_changing_encoding.rb create mode 100644 jni/ruby/test/rexml/test_comment.rb create mode 100644 jni/ruby/test/rexml/test_contrib.rb create mode 100644 jni/ruby/test/rexml/test_core.rb create mode 100644 jni/ruby/test/rexml/test_doctype.rb create mode 100644 jni/ruby/test/rexml/test_document.rb create mode 100644 jni/ruby/test/rexml/test_elements.rb create mode 100644 jni/ruby/test/rexml/test_encoding.rb create mode 100644 jni/ruby/test/rexml/test_entity.rb create mode 100644 jni/ruby/test/rexml/test_functions.rb create mode 100644 jni/ruby/test/rexml/test_functions_number.rb create mode 100644 jni/ruby/test/rexml/test_jaxen.rb create mode 100644 jni/ruby/test/rexml/test_light.rb create mode 100644 jni/ruby/test/rexml/test_lightparser.rb create mode 100644 jni/ruby/test/rexml/test_listener.rb create mode 100644 jni/ruby/test/rexml/test_martin_fowler.rb create mode 100644 jni/ruby/test/rexml/test_namespace.rb create mode 100644 jni/ruby/test/rexml/test_order.rb create mode 100644 jni/ruby/test/rexml/test_preceding_sibling.rb create mode 100644 jni/ruby/test/rexml/test_pullparser.rb create mode 100644 jni/ruby/test/rexml/test_rexml_issuezilla.rb create mode 100644 jni/ruby/test/rexml/test_sax.rb create mode 100644 jni/ruby/test/rexml/test_stream.rb create mode 100644 jni/ruby/test/rexml/test_text.rb create mode 100644 jni/ruby/test/rexml/test_ticket_80.rb create mode 100644 jni/ruby/test/rexml/test_validation_rng.rb create mode 100644 jni/ruby/test/rexml/test_xml_declaration.rb create mode 100644 jni/ruby/test/rexml/xpath/test_attribute.rb create mode 100644 jni/ruby/test/rexml/xpath/test_axis_preceding_sibling.rb create mode 100644 jni/ruby/test/rexml/xpath/test_base.rb create mode 100644 jni/ruby/test/rexml/xpath/test_node.rb create mode 100644 jni/ruby/test/rexml/xpath/test_predicate.rb create mode 100644 jni/ruby/test/rexml/xpath/test_text.rb (limited to 'jni/ruby/test/rexml') diff --git a/jni/ruby/test/rexml/data/LostineRiver.kml.gz b/jni/ruby/test/rexml/data/LostineRiver.kml.gz new file mode 100644 index 0000000..68a00c5 Binary files /dev/null and b/jni/ruby/test/rexml/data/LostineRiver.kml.gz differ diff --git a/jni/ruby/test/rexml/data/ProductionSupport.xml b/jni/ruby/test/rexml/data/ProductionSupport.xml new file mode 100644 index 0000000..083cf64 --- /dev/null +++ b/jni/ruby/test/rexml/data/ProductionSupport.xml @@ -0,0 +1,29 @@ + + + + + + + + >#error:]]> + + + + + Update Policy request 9997: Please check CICS log + + + + + MotorInsuranceContract(Object)>>#error: + + Have not got a complete + + + Have not got a complete and consistent set of price matrices for policy period - ask back-end prod supp to sort out + + + + + + diff --git a/jni/ruby/test/rexml/data/axis.xml b/jni/ruby/test/rexml/data/axis.xml new file mode 100644 index 0000000..bc996c5 --- /dev/null +++ b/jni/ruby/test/rexml/data/axis.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jni/ruby/test/rexml/data/bad.xml b/jni/ruby/test/rexml/data/bad.xml new file mode 100644 index 0000000..18786f2 --- /dev/null +++ b/jni/ruby/test/rexml/data/bad.xml @@ -0,0 +1,5 @@ + + Here is an XML document. + + It has some elements, but it also has a hidden < error! (or two) + diff --git a/jni/ruby/test/rexml/data/basic.xml b/jni/ruby/test/rexml/data/basic.xml new file mode 100644 index 0000000..88385fb --- /dev/null +++ b/jni/ruby/test/rexml/data/basic.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/jni/ruby/test/rexml/data/basicupdate.xml b/jni/ruby/test/rexml/data/basicupdate.xml new file mode 100644 index 0000000..57d458c --- /dev/null +++ b/jni/ruby/test/rexml/data/basicupdate.xml @@ -0,0 +1,47 @@ + + + + + + Goudse kaas + Rond + + + + + + + More cheese! + + + + + Even more cheese! + + + + + No sausages today + + + + + + + + + + + + + + + + + + diff --git a/jni/ruby/test/rexml/data/broken.rss b/jni/ruby/test/rexml/data/broken.rss new file mode 100644 index 0000000..d5f29e5 --- /dev/null +++ b/jni/ruby/test/rexml/data/broken.rss @@ -0,0 +1,20 @@ + + + %HTMLlat1; +]> + + + + + O'Reilly Network Articles + http://www.oreillynet.com/ + + diff --git a/jni/ruby/test/rexml/data/contents.xml b/jni/ruby/test/rexml/data/contents.xml new file mode 100644 index 0000000..35e3ac7 --- /dev/null +++ b/jni/ruby/test/rexml/data/contents.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + Java and XML + + + Introduction + + What Is It? + + + How Do I Use It? + + + Why Should I Use It? + + + What's Next? + + + + + Creating XML + An XML Document + The Header + The Content + What's Next? + + + + Parsing XML + Getting Prepared + SAX Readers + Content Handlers + Error Handlers + + A Better Way to Load a Parser + + "Gotcha!" + What's Next? + + + + + + Web Publishing Frameworks + Selecting a Framework + Installation + + Using a Publishing Framework + + XSP + Cocoon 2.0 and Beyond + What's Next? + + + diff --git a/jni/ruby/test/rexml/data/dash.xml b/jni/ruby/test/rexml/data/dash.xml new file mode 100644 index 0000000..e1be655 --- /dev/null +++ b/jni/ruby/test/rexml/data/dash.xml @@ -0,0 +1,12 @@ + + + + content-1-text + + + content-2-text + + + content-3-text + + diff --git a/jni/ruby/test/rexml/data/defaultNamespace.xml b/jni/ruby/test/rexml/data/defaultNamespace.xml new file mode 100644 index 0000000..1e32981 --- /dev/null +++ b/jni/ruby/test/rexml/data/defaultNamespace.xml @@ -0,0 +1,6 @@ + + + + Hello + + diff --git a/jni/ruby/test/rexml/data/doctype_test.xml b/jni/ruby/test/rexml/data/doctype_test.xml new file mode 100644 index 0000000..a690cab --- /dev/null +++ b/jni/ruby/test/rexml/data/doctype_test.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + diff --git a/jni/ruby/test/rexml/data/documentation.xml b/jni/ruby/test/rexml/data/documentation.xml new file mode 100644 index 0000000..a1ad6e8 --- /dev/null +++ b/jni/ruby/test/rexml/data/documentation.xml @@ -0,0 +1,542 @@ + + + + + + + + REXML + + + + @ANT_VERSION@ + + @ANT_DATE@ + + http://www.germane-software.com/software/rexml + + rexml + + ruby + + Sean + Russell + + + + +

REXML is a conformant XML processor for the Ruby programming + language. REXML passes 100% of the Oasis non-validating tests and + includes full XPath support. It is reasonably fast, and is implemented + in pure Ruby. Best of all, it has a clean, intuitive API. REXML is + included in the standard library of Ruby

+ +

This software is distribute under the Ruby + license.

+
+ + +

REXML arose out of a desire for a straightforward XML API, and is an + attempt at an API that doesn't require constant referencing of + documentation to do common tasks. "Keep the common case simple, and the + uncommon, possible."

+ +

REXML avoids The DOM API, which violates the maxim of simplicity. It + does provide a DOM model, but one that is Ruby-ized. It is an + XML API oriented for Ruby programmers, not for XML programmers coming + from Java.

+ +

Some of the common differences are that the Ruby API relies on block + enumerations, rather than iterators. For example, the Java code:

+ + for (Enumeration e=parent.getChildren(); e.hasMoreElements(); ) { + Element child = (Element)e.nextElement(); // Do something with child +} + +

in Ruby becomes:

+ + parent.each_child{ |child| # Do something with child } + +

Can't you feel the peace and contentment in this block of code? Ruby + is the language Buddha would have programmed in.

+ +

One last thing. If you use and like this software, and you're in a + position of power in a company in Western Europe and are looking for a + software architect or developer, drop me a line. I took a lot of French + classes in college (all of which I've forgotten), and I lived in Munich + long enough that I was pretty fluent by the time I left, and I'd love to + get back over there.

+
+ + + Four intuitive parsing APIs. + + Intuitive, powerful, and reasonably fast tree parsing API (a-la + DOM + + Fast stream parsing API (a-la SAX)This is not a SAX + API. + + SAX2-based APIIn addition to the native REXML streaming + API. This is slower than the native REXML API, but does a lot more work + for you. + + Pull parsing API. + + Small + + Reasonably fast (for interpreted code) + + Native Ruby + + Full XPath supportCurrently only available for the tree + API + + XML 1.0 conformantREXML passes all of the non-validating + OASIS tests. There are probably places where REXML isn't conformant, but + I try to fix them as they're reported. + + ISO-8859-1, UNILE, UTF-16 and UTF-8 input and output; also, + support for any encoding the iconv supports. + + Documentation + +
+ + + +

You don't have to install anything; if you're running a + version of Ruby greater than 1.8, REXML is included. However, if you + choose to upgrade from the REXML distribution, run the command: + ruby bin/install.rb. By the way, you really should look at + these sorts of files before you run them as root. They could contain + anything, and since (in Ruby, at least) they tend to be mercifully + short, it doesn't hurt to glance over them. If you want to uninstall + REXML, run ruby bin/install.rb -u.

+
+ + +

If you have Test::Unit installed, you can run the unit test cases. + Run the command: ruby bin/suite.rb; it runs against the + distribution, not against the installed version.

+
+ + +

There is a benchmark suite in benchmarks/. To run the + benchmarks, change into that directory and run ruby + comparison.rb. If you have nothing else installed, only the + benchmarks for REXML will be run. However, if you have any of the + following installed, benchmarks for those tools will also be run:

+ + + NQXML + + XMLParser + + Electric XML (you must copy EXML.jar into the + benchmarks directory and compile + flatbench.java before running the test) + + +

The results will be written to index.html.

+
+ + +

Please see the Tutorial.

+ +

The API documentation is available on-line, + or it can be downloaded as an archive in + tgz format (~70Kb) or (if you're a masochist) in + zip format (~280Kb). The best solution is to download and install + Dave Thomas' most excellent rdoc and generate the API docs + yourself; then you'll be sure to have the latest API docs and won't have + to keep downloading the doc archive.

+ +

The unit tests in test/ and the benchmarking code in + benchmark/ provide additional examples of using REXML. The + Tutorial provides examples with commentary. The documentation unpacks + into rexml/doc.

+ +

Kouhei Sutou maintains a Japanese + version of the REXML API docs. Kou's + documentation page contains links to binary archives for various + versions of the documentation.

+
+
+ + + +

Unfortunately, NQXML is the only package REXML can be compared + against; XMLParser uses expat, which is a native library, and really is + a different beast altogether. So in comparing NQXML and REXML you can + look at four things: speed, size, completeness, and API.

+ +

Benchmarks

+ +

REXML is faster than NQXML in some things, and slower than NQXML in a + couple of things. You can see this for yourself by running the supplied + benchmarks. Most of the places where REXML are slower are because of the + convenience methodsFor example, + element.elements[index] isn't really an array operation; + index can be an Integer or an XPath, and this feature is relatively time + expensive.. On the positive side, most of the convenience + methods can be bypassed if you know what you are doing. Check the benchmark comparison page for a + general comparison. You can look at the benchmark code yourself + to decide how much salt to take with them.

+ +

The sizes of the XML parsers are closeAs measured with + ruby -nle 'print unless /^\s*(#.*|)$/' *.rb | wc -l + . NQXML 1.1.3 has 1580 non-blank, non-comment lines of code; + REXML 2.0 has 2340REXML started out with about 1200, but that + number has been steadily increasing as features are added. XPath + accounts for 541 lines of that code, so the core REXML has about 1800 + LOC..

+ +

REXML is a conformant XML 1.0 parser. It supports multiple language + encodings, and internal processing uses the required UTF-8 and UTF-16 + encodings. It passes 100% of the Oasis non-validating tests. + Furthermore, it provides a full implementation of XPath, a SAX2 and a + PullParser API.

+
+ + +

As of release 2.0, XPath 1.0 is fully implemented.

+ +

I fully expect bugs to crop up from time to time, so if you see any + bogus XPath results, please let me know. That said, since I'm now + following the XPath grammar and spec fairly closely, I suspect that you + won't be surprised by REXML's XPath very often, and it should become + rock solid fairly quickly.

+ +

Check the "bugs" section for known problems; there are little bits of + XPath here and there that are not yet implemented, but I'll get to them + soon.

+ +

Namespace support is rather odd, but it isn't my fault. I can only do + so much and still conform to the specs. In particular, XPath attempts to + help as much as possible. Therefore, in the trivial cases, you can pass + namespace prefixes to Element.elements[...] and so on -- in these cases, + XPath will use the namespace environment of the base element you're + starting your XPath search from. However, if you want to do something + more complex, like pass in your own namespace environment, you have to + use the XPath first(), each(), and match() methods. Also, default + namespaces force you to use the XPath methods, rather than the + convenience methods, because there is no way for XPath to know what the + mappings for the default namespaces should be. This is exactly why I + loath namespaces -- a pox on the person(s) who thought them up!

+
+ + +

Namespace support is now fairly stable. One thing to be aware of is + that REXML is not (yet) a validating parser. This means that some + invalid namespace declarations are not caught.

+
+ + +

There is a low-volume mailing list dedicated to REXML. To subscribe, + send an empty email to ser-rexml-subscribe@germane-software.com. + This list is more or less spam proof. To unsubscribe, similarly send a + message to ser-rexml-unsubscribe@germane-software.com.

+
+ + +

An RSS + file for REXML is now being generated from the change log. This + allows you to be alerted of bug fixes and feature additions via "pull". + Another + RSS is available which contains a single item: the release notice + for the most recent release. This is an abuse of the RSS + mechanism, which was intended to be a distribution system for headlines + linked back to full articles, but it works. The headline for REXML is + the version number, and the description is the change log. The links all + link back to the REXML home page. The URL for the RSS itself is + http://www.germane-software.com/software/rexml/rss.xml.

+ +

The changelog itself is here.

+ +

For those who are interested, there's a SLOCCount (by David A. Wheeler) file + with stats on the REXML sourcecode. Note that the SLOCCount output + includes the files in the test/, benchmarks/, and bin/ directories, as + well as the main sourcecode for REXML itself.

+
+ + + + Raggle is a + console-based RSS aggregator. + + getrss + is an RSS aggregator + + Ned Konz's ruby-htmltools + uses REXML + + Hiroshi NAKAMURA's SOAP4R + package can use REXML as the XML processor. + + Chris Morris' XML + Serializer. XML Serializer provides a serialization mechanism + for Ruby that provides a bidirectional mapping between Ruby classes + and XML documents. + + Much of the RubyXML + site is generated with scripts that use REXML. RubyXML is a great + place to find information about th intersection between Ruby and + XML. + + + + +

You can submit bug reports and feature requests, and view the list of + known bugs, at the REXML bug report + page. Please do submit bug reports. If you really want your bug + fixed fast, include an runit or Test::Unit method (or methods) that + illustrates the problem. At the very least, send me some XML that REXML + doesn't process properly.

+ +

You don't have to send an entire test suite -- just the unit test + methods. If you don't send me a unit test, I'll have to write one + myself, which will mean that your bug will take longer to fix.

+ +

When submitting bug reports, please include the version of Ruby and + of REXML that you're using, and the operating system you're running on. + Just run: ruby -vrrexml/rexml -e 'p + REXML::VERSION,PLATFORM' and paste the results in your bug + report. Include your email if you want a response about the bug.

+ + Attributes are not handled internally as nodes, so you can't + perform node functions on them. This will have to change. It'll also + probably mean that, rather than returning attribute values, XPath will + return the Attribute nodes. + + Some of the XPath functions are untestedMike + Stok has been testing, debugging, and implementing some of these + Functions (and he's been doing a good job) so there's steady improvement + in this area.. Any XPath functions that don't work are also + bugs... please report them. If you send a unit test that illustrates the + problem, I'll try to fix the problem within a couple of days (if I can) + and send you a patch, personally. + + Accessing prefixes for which there is no defined namespace in an + XPath should throw an exception. It currently doesn't -- it just fails + to match. +
+ + + Reparsing a tree with a pull/SAX parser + + Better namespace support in SAX + + Lazy tree parsing + + Segregate parsers, for optimized minimal distributions + + XML <-> Ruby + + Validation support + + True XML character support + + Add XPath support for streaming APIs + + XQuery support + + XUpdate support + + Make sure namespaces are supported in pull parser + + Add document start and entity replacement events + in pull parser + + Better stream parsing exception handling + + I'd like to hack XMLRPC4R to use REXML, for my own + purposes. + +
+ + + REXML is hanging while parsing one of my XML files. + + Your XML is probably malformed. Some malformed XML, especially XML that + contains literal '<' embedded in the document, causes REXML to hang. + REXML should be throwing an exception, but it doesn't; this is a bug. I'm + aware that it is an extremely annoying bug, and it is one I'm trying to + solve in a way that doesn't significantly reduce REXML's parsing + speed. + + I'm using the XPath '//foo' on an XML branch node X, and keep getting + all of the 'foo' elements in the entire document. Why? Shouldn't it return + only the 'foo' element descendants of X? + + No. XPath specifies that '/' returns the document root, regardless of + the context node. '//' also starts at the document root. If you want to + limit your search to a branch, you need to use the self:: axe. EG, + 'self::node()//foo', or the shorthand './/foo'. + + I want to parse a document both as a tree, and as a stream. Can I do + this? + + Yes, and no. There is no mechanism that directly supports this in + REXML. However, aside from writing your own traversal layer, there is a + way of doing this. To turn a tree into a stream, just turn the branch you + want to process as a stream back into a string, and re-parse it with your + preferred API. EG: pp = PullParser.new( some_element.to_s ). The other + direction is more difficult; you basically have to build a tree from the + events. REXML will have one of these builders, eventually, but it doesn't + currently exist. + + Why is Element.elements indexed off of '1' instead of '0'? + + Because of XPath. The XPath specification states that the index of the + first child node is '1'. Although it may be counter-intuitive to base + elements on 1, it is more undesireable to have element.elements[0] == + element.elements[ 'node()[1]' ]. Since I can't change the XPath + specification, the result is that Element.elements[1] is the first child + element. + + Why isn't REXML a validating parser? + + Because validating parsers must include code that parses and interprets + DTDs. I hate DTDs. REXML supports the barest minimum of DTD parsing, and + even that isn't complete. There is DTD parsing code in the works, but I + only work on it when I'm really, really bored. Rumor has it that a + contributor is working on a DTD parser for REXML; rest assured that any + such contribution will be included with REXML as soon as it is + available. + + I'm trying to create an ISO-8859-1 document, but when I add text to the + document it isn't being properly encoded. + + Regardless of what the encoding of your document is, when you add text + programmatically to a REXML document you must ensure that you are + only adding UTF-8 to the tree. In particular, you can't add ISO-8859-1 + encoded text that contains characters above 0x80 to REXML trees -- you + must convert it to UTF-8 before doing so. Luckily, this is easy: + text.unpack('C*').pack('U*') will do the trick. 7-bit ASCII + is identical to UTF-8, so you probably won't need to worry about this. + + How do I get the tag name of an Element? + + You take a look at the APIs, and notice that Element + includes Namespace. Then you click on the + Namespace link and look at the methods that + Element includes from Namespace. One of these is + name(). Another is expanded_name(). Yet another + is prefix(). Then, you email the author of rdoc and ask him + to extend rdoc so that it lists methods in the API that are included from + other files, so that you don't have to do all of that looking around for + your method. + + + +

I've had help from a number of resources; if I haven't listed you here, + it means that I just haven't gotten around to adding you, or that I'm a + dork and have forgotten. In either case, feel free to write me and + complain.

+ + + Mike Stok has been very active, sending not only fixes for bugs + (especially in Functions), but also by providing unit tests and making + sure REXML runs under Ruby 1.7. He also sent the most awesome hand + knitted tea cozy, with "REXML" and the Ruby knitted into it. + + Kouhei Sutou translated the REXML API documentation to Japanese! + Links are in the API docs section of the main documentation. He has also + contributed a large number of bug reports and patches to fix bugs in + REXML. + + Erik Terpstra heard my pleas and submitted several logos for + REXML. After sagely procrastinating for several weeks, I finally forced + my poor slave of a wife to pick one (this is what we call "delegation"). + She did, with caveats; Erik quickly made the changes, and the result is + what you now see at the top of this page. He also supplied a smaller version that you can include + with your projects that use REXML, if you'd like. + + Ernest Ellingson contributed the sourcecode for turning UTF16 and + UNILE encodings into UTF8, which allowed REXML to get the 100% OASIS + valid tests rating. + + Ian Macdonald provided me with a comprehensive, well written RPM + spec file. + + Oliver M . Bolzer is maintaining a Debian package distribution of + REXML. He also has provided good feedback and bug reports about + namespace support. + + Michael Granger supplied a patch for REXML that make the unit + tests pass under Ruby 1.7. + + James Britt contributed code that makes using + Document.parse_stream easier to use by allowing it to be passed either a + Source, File, or String. + + Tobias Reif: Numerous bug reports, and suggestions for + improvement. + + Stefan Scholl, who provided a lot of feedback and bug reports + while I was trying to get ISO-8859-1 support working. + + Steven E Lumos for volunteering information about XPath + particulars. + + Fumitoshi UKAI provided some bug fixes for CData metacharacter + quoting. + + TAKAHASHI Masayoshi, for information on UTF + + Robert Feldt: Bug reports and suggestions/recommendations about + improving REXML. Testing is one of the most important aspects of + software development. + + Electric + XML: This was, after all, the inspiration for REXML. Originally, + I was just going to do a straight port, and although REXML doesn't in + any way, shape or form resemble Electric XML, still the basic framework + and philosophy was inspired by E-XML. And I still use E-XML in my Java + projects. + + NQXML: + While I may complain about the NQXML API, I wrote a few applications + using it that wouldn't have been written otherwise, and it was very + useful to me. It also encouraged me to write REXML. Never complain about + free software *slap*. + + See my technologies + page for a more comprehensive list of computer technologies that + I depend on for my day-to-day work. + + rdoc, an excellent JavaDoc analogWhen I was first + working on REXML, rdoc wasn't, IMO, very good, so I wrote API2XML. + API2XML was good enough for a while, and then there was a flurry of work + on rdoc, and it quickly surpassed API2XML in features. Since I was never + really interested in maintaining a JavaDoc analog, I stopped support of + API2XML, and am now recommending that people use + rdoc.. + + Many, many other people who've submitted bug reports, suggestions, + and positive feedback. You're all co-developers! + +
+
diff --git a/jni/ruby/test/rexml/data/euc.xml b/jni/ruby/test/rexml/data/euc.xml new file mode 100644 index 0000000..a3c3419 --- /dev/null +++ b/jni/ruby/test/rexml/data/euc.xml @@ -0,0 +1,296 @@ + + + + + + + + + +Ruby-mswin32 + + + +

Ruby-mswin32

+

あるいは、Windowsとの終わりなき戦い ;-(

+

[日本語 / English]

+ + + +

▼ 目次

+ + + + +

▼ 注意事項

+

このページでは、mswin32版rubyの配布と変更状況のお知らせを行っています。

+

ここは別に公式ページでもなんでもなくて、私が勝手に書いてるページです。ここで入手できるプログラム・情報(無いに等しいけど)については、各自の判断でご利用ください。
+問い合わせはへ。間違っても他の人に迷惑をかけるようなことはしないでね。

+ + + +

▼ Rubyとは?

+

Rubyのサイトをご覧下さい。

+ + + +

▼ mswin32版rubyとは?

+

mswin32版rubyとは、32bit版Windows(Windows95・Windows98・WindowsMe・Windows NT・Windows 2000・WindowsXP・Windows 2003 Server、以下Windowsと表記)上で動作するRubyのバイナリの一つです。
+Windows上で動作するRubyとしては、現在、5種類のバイナリが存在します。これらはそれぞれmswin32版・cygwin版・mingw32版・bccwin32版・djgpp版と呼ばれています。
+それぞれの違いをまとめると以下のようになります(事実誤認があればお知らせください)。

+
+
mswin32版
+

VC++でコンパイルされる。Windowsから見ればもっとも「普通」のバイナリと言えるが、反面、Rubyが持つUNIXで特徴的な機能の一部が使用できない。1.7.3以降はmingw32版と拡張ライブラリについてはバイナリ互換性がある。
+RUBY_PLATFORMは*-mswin32。

+
+
cygwin版
+

gccでコンパイルされ、cygwin環境で動作する。cygwin環境がUNIXライクな環境をWindows上で構築するものであるので、当然、cygwin版rubyは一般のUNIX用のものとだいたい同じように動作する(ことが期待できる)。
+RUBY_PLATFORMは*-cygwin。

+
+
mingw32版
+

gccでコンパイルされる。ソースはほとんどmswin32版と共通であり、ランタイムライブラリも共通(MSVCRT.dll)なので、動作も(おそらく)mswin32版とほぼ同じ。1.7.3以降はmswin32版と拡張ライブラリについてはバイナリ互換性がある。
+RUBY_PLATFORMは*-mingw32。

+
+
bccwin32版
+

BC++でコンパイルされる。ソースはかなりの部分がmswin32版と共通ではあるが、ランタイムライブラリが異なるので、細かいところで挙動がmswin32版とは異なる(はず)。1.7以降でサポートされる。
+RUBY_PLATFORMは*-bccwin32。

+
+
djgpp版
+

DJGPPでコンパイルされる。DOS用のバイナリなので、もちろんDOSでも動作する。反面、WindowsにあってDOSにない機能の多くが使えない(ネットワーク関連など)。
+RUBY_PLATFORMは*-msdosdjgpp。

+
+
+

このページでは、上記のうちmswin32版のみを扱っています。
+なお、cygwin版・mingw32版・djgpp版についてはわたなべさんのRuby binariesから入手可能です。また、bccwin32版については小西さんのRubyから入手可能です。

+ + + +

▼ バイナリ ダウンロード

+

現在配布中の全てのバイナリはVC++ 5.0(Version 11.00.7022 for 80x86)でmakeしたものです。ruby自体に関しては、標準配布のソース(またはCVSのソース)からそのまま作成しています。拡張ライブラリについては各々のリンク先を参照してください。
+いずれのバイナリもzip形式でアーカイブされています。

+

md5sumのチェック方法ですが、例えばrubyがインストールされているなら下記のような方法があります。
+ruby -r md5 -e "puts MD5.new(File.open('filename', 'rb').read).hexdigest"

+ + + +

Release

+ + + + + + + + +

Developing versions snapshots

+ + + + +

Stable versions snapshots

+

1.8.0

+ +

1.6.8

+ + + + +

Extension libraries

+

1.8.0

+ +

1.6.8

+ + + + +

▼ インストール

+

上記のバイナリをインストールする場合は、お好みのディレクトリ(以下$TOPDIRと記述)に展開してください。ディレクトリ付きで圧縮されてますので、展開時にはディレクトリ付きで展開するのを忘れずに(意味がわからない人は気にしなくていいです)。
+展開後は、$TOPDIR\binPATHを通しておいてください。

+

なお、以下の拡張ライブラリは、この配布物に含まれない外部のライブラリに依存しています。

+
    +
  • curses.so : PDCursesに依存しています。
  • +
  • dbm.so : GDBMに依存しています。
  • +
  • gdbm.so : GDBMに依存しています。
  • +
  • iconv.so : Iconvに依存しています。
  • +
  • openssl.so : OpenSSLに依存しています。
  • +
  • readline.so : readlineに依存しています。
  • +
  • tcltklib.so : Tcl/Tkに依存しています。
  • +
  • zlib.so : Zlibに依存しています。
  • +
+

上記のうち、PDCurses・GDBM・OpenSSL・readline・Zlibについては、Porting Libraries to Win32にバイナリが存在します。
+Iconvについては、Meadowy.orgで配布されているiconv-1.8.win32.zipを利用しています。
+Tcl/Tkについては、ActiveStateで配布されているActiveTclを利用しています。

+ + + +

▼ 最近の出来事

+ + + +

2004-01-27

+

あけましておめでとうございます。って遅いよ!

+

ruby-1.8.1-20040127とruby-1.9.0-20040126を置きました。
+前者は主に1.8.1リリース版で発見された不具合の修正です。後者は開発版。

+ +

2003-12-25

+

メリークリスマス! ruby-1.8.1がリリースされました!
+(previewを一つ飛ばしちゃいました、ごめんなさい...)

+ +

2003-12-06

+

ruby-1.8.1-preview3を置きました。思いのほか間が空いちゃいましたね。

+ +

2003-11-01

+

ruby-1.8.1-preview2を置きました。

+ +

2003-10-28

+

ruby-1.8.1-20031027を置きました。
+racc-1.4.4-allを置きました。

+ +

2003-09-07

+

eruby-1.0.4・vrswin-030906・vruby-030906を置きました。

+ +

2003-08-12

+

ruby-1.8.0-20030812を置きました。

+

vrswin-030811・vruby-030811を置きました。今回から置く拡張ライブラリは全て1.8用になります。

+ +

2003-08-04

+

ruby-1.8.0を置きました。Ruby 1.8系最初のリリースとなります。
+1.6系からの変更点については、changes.1.8.0などをご覧ください。

+ +

2003-07-31

+

ruby-1.8.0-preview6を置きました。えーと、これを含めてあと2回previewが出る模様です :)

+ +

2003-07-28

+

ruby-1.8.0-preview5を置きました。おそらくこれが1.8.0の最後のpreviewになるでしょう。
+ruby-1.6.8-20030727を置きました。

+ + + +

かつての出来事

+

こちらをどうぞ。

+ + + +

▼ リンク

+

mswin32版に関する(と思われる)リンクです。勝手に張ってますので、不都合があればまでご連絡ください。

+
    +
  • Ruby Home Page (日本語 / English)
    + 言わずとしれた、本家サイト。
  • +
  • 雑記帳 (日本語 / English)
    + 助田さんのページ。RubWinWin32OLEなどがあります。
  • +
  • Script/Ruby (日本語)
    + MoonWolfさんのページ。Win32Moduleなどがあります。
  • +
  • ActiveScriptRuby (日本語 / English)
    + artonさんのページ。Windows版Rubyの未来はここにあるのかも。
  • +
  • VisualuRuby計画(仮称) (日本語 / English)
    + nyasuさんのページ。VisualuRubyなどがあります(ってこれもそのまんま)。WindowsでRubyを使うためのリンク集が充実してます。ちなみに、当サイトのデザインはこちらのパクリです。多謝!
  • +
  • Ruby (日本語 / English)
    + よしだむさんのページ。SusieプラグインライブラリDirectDraw for Rubyなどがあります。
  • +
  • RDE(Ruby Development Environment) (日本語)
    + sakazukiさんのページ。mswin32版ユーザなら必見です。推奨環境はartonさんとこのActiveScriptRubyですが (^^; ここの配布物を使っても問題なく動作します。
  • +
+ + + + +
written by U.Nakamura
+

+ruby 1.9.0 (2004-01-13)
+ERb 2.0.4
+RDtool 0.6.11
+rublog 0.0.2 +

+ + + diff --git a/jni/ruby/test/rexml/data/evaluate.xml b/jni/ruby/test/rexml/data/evaluate.xml new file mode 100644 index 0000000..90d06bd --- /dev/null +++ b/jni/ruby/test/rexml/data/evaluate.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + brown + + + moderate + + diff --git a/jni/ruby/test/rexml/data/fibo.xml b/jni/ruby/test/rexml/data/fibo.xml new file mode 100644 index 0000000..9b5d0ec --- /dev/null +++ b/jni/ruby/test/rexml/data/fibo.xml @@ -0,0 +1,29 @@ + + + 0 + 1 + 1 + 2 + 3 + 5 + 8 + 13 + 21 + 34 + 55 + 89 + 144 + 233 + 377 + 610 + 987 + 1597 + 2584 + 4181 + 6765 + 10946 + 17711 + 28657 + 46368 + 75025 + diff --git a/jni/ruby/test/rexml/data/foo.xml b/jni/ruby/test/rexml/data/foo.xml new file mode 100644 index 0000000..53b9a4e --- /dev/null +++ b/jni/ruby/test/rexml/data/foo.xml @@ -0,0 +1,10 @@ + + +]> + + human leg + table leg + diff --git a/jni/ruby/test/rexml/data/google.2.xml b/jni/ruby/test/rexml/data/google.2.xml new file mode 100644 index 0000000..a1df93b --- /dev/null +++ b/jni/ruby/test/rexml/data/google.2.xml @@ -0,0 +1,156 @@ +
+ + + + + + + + Campaign Name + + + + Current Status + + + Current Budget + + [?] + + + + Clicks + + + + + + Impr. + + + CTR + + + Avg. CPC + + + Cost + + + Conv. Rate + + + Cost/Conv. + + + + + + + + Test + + + + Paused + + + + Test + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + + Test + + + + Paused + + + + Test + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + + Test + + + + Test + + + + Test + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + +
diff --git a/jni/ruby/test/rexml/data/id.xml b/jni/ruby/test/rexml/data/id.xml new file mode 100644 index 0000000..749ab20 --- /dev/null +++ b/jni/ruby/test/rexml/data/id.xml @@ -0,0 +1,21 @@ + + + + + + + + +]> + + + + baz + gouda + baz + cheddar + baz + + diff --git a/jni/ruby/test/rexml/data/iso8859-1.xml b/jni/ruby/test/rexml/data/iso8859-1.xml new file mode 100644 index 0000000..5fb04ec --- /dev/null +++ b/jni/ruby/test/rexml/data/iso8859-1.xml @@ -0,0 +1,4 @@ + + + + diff --git a/jni/ruby/test/rexml/data/jaxen24.xml b/jni/ruby/test/rexml/data/jaxen24.xml new file mode 100644 index 0000000..9b81996 --- /dev/null +++ b/jni/ruby/test/rexml/data/jaxen24.xml @@ -0,0 +1,2 @@ + +

diff --git a/jni/ruby/test/rexml/data/jaxen3.xml b/jni/ruby/test/rexml/data/jaxen3.xml new file mode 100644 index 0000000..a87723a --- /dev/null +++ b/jni/ruby/test/rexml/data/jaxen3.xml @@ -0,0 +1,15 @@ + + + + 2 + + CE-A + + + + 1 + + CE-B + + + diff --git a/jni/ruby/test/rexml/data/lang.xml b/jni/ruby/test/rexml/data/lang.xml new file mode 100644 index 0000000..49b45db --- /dev/null +++ b/jni/ruby/test/rexml/data/lang.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/jni/ruby/test/rexml/data/lang0.xml b/jni/ruby/test/rexml/data/lang0.xml new file mode 100644 index 0000000..283b4e0 --- /dev/null +++ b/jni/ruby/test/rexml/data/lang0.xml @@ -0,0 +1,18 @@ + + + + Ruby + + + Yukihiro Matsumoto + + + + + Python + + + Guido van Rossum + + + diff --git a/jni/ruby/test/rexml/data/message.xml b/jni/ruby/test/rexml/data/message.xml new file mode 100644 index 0000000..3b81df2 --- /dev/null +++ b/jni/ruby/test/rexml/data/message.xml @@ -0,0 +1,27 @@ + + +
+ lookupformservice + 9 + stammdaten + new +
+ + + + + iteminfo + ELE + + + parentinfo + Pruefgebiete + + + id + 1 + + + + +
diff --git a/jni/ruby/test/rexml/data/moreover.xml b/jni/ruby/test/rexml/data/moreover.xml new file mode 100644 index 0000000..38d4c4f --- /dev/null +++ b/jni/ruby/test/rexml/data/moreover.xml @@ -0,0 +1,244 @@ + + +
+ http://c.moreover.com/click/here.pl?x13563273 + e-Commerce Operators Present Version 1.0 of the XML Standard + StockAccess + text + moreover... + + http://www.stockaccess.com/index.html + Dec 24 2000 6:28AM + + +
+
+ http://c.moreover.com/click/here.pl?x13560995 + W3C Publishes XML Protocol Requirements Document + Xml + text + moreover... + + http://www.xml.com/ + Dec 24 2000 12:22AM + + +
+
+ http://c.moreover.com/click/here.pl?x13553521 + Prowler: Open Source XML-Based Content Management Framework + Xml + text + moreover... + + http://www.xml.com/ + Dec 23 2000 2:05PM + + +
+
+ http://c.moreover.com/click/here.pl?x13549013 + The Middleware Company Debuts Public Training Courses in Ejb, J2ee And Xml + Java Industry Connection + text + moreover... + + http://industry.java.sun.com/javanews/more/hotnews/ + Dec 23 2000 12:15PM + + +
+
+ http://c.moreover.com/click/here.pl?x13544467 + Revised Working Draft for the W3C XML Information Set + Xml + text + moreover... + + http://www.xml.com/ + Dec 23 2000 5:50AM + + +
+
+ http://c.moreover.com/click/here.pl?x13534836 + XML: Its The Great Peacemaker + ZDNet + text + moreover... + + http://www.zdnet.com/intweek/ + Dec 22 2000 9:05PM + + +
+
+ http://c.moreover.com/click/here.pl?x13533485 + Project eL - The XML Leningrad Codex Markup Project + Xml + text + moreover... + + http://www.xml.com/ + Dec 22 2000 8:34PM + + +
+
+ http://c.moreover.com/click/here.pl?x13533488 + XML Linking Language (XLink) and XML Base Specifications Issued as W3C Proposed Recommenda + Xml + text + moreover... + + http://www.xml.com/ + Dec 22 2000 8:34PM + + +
+
+ http://c.moreover.com/click/here.pl?x13533492 + W3C Releases XHTML Basic Specification as a W3C Recommendation + Xml + text + moreover... + + http://www.xml.com/ + Dec 22 2000 8:34PM + + +
+
+ http://c.moreover.com/click/here.pl?x13521827 + Java, Xml And Oracle9i(TM) Make A Great Team + Java Industry Connection + text + moreover... + + http://industry.java.sun.com/javanews/more/hotnews/ + Dec 22 2000 3:21PM + + +
+
+ http://c.moreover.com/click/here.pl?x13511233 + Competing initiatives to vie for security standard + ZDNet + text + moreover... + + http://www.zdnet.com/eweek/filters/news/ + Dec 22 2000 10:54AM + + +
+
+ http://c.moreover.com/click/here.pl?x13492397 + Oracle Provides Developers with Great Xml Reading This Holiday Season + Java Industry Connection + text + moreover... + + http://industry.java.sun.com/javanews/more/hotnews/ + Dec 21 2000 8:08PM + + +
+
+ http://c.moreover.com/click/here.pl?x13491292 + XML as the great peacemaker - Extensible Markup Language Accomplished The Seemingly Impossible This Year: It B + Hospitality Net + text + moreover... + + http://www.hospitalitynet.org/news/list.htm?c=2000 + Dec 21 2000 7:45PM + + +
+
+ http://c.moreover.com/click/here.pl?x13484758 + XML as the great peacemaker + CNET + text + moreover... + + http://news.cnet.com/news/0-1003.html?tag=st.ne.1002.dir.1003 + Dec 21 2000 4:41PM + + +
+
+ http://c.moreover.com/click/here.pl?x13480896 + COOP Switzerland Selects Mercator as Integration Platform + Stockhouse Canada + text + moreover... + + http://www.stockhouse.ca/news/ + Dec 21 2000 1:55PM + + +
+
+ http://c.moreover.com/click/here.pl?x13471023 + Competing XML Specs Move Toward a Union + Internet World + text + moreover... + + http://www.internetworld.com/ + Dec 21 2000 11:14AM + + +
+
+ http://c.moreover.com/click/here.pl?x13452280 + Next-generation XHTML stripped down for handhelds + CNET + text + moreover... + + http://news.cnet.com/news/0-1005.html?tag=st.ne.1002.dir.1005 + Dec 20 2000 9:11PM + + +
+
+ http://c.moreover.com/click/here.pl?x13451789 + Xml Powers Oracle9i(TM) Dynamic Services + Java Industry Connection + text + moreover... + + http://industry.java.sun.com/javanews/more/hotnews/ + Dec 20 2000 9:05PM + + +
+
+ http://c.moreover.com/click/here.pl?x13442097 + XML DOM reference guide + ASPWire + text + moreover... + + http://aspwire.com/ + Dec 20 2000 6:26PM + + +
+
+ http://c.moreover.com/click/here.pl?x13424117 + Repeat/Xqsite And Bowstreet Team to Deliver Integrated Xml Solutions + Java Industry Connection + text + moreover... + + http://industry.java.sun.com/javanews/more/hotnews/ + Dec 20 2000 9:04AM + + +
+
+ diff --git a/jni/ruby/test/rexml/data/much_ado.xml b/jni/ruby/test/rexml/data/much_ado.xml new file mode 100644 index 0000000..f008fad --- /dev/null +++ b/jni/ruby/test/rexml/data/much_ado.xml @@ -0,0 +1,6850 @@ + + +Much Ado about Nothing + + +

Text placed in the public domain by Moby Lexical Tools, 1992.

+

SGML markup by Jon Bosak, 1992-1994.

+

XML version by Jon Bosak, 1996-1998.

+

This work may be freely copied and distributed worldwide.

+
+ + + +Dramatis Personae + +DON PEDRO, prince of Arragon. +DON JOHN, his bastard brother. +CLAUDIO, a young lord of Florence. +BENEDICK, a young lord of Padua. +LEONATO, governor of Messina. +ANTONIO, his brother. +BALTHASAR, attendant on Don Pedro. + + +CONRADE +BORACHIO +followers of Don John. + + +FRIAR FRANCIS +DOGBERRY, a constable. +VERGES, a headborough. +A Sexton. +A Boy. +HERO, daughter to Leonato. +BEATRICE, niece to Leonato. + + +MARGARET +URSULA +gentlewomen attending on Hero. + + +Messengers, Watch, Attendants, &c. + + +SCENE Messina. + +MUCH ADO ABOUT NOTHING + +ACT I + +SCENE I. Before LEONATO'S house. +Enter LEONATO, HERO, and BEATRICE, with a +Messenger + + +LEONATO +I learn in this letter that Don Peter of Arragon +comes this night to Messina. + + + +Messenger +He is very near by this: he was not three leagues off +when I left him. + + + +LEONATO +How many gentlemen have you lost in this action? + + + +Messenger +But few of any sort, and none of name. + + + +LEONATO +A victory is twice itself when the achiever brings +home full numbers. I find here that Don Peter hath +bestowed much honour on a young Florentine called Claudio. + + + +Messenger +Much deserved on his part and equally remembered by +Don Pedro: he hath borne himself beyond the +promise of his age, doing, in the figure of a lamb, +the feats of a lion: he hath indeed better +bettered expectation than you must expect of me to +tell you how. + + + +LEONATO +He hath an uncle here in Messina will be very much +glad of it. + + + +Messenger +I have already delivered him letters, and there +appears much joy in him; even so much that joy could +not show itself modest enough without a badge of +bitterness. + + + +LEONATO +Did he break out into tears? + + + +Messenger +In great measure. + + + +LEONATO +A kind overflow of kindness: there are no faces +truer than those that are so washed. How much +better is it to weep at joy than to joy at weeping! + + + +BEATRICE +I pray you, is Signior Mountanto returned from the +wars or no? + + + +Messenger +I know none of that name, lady: there was none such +in the army of any sort. + + + +LEONATO +What is he that you ask for, niece? + + + +HERO +My cousin means Signior Benedick of Padua. + + + +Messenger +O, he's returned; and as pleasant as ever he was. + + + +BEATRICE +He set up his bills here in Messina and challenged +Cupid at the flight; and my uncle's fool, reading +the challenge, subscribed for Cupid, and challenged +him at the bird-bolt. I pray you, how many hath he +killed and eaten in these wars? But how many hath +he killed? for indeed I promised to eat all of his killing. + + + +LEONATO +Faith, niece, you tax Signior Benedick too much; +but he'll be meet with you, I doubt it not. + + + +Messenger +He hath done good service, lady, in these wars. + + + +BEATRICE +You had musty victual, and he hath holp to eat it: +he is a very valiant trencherman; he hath an +excellent stomach. + + + +Messenger +And a good soldier too, lady. + + + +BEATRICE +And a good soldier to a lady: but what is he to a lord? + + + +Messenger +A lord to a lord, a man to a man; stuffed with all +honourable virtues. + + + +BEATRICE +It is so, indeed; he is no less than a stuffed man: +but for the stuffing,--well, we are all mortal. + + + +LEONATO +You must not, sir, mistake my niece. There is a +kind of merry war betwixt Signior Benedick and her: +they never meet but there's a skirmish of wit +between them. + + + +BEATRICE +Alas! he gets nothing by that. In our last +conflict four of his five wits went halting off, and +now is the whole man governed with one: so that if +he have wit enough to keep himself warm, let him +bear it for a difference between himself and his +horse; for it is all the wealth that he hath left, +to be known a reasonable creature. Who is his +companion now? He hath every month a new sworn brother. + + + +Messenger +Is't possible? + + + +BEATRICE +Very easily possible: he wears his faith but as +the fashion of his hat; it ever changes with the +next block. + + + +Messenger +I see, lady, the gentleman is not in your books. + + + +BEATRICE +No; an he were, I would burn my study. But, I pray +you, who is his companion? Is there no young +squarer now that will make a voyage with him to the devil? + + + +Messenger +He is most in the company of the right noble Claudio. + + + +BEATRICE +O Lord, he will hang upon him like a disease: he +is sooner caught than the pestilence, and the taker +runs presently mad. God help the noble Claudio! if +he have caught the Benedick, it will cost him a +thousand pound ere a' be cured. + + + +Messenger +I will hold friends with you, lady. + + + +BEATRICE +Do, good friend. + + + +LEONATO +You will never run mad, niece. + + + +BEATRICE +No, not till a hot January. + + + +Messenger +Don Pedro is approached. + + + +Enter DON PEDRO, DON JOHN, CLAUDIO, BENEDICK, +and BALTHASAR + + +DON PEDRO +Good Signior Leonato, you are come to meet your +trouble: the fashion of the world is to avoid +cost, and you encounter it. + + + +LEONATO +Never came trouble to my house in the likeness of +your grace: for trouble being gone, comfort should +remain; but when you depart from me, sorrow abides +and happiness takes his leave. + + + +DON PEDRO +You embrace your charge too willingly. I think this +is your daughter. + + + +LEONATO +Her mother hath many times told me so. + + + +BENEDICK +Were you in doubt, sir, that you asked her? + + + +LEONATO +Signior Benedick, no; for then were you a child. + + + +DON PEDRO +You have it full, Benedick: we may guess by this +what you are, being a man. Truly, the lady fathers +herself. Be happy, lady; for you are like an +honourable father. + + + +BENEDICK +If Signior Leonato be her father, she would not +have his head on her shoulders for all Messina, as +like him as she is. + + + +BEATRICE +I wonder that you will still be talking, Signior +Benedick: nobody marks you. + + + +BENEDICK +What, my dear Lady Disdain! are you yet living? + + + +BEATRICE +Is it possible disdain should die while she hath +such meet food to feed it as Signior Benedick? +Courtesy itself must convert to disdain, if you come +in her presence. + + + +BENEDICK +Then is courtesy a turncoat. But it is certain I +am loved of all ladies, only you excepted: and I +would I could find in my heart that I had not a hard +heart; for, truly, I love none. + + + +BEATRICE +A dear happiness to women: they would else have +been troubled with a pernicious suitor. I thank God +and my cold blood, I am of your humour for that: I +had rather hear my dog bark at a crow than a man +swear he loves me. + + + +BENEDICK +God keep your ladyship still in that mind! so some +gentleman or other shall 'scape a predestinate +scratched face. + + + +BEATRICE +Scratching could not make it worse, an 'twere such +a face as yours were. + + + +BENEDICK +Well, you are a rare parrot-teacher. + + + +BEATRICE +A bird of my tongue is better than a beast of yours. + + + +BENEDICK +I would my horse had the speed of your tongue, and +so good a continuer. But keep your way, i' God's +name; I have done. + + + +BEATRICE +You always end with a jade's trick: I know you of old. + + + +DON PEDRO +That is the sum of all, Leonato. Signior Claudio +and Signior Benedick, my dear friend Leonato hath +invited you all. I tell him we shall stay here at +the least a month; and he heartily prays some +occasion may detain us longer. I dare swear he is no +hypocrite, but prays from his heart. + + + +LEONATO +If you swear, my lord, you shall not be forsworn. +To DON JOHN +Let me bid you welcome, my lord: being reconciled to +the prince your brother, I owe you all duty. + + + +DON JOHN +I thank you: I am not of many words, but I thank +you. + + + +LEONATO +Please it your grace lead on? + + + +DON PEDRO +Your hand, Leonato; we will go together. + + + +Exeunt all except BENEDICK and CLAUDIO + + +CLAUDIO +Benedick, didst thou note the daughter of Signior Leonato? + + + +BENEDICK +I noted her not; but I looked on her. + + + +CLAUDIO +Is she not a modest young lady? + + + +BENEDICK +Do you question me, as an honest man should do, for +my simple true judgment; or would you have me speak +after my custom, as being a professed tyrant to their sex? + + + +CLAUDIO +No; I pray thee speak in sober judgment. + + + +BENEDICK +Why, i' faith, methinks she's too low for a high +praise, too brown for a fair praise and too little +for a great praise: only this commendation I can +afford her, that were she other than she is, she +were unhandsome; and being no other but as she is, I +do not like her. + + + +CLAUDIO +Thou thinkest I am in sport: I pray thee tell me +truly how thou likest her. + + + +BENEDICK +Would you buy her, that you inquire after her? + + + +CLAUDIO +Can the world buy such a jewel? + + + +BENEDICK +Yea, and a case to put it into. But speak you this +with a sad brow? or do you play the flouting Jack, +to tell us Cupid is a good hare-finder and Vulcan a +rare carpenter? Come, in what key shall a man take +you, to go in the song? + + + +CLAUDIO +In mine eye she is the sweetest lady that ever I +looked on. + + + +BENEDICK +I can see yet without spectacles and I see no such +matter: there's her cousin, an she were not +possessed with a fury, exceeds her as much in beauty +as the first of May doth the last of December. But I +hope you have no intent to turn husband, have you? + + + +CLAUDIO +I would scarce trust myself, though I had sworn the +contrary, if Hero would be my wife. + + + +BENEDICK +Is't come to this? In faith, hath not the world +one man but he will wear his cap with suspicion? +Shall I never see a bachelor of three-score again? +Go to, i' faith; an thou wilt needs thrust thy neck +into a yoke, wear the print of it and sigh away +Sundays. Look Don Pedro is returned to seek you. + + + +Re-enter DON PEDRO + + +DON PEDRO +What secret hath held you here, that you followed +not to Leonato's? + + + +BENEDICK +I would your grace would constrain me to tell. + + + +DON PEDRO +I charge thee on thy allegiance. + + + +BENEDICK +You hear, Count Claudio: I can be secret as a dumb +man; I would have you think so; but, on my +allegiance, mark you this, on my allegiance. He is +in love. With who? now that is your grace's part. +Mark how short his answer is;--With Hero, Leonato's +short daughter. + + + +CLAUDIO +If this were so, so were it uttered. + + + +BENEDICK +Like the old tale, my lord: 'it is not so, nor +'twas not so, but, indeed, God forbid it should be +so.' + + + +CLAUDIO +If my passion change not shortly, God forbid it +should be otherwise. + + + +DON PEDRO +Amen, if you love her; for the lady is very well worthy. + + + +CLAUDIO +You speak this to fetch me in, my lord. + + + +DON PEDRO +By my troth, I speak my thought. + + + +CLAUDIO +And, in faith, my lord, I spoke mine. + + + +BENEDICK +And, by my two faiths and troths, my lord, I spoke mine. + + + +CLAUDIO +That I love her, I feel. + + + +DON PEDRO +That she is worthy, I know. + + + +BENEDICK +That I neither feel how she should be loved nor +know how she should be worthy, is the opinion that +fire cannot melt out of me: I will die in it at the stake. + + + +DON PEDRO +Thou wast ever an obstinate heretic in the despite +of beauty. + + + +CLAUDIO +And never could maintain his part but in the force +of his will. + + + +BENEDICK +That a woman conceived me, I thank her; that she +brought me up, I likewise give her most humble +thanks: but that I will have a recheat winded in my +forehead, or hang my bugle in an invisible baldrick, +all women shall pardon me. Because I will not do +them the wrong to mistrust any, I will do myself the +right to trust none; and the fine is, for the which +I may go the finer, I will live a bachelor. + + + +DON PEDRO +I shall see thee, ere I die, look pale with love. + + + +BENEDICK +With anger, with sickness, or with hunger, my lord, +not with love: prove that ever I lose more blood +with love than I will get again with drinking, pick +out mine eyes with a ballad-maker's pen and hang me +up at the door of a brothel-house for the sign of +blind Cupid. + + + +DON PEDRO +Well, if ever thou dost fall from this faith, thou +wilt prove a notable argument. + + + +BENEDICK +If I do, hang me in a bottle like a cat and shoot +at me; and he that hits me, let him be clapped on +the shoulder, and called Adam. + + + +DON PEDRO +Well, as time shall try: 'In time the savage bull +doth bear the yoke.' + + + +BENEDICK +The savage bull may; but if ever the sensible +Benedick bear it, pluck off the bull's horns and set +them in my forehead: and let me be vilely painted, +and in such great letters as they write 'Here is +good horse to hire,' let them signify under my sign +'Here you may see Benedick the married man.' + + + +CLAUDIO +If this should ever happen, thou wouldst be horn-mad. + + + +DON PEDRO +Nay, if Cupid have not spent all his quiver in +Venice, thou wilt quake for this shortly. + + + +BENEDICK +I look for an earthquake too, then. + + + +DON PEDRO +Well, you temporize with the hours. In the +meantime, good Signior Benedick, repair to +Leonato's: commend me to him and tell him I will +not fail him at supper; for indeed he hath made +great preparation. + + + +BENEDICK +I have almost matter enough in me for such an +embassage; and so I commit you-- + + + +CLAUDIO +To the tuition of God: From my house, if I had it,-- + + + +DON PEDRO +The sixth of July: Your loving friend, Benedick. + + + +BENEDICK +Nay, mock not, mock not. The body of your +discourse is sometime guarded with fragments, and +the guards are but slightly basted on neither: ere +you flout old ends any further, examine your +conscience: and so I leave you. + + + +Exit + + +CLAUDIO +My liege, your highness now may do me good. + + + +DON PEDRO +My love is thine to teach: teach it but how, +And thou shalt see how apt it is to learn +Any hard lesson that may do thee good. + + + +CLAUDIO +Hath Leonato any son, my lord? + + + +DON PEDRO +No child but Hero; she's his only heir. +Dost thou affect her, Claudio? + + + +CLAUDIO +O, my lord, +When you went onward on this ended action, +I look'd upon her with a soldier's eye, +That liked, but had a rougher task in hand +Than to drive liking to the name of love: +But now I am return'd and that war-thoughts +Have left their places vacant, in their rooms +Come thronging soft and delicate desires, +All prompting me how fair young Hero is, +Saying, I liked her ere I went to wars. + + + +DON PEDRO +Thou wilt be like a lover presently +And tire the hearer with a book of words. +If thou dost love fair Hero, cherish it, +And I will break with her and with her father, +And thou shalt have her. Was't not to this end +That thou began'st to twist so fine a story? + + + +CLAUDIO +How sweetly you do minister to love, +That know love's grief by his complexion! +But lest my liking might too sudden seem, +I would have salved it with a longer treatise. + + + +DON PEDRO +What need the bridge much broader than the flood? +The fairest grant is the necessity. +Look, what will serve is fit: 'tis once, thou lovest, +And I will fit thee with the remedy. +I know we shall have revelling to-night: +I will assume thy part in some disguise +And tell fair Hero I am Claudio, +And in her bosom I'll unclasp my heart +And take her hearing prisoner with the force +And strong encounter of my amorous tale: +Then after to her father will I break; +And the conclusion is, she shall be thine. +In practise let us put it presently. + + + +Exeunt + + +SCENE II. A room in LEONATO's house. +Enter LEONATO and ANTONIO, meeting + + +LEONATO +How now, brother! Where is my cousin, your son? +hath he provided this music? + + + +ANTONIO +He is very busy about it. But, brother, I can tell +you strange news that you yet dreamt not of. + + + +LEONATO +Are they good? + + + +ANTONIO +As the event stamps them: but they have a good +cover; they show well outward. The prince and Count +Claudio, walking in a thick-pleached alley in mine +orchard, were thus much overheard by a man of mine: +the prince discovered to Claudio that he loved my +niece your daughter and meant to acknowledge it +this night in a dance: and if he found her +accordant, he meant to take the present time by the +top and instantly break with you of it. + + + +LEONATO +Hath the fellow any wit that told you this? + + + +ANTONIO +A good sharp fellow: I will send for him; and +question him yourself. + + + +LEONATO +No, no; we will hold it as a dream till it appear +itself: but I will acquaint my daughter withal, +that she may be the better prepared for an answer, +if peradventure this be true. Go you and tell her of it. +Enter Attendants +Cousins, you know what you have to do. O, I cry you +mercy, friend; go you with me, and I will use your +skill. Good cousin, have a care this busy time. + + + +Exeunt + + +SCENE III. The same. +Enter DON JOHN and CONRADE + + +CONRADE +What the good-year, my lord! why are you thus out +of measure sad? + + + +DON JOHN +There is no measure in the occasion that breeds; +therefore the sadness is without limit. + + + +CONRADE +You should hear reason. + + + +DON JOHN +And when I have heard it, what blessing brings it? + + + +CONRADE +If not a present remedy, at least a patient +sufferance. + + + +DON JOHN +I wonder that thou, being, as thou sayest thou art, +born under Saturn, goest about to apply a moral +medicine to a mortifying mischief. I cannot hide +what I am: I must be sad when I have cause and smile +at no man's jests, eat when I have stomach and wait +for no man's leisure, sleep when I am drowsy and +tend on no man's business, laugh when I am merry and +claw no man in his humour. + + + +CONRADE +Yea, but you must not make the full show of this +till you may do it without controlment. You have of +late stood out against your brother, and he hath +ta'en you newly into his grace; where it is +impossible you should take true root but by the +fair weather that you make yourself: it is needful +that you frame the season for your own harvest. + + + +DON JOHN +I had rather be a canker in a hedge than a rose in +his grace, and it better fits my blood to be +disdained of all than to fashion a carriage to rob +love from any: in this, though I cannot be said to +be a flattering honest man, it must not be denied +but I am a plain-dealing villain. I am trusted with +a muzzle and enfranchised with a clog; therefore I +have decreed not to sing in my cage. If I had my +mouth, I would bite; if I had my liberty, I would do +my liking: in the meantime let me be that I am and +seek not to alter me. + + + +CONRADE +Can you make no use of your discontent? + + + +DON JOHN +I make all use of it, for I use it only. +Who comes here? +Enter BORACHIO +What news, Borachio? + + + +BORACHIO +I came yonder from a great supper: the prince your +brother is royally entertained by Leonato: and I +can give you intelligence of an intended marriage. + + + +DON JOHN +Will it serve for any model to build mischief on? +What is he for a fool that betroths himself to +unquietness? + + + +BORACHIO +Marry, it is your brother's right hand. + + + +DON JOHN +Who? the most exquisite Claudio? + + + +BORACHIO +Even he. + + + +DON JOHN +A proper squire! And who, and who? which way looks +he? + + + +BORACHIO +Marry, on Hero, the daughter and heir of Leonato. + + + +DON JOHN +A very forward March-chick! How came you to this? + + + +BORACHIO +Being entertained for a perfumer, as I was smoking a +musty room, comes me the prince and Claudio, hand +in hand in sad conference: I whipt me behind the +arras; and there heard it agreed upon that the +prince should woo Hero for himself, and having +obtained her, give her to Count Claudio. + + + +DON JOHN +Come, come, let us thither: this may prove food to +my displeasure. That young start-up hath all the +glory of my overthrow: if I can cross him any way, I +bless myself every way. You are both sure, and will assist me? + + + +CONRADE +To the death, my lord. + + + +DON JOHN +Let us to the great supper: their cheer is the +greater that I am subdued. Would the cook were of +my mind! Shall we go prove what's to be done? + + + +BORACHIO +We'll wait upon your lordship. + + + +Exeunt + + + + +ACT II + +SCENE I. A hall in LEONATO'S house. +Enter LEONATO, ANTONIO, HERO, BEATRICE, and others + + +LEONATO +Was not Count John here at supper? + + + +ANTONIO +I saw him not. + + + +BEATRICE +How tartly that gentleman looks! I never can see +him but I am heart-burned an hour after. + + + +HERO +He is of a very melancholy disposition. + + + +BEATRICE +He were an excellent man that were made just in the +midway between him and Benedick: the one is too +like an image and says nothing, and the other too +like my lady's eldest son, evermore tattling. + + + +LEONATO +Then half Signior Benedick's tongue in Count John's +mouth, and half Count John's melancholy in Signior +Benedick's face,-- + + + +BEATRICE +With a good leg and a good foot, uncle, and money +enough in his purse, such a man would win any woman +in the world, if a' could get her good-will. + + + +LEONATO +By my troth, niece, thou wilt never get thee a +husband, if thou be so shrewd of thy tongue. + + + +ANTONIO +In faith, she's too curst. + + + +BEATRICE +Too curst is more than curst: I shall lessen God's +sending that way; for it is said, 'God sends a curst +cow short horns;' but to a cow too curst he sends none. + + + +LEONATO +So, by being too curst, God will send you no horns. + + + +BEATRICE +Just, if he send me no husband; for the which +blessing I am at him upon my knees every morning and +evening. Lord, I could not endure a husband with a +beard on his face: I had rather lie in the woollen. + + + +LEONATO +You may light on a husband that hath no beard. + + + +BEATRICE +What should I do with him? dress him in my apparel +and make him my waiting-gentlewoman? He that hath a +beard is more than a youth, and he that hath no +beard is less than a man: and he that is more than +a youth is not for me, and he that is less than a +man, I am not for him: therefore, I will even take +sixpence in earnest of the bear-ward, and lead his +apes into hell. + + + +LEONATO +Well, then, go you into hell? + + + +BEATRICE +No, but to the gate; and there will the devil meet +me, like an old cuckold, with horns on his head, and +say 'Get you to heaven, Beatrice, get you to +heaven; here's no place for you maids:' so deliver +I up my apes, and away to Saint Peter for the +heavens; he shows me where the bachelors sit, and +there live we as merry as the day is long. + + + +ANTONIO +To HERO Well, niece, I trust you will be ruled +by your father. + + + +BEATRICE +Yes, faith; it is my cousin's duty to make curtsy +and say 'Father, as it please you.' But yet for all +that, cousin, let him be a handsome fellow, or else +make another curtsy and say 'Father, as it please +me.' + + + +LEONATO +Well, niece, I hope to see you one day fitted with a husband. + + + +BEATRICE +Not till God make men of some other metal than +earth. Would it not grieve a woman to be +overmastered with a pierce of valiant dust? to make +an account of her life to a clod of wayward marl? +No, uncle, I'll none: Adam's sons are my brethren; +and, truly, I hold it a sin to match in my kindred. + + + +LEONATO +Daughter, remember what I told you: if the prince +do solicit you in that kind, you know your answer. + + + +BEATRICE +The fault will be in the music, cousin, if you be +not wooed in good time: if the prince be too +important, tell him there is measure in every thing +and so dance out the answer. For, hear me, Hero: +wooing, wedding, and repenting, is as a Scotch jig, +a measure, and a cinque pace: the first suit is hot +and hasty, like a Scotch jig, and full as +fantastical; the wedding, mannerly-modest, as a +measure, full of state and ancientry; and then comes +repentance and, with his bad legs, falls into the +cinque pace faster and faster, till he sink into his grave. + + + +LEONATO +Cousin, you apprehend passing shrewdly. + + + +BEATRICE +I have a good eye, uncle; I can see a church by daylight. + + + +LEONATO +The revellers are entering, brother: make good room. + + +All put on their masks +Enter DON PEDRO, CLAUDIO, BENEDICK, BALTHASAR, +DON JOHN, BORACHIO, MARGARET, URSULA and others, masked + + +DON PEDRO +Lady, will you walk about with your friend? + + + +HERO +So you walk softly and look sweetly and say nothing, +I am yours for the walk; and especially when I walk away. + + + +DON PEDRO +With me in your company? + + + +HERO +I may say so, when I please. + + + +DON PEDRO +And when please you to say so? + + + +HERO +When I like your favour; for God defend the lute +should be like the case! + + + +DON PEDRO +My visor is Philemon's roof; within the house is Jove. + + + +HERO +Why, then, your visor should be thatched. + + + +DON PEDRO +Speak low, if you speak love. + + + +Drawing her aside + + +BALTHASAR +Well, I would you did like me. + + + +MARGARET +So would not I, for your own sake; for I have many +ill-qualities. + + + +BALTHASAR +Which is one? + + + +MARGARET +I say my prayers aloud. + + + +BALTHASAR +I love you the better: the hearers may cry, Amen. + + + +MARGARET +God match me with a good dancer! + + + +BALTHASAR +Amen. + + + +MARGARET +And God keep him out of my sight when the dance is +done! Answer, clerk. + + + +BALTHASAR +No more words: the clerk is answered. + + + +URSULA +I know you well enough; you are Signior Antonio. + + + +ANTONIO +At a word, I am not. + + + +URSULA +I know you by the waggling of your head. + + + +ANTONIO +To tell you true, I counterfeit him. + + + +URSULA +You could never do him so ill-well, unless you were +the very man. Here's his dry hand up and down: you +are he, you are he. + + + +ANTONIO +At a word, I am not. + + + +URSULA +Come, come, do you think I do not know you by your +excellent wit? can virtue hide itself? Go to, +mum, you are he: graces will appear, and there's an +end. + + + +BEATRICE +Will you not tell me who told you so? + + + +BENEDICK +No, you shall pardon me. + + + +BEATRICE +Nor will you not tell me who you are? + + + +BENEDICK +Not now. + + + +BEATRICE +That I was disdainful, and that I had my good wit +out of the 'Hundred Merry Tales:'--well this was +Signior Benedick that said so. + + + +BENEDICK +What's he? + + + +BEATRICE +I am sure you know him well enough. + + + +BENEDICK +Not I, believe me. + + + +BEATRICE +Did he never make you laugh? + + + +BENEDICK +I pray you, what is he? + + + +BEATRICE +Why, he is the prince's jester: a very dull fool; +only his gift is in devising impossible slanders: +none but libertines delight in him; and the +commendation is not in his wit, but in his villany; +for he both pleases men and angers them, and then +they laugh at him and beat him. I am sure he is in +the fleet: I would he had boarded me. + + + +BENEDICK +When I know the gentleman, I'll tell him what you say. + + + +BEATRICE +Do, do: he'll but break a comparison or two on me; +which, peradventure not marked or not laughed at, +strikes him into melancholy; and then there's a +partridge wing saved, for the fool will eat no +supper that night. +Music +We must follow the leaders. + + + +BENEDICK +In every good thing. + + + +BEATRICE +Nay, if they lead to any ill, I will leave them at +the next turning. + + + +Dance. Then exeunt all except DON JOHN, BORACHIO, +and CLAUDIO + + +DON JOHN +Sure my brother is amorous on Hero and hath +withdrawn her father to break with him about it. +The ladies follow her and but one visor remains. + + + +BORACHIO +And that is Claudio: I know him by his bearing. + + + +DON JOHN +Are not you Signior Benedick? + + + +CLAUDIO +You know me well; I am he. + + + +DON JOHN +Signior, you are very near my brother in his love: +he is enamoured on Hero; I pray you, dissuade him +from her: she is no equal for his birth: you may +do the part of an honest man in it. + + + +CLAUDIO +How know you he loves her? + + + +DON JOHN +I heard him swear his affection. + + + +BORACHIO +So did I too; and he swore he would marry her to-night. + + + +DON JOHN +Come, let us to the banquet. + + + +Exeunt DON JOHN and BORACHIO + + +CLAUDIO +Thus answer I in the name of Benedick, +But hear these ill news with the ears of Claudio. +'Tis certain so; the prince wooes for himself. +Friendship is constant in all other things +Save in the office and affairs of love: +Therefore, all hearts in love use their own tongues; +Let every eye negotiate for itself +And trust no agent; for beauty is a witch +Against whose charms faith melteth into blood. +This is an accident of hourly proof, +Which I mistrusted not. Farewell, therefore, Hero! + + + +Re-enter BENEDICK + + +BENEDICK +Count Claudio? + + + +CLAUDIO +Yea, the same. + + + +BENEDICK +Come, will you go with me? + + + +CLAUDIO +Whither? + + + +BENEDICK +Even to the next willow, about your own business, +county. What fashion will you wear the garland of? +about your neck, like an usurer's chain? or under +your arm, like a lieutenant's scarf? You must wear +it one way, for the prince hath got your Hero. + + + +CLAUDIO +I wish him joy of her. + + + +BENEDICK +Why, that's spoken like an honest drovier: so they +sell bullocks. But did you think the prince would +have served you thus? + + + +CLAUDIO +I pray you, leave me. + + + +BENEDICK +Ho! now you strike like the blind man: 'twas the +boy that stole your meat, and you'll beat the post. + + + +CLAUDIO +If it will not be, I'll leave you. + + + +Exit + + +BENEDICK +Alas, poor hurt fowl! now will he creep into sedges. +But that my Lady Beatrice should know me, and not +know me! The prince's fool! Ha? It may be I go +under that title because I am merry. Yea, but so I +am apt to do myself wrong; I am not so reputed: it +is the base, though bitter, disposition of Beatrice +that puts the world into her person and so gives me +out. Well, I'll be revenged as I may. + + + +Re-enter DON PEDRO + + +DON PEDRO +Now, signior, where's the count? did you see him? + + + +BENEDICK +Troth, my lord, I have played the part of Lady Fame. +I found him here as melancholy as a lodge in a +warren: I told him, and I think I told him true, +that your grace had got the good will of this young +lady; and I offered him my company to a willow-tree, +either to make him a garland, as being forsaken, or +to bind him up a rod, as being worthy to be whipped. + + + +DON PEDRO +To be whipped! What's his fault? + + + +BENEDICK +The flat transgression of a schoolboy, who, being +overjoyed with finding a birds' nest, shows it his +companion, and he steals it. + + + +DON PEDRO +Wilt thou make a trust a transgression? The +transgression is in the stealer. + + + +BENEDICK +Yet it had not been amiss the rod had been made, +and the garland too; for the garland he might have +worn himself, and the rod he might have bestowed on +you, who, as I take it, have stolen his birds' nest. + + + +DON PEDRO +I will but teach them to sing, and restore them to +the owner. + + + +BENEDICK +If their singing answer your saying, by my faith, +you say honestly. + + + +DON PEDRO +The Lady Beatrice hath a quarrel to you: the +gentleman that danced with her told her she is much +wronged by you. + + + +BENEDICK +O, she misused me past the endurance of a block! +an oak but with one green leaf on it would have +answered her; my very visor began to assume life and +scold with her. She told me, not thinking I had been +myself, that I was the prince's jester, that I was +duller than a great thaw; huddling jest upon jest +with such impossible conveyance upon me that I stood +like a man at a mark, with a whole army shooting at +me. She speaks poniards, and every word stabs: +if her breath were as terrible as her terminations, +there were no living near her; she would infect to +the north star. I would not marry her, though she +were endowed with all that Adam bad left him before +he transgressed: she would have made Hercules have +turned spit, yea, and have cleft his club to make +the fire too. Come, talk not of her: you shall find +her the infernal Ate in good apparel. I would to God +some scholar would conjure her; for certainly, while +she is here, a man may live as quiet in hell as in a +sanctuary; and people sin upon purpose, because they +would go thither; so, indeed, all disquiet, horror +and perturbation follows her. + + + +DON PEDRO +Look, here she comes. + + + +Enter CLAUDIO, BEATRICE, HERO, and LEONATO + + +BENEDICK +Will your grace command me any service to the +world's end? I will go on the slightest errand now +to the Antipodes that you can devise to send me on; +I will fetch you a tooth-picker now from the +furthest inch of Asia, bring you the length of +Prester John's foot, fetch you a hair off the great +Cham's beard, do you any embassage to the Pigmies, +rather than hold three words' conference with this +harpy. You have no employment for me? + + + +DON PEDRO +None, but to desire your good company. + + + +BENEDICK +O God, sir, here's a dish I love not: I cannot +endure my Lady Tongue. + + + +Exit + + +DON PEDRO +Come, lady, come; you have lost the heart of +Signior Benedick. + + + +BEATRICE +Indeed, my lord, he lent it me awhile; and I gave +him use for it, a double heart for his single one: +marry, once before he won it of me with false dice, +therefore your grace may well say I have lost it. + + + +DON PEDRO +You have put him down, lady, you have put him down. + + + +BEATRICE +So I would not he should do me, my lord, lest I +should prove the mother of fools. I have brought +Count Claudio, whom you sent me to seek. + + + +DON PEDRO +Why, how now, count! wherefore are you sad? + + + +CLAUDIO +Not sad, my lord. + + + +DON PEDRO +How then? sick? + + + +CLAUDIO +Neither, my lord. + + + +BEATRICE +The count is neither sad, nor sick, nor merry, nor +well; but civil count, civil as an orange, and +something of that jealous complexion. + + + +DON PEDRO +I' faith, lady, I think your blazon to be true; +though, I'll be sworn, if he be so, his conceit is +false. Here, Claudio, I have wooed in thy name, and +fair Hero is won: I have broke with her father, +and his good will obtained: name the day of +marriage, and God give thee joy! + + + +LEONATO +Count, take of me my daughter, and with her my +fortunes: his grace hath made the match, and an +grace say Amen to it. + + + +BEATRICE +Speak, count, 'tis your cue. + + + +CLAUDIO +Silence is the perfectest herald of joy: I were +but little happy, if I could say how much. Lady, as +you are mine, I am yours: I give away myself for +you and dote upon the exchange. + + + +BEATRICE +Speak, cousin; or, if you cannot, stop his mouth +with a kiss, and let not him speak neither. + + + +DON PEDRO +In faith, lady, you have a merry heart. + + + +BEATRICE +Yea, my lord; I thank it, poor fool, it keeps on +the windy side of care. My cousin tells him in his +ear that he is in her heart. + + + +CLAUDIO +And so she doth, cousin. + + + +BEATRICE +Good Lord, for alliance! Thus goes every one to the +world but I, and I am sunburnt; I may sit in a +corner and cry heigh-ho for a husband! + + + +DON PEDRO +Lady Beatrice, I will get you one. + + + +BEATRICE +I would rather have one of your father's getting. +Hath your grace ne'er a brother like you? Your +father got excellent husbands, if a maid could come by them. + + + +DON PEDRO +Will you have me, lady? + + + +BEATRICE +No, my lord, unless I might have another for +working-days: your grace is too costly to wear +every day. But, I beseech your grace, pardon me: I +was born to speak all mirth and no matter. + + + +DON PEDRO +Your silence most offends me, and to be merry best +becomes you; for, out of question, you were born in +a merry hour. + + + +BEATRICE +No, sure, my lord, my mother cried; but then there +was a star danced, and under that was I born. +Cousins, God give you joy! + + + +LEONATO +Niece, will you look to those things I told you of? + + + +BEATRICE +I cry you mercy, uncle. By your grace's pardon. + + + +Exit + + +DON PEDRO +By my troth, a pleasant-spirited lady. + + + +LEONATO +There's little of the melancholy element in her, my +lord: she is never sad but when she sleeps, and +not ever sad then; for I have heard my daughter say, +she hath often dreamed of unhappiness and waked +herself with laughing. + + + +DON PEDRO +She cannot endure to hear tell of a husband. + + + +LEONATO +O, by no means: she mocks all her wooers out of suit. + + + +DON PEDRO +She were an excellent wife for Benedict. + + + +LEONATO +O Lord, my lord, if they were but a week married, +they would talk themselves mad. + + + +DON PEDRO +County Claudio, when mean you to go to church? + + + +CLAUDIO +To-morrow, my lord: time goes on crutches till love +have all his rites. + + + +LEONATO +Not till Monday, my dear son, which is hence a just +seven-night; and a time too brief, too, to have all +things answer my mind. + + + +DON PEDRO +Come, you shake the head at so long a breathing: +but, I warrant thee, Claudio, the time shall not go +dully by us. I will in the interim undertake one of +Hercules' labours; which is, to bring Signior +Benedick and the Lady Beatrice into a mountain of +affection the one with the other. I would fain have +it a match, and I doubt not but to fashion it, if +you three will but minister such assistance as I +shall give you direction. + + + +LEONATO +My lord, I am for you, though it cost me ten +nights' watchings. + + + +CLAUDIO +And I, my lord. + + + +DON PEDRO +And you too, gentle Hero? + + + +HERO +I will do any modest office, my lord, to help my +cousin to a good husband. + + + +DON PEDRO +And Benedick is not the unhopefullest husband that +I know. Thus far can I praise him; he is of a noble +strain, of approved valour and confirmed honesty. I +will teach you how to humour your cousin, that she +shall fall in love with Benedick; and I, with your +two helps, will so practise on Benedick that, in +despite of his quick wit and his queasy stomach, he +shall fall in love with Beatrice. If we can do this, +Cupid is no longer an archer: his glory shall be +ours, for we are the only love-gods. Go in with me, +and I will tell you my drift. + + + +Exeunt + + +SCENE II. The same. +Enter DON JOHN and BORACHIO + + +DON JOHN +It is so; the Count Claudio shall marry the +daughter of Leonato. + + + +BORACHIO +Yea, my lord; but I can cross it. + + + +DON JOHN +Any bar, any cross, any impediment will be +medicinable to me: I am sick in displeasure to him, +and whatsoever comes athwart his affection ranges +evenly with mine. How canst thou cross this marriage? + + + +BORACHIO +Not honestly, my lord; but so covertly that no +dishonesty shall appear in me. + + + +DON JOHN +Show me briefly how. + + + +BORACHIO +I think I told your lordship a year since, how much +I am in the favour of Margaret, the waiting +gentlewoman to Hero. + + + +DON JOHN +I remember. + + + +BORACHIO +I can, at any unseasonable instant of the night, +appoint her to look out at her lady's chamber window. + + + +DON JOHN +What life is in that, to be the death of this marriage? + + + +BORACHIO +The poison of that lies in you to temper. Go you to +the prince your brother; spare not to tell him that +he hath wronged his honour in marrying the renowned +Claudio--whose estimation do you mightily hold +up--to a contaminated stale, such a one as Hero. + + + +DON JOHN +What proof shall I make of that? + + + +BORACHIO +Proof enough to misuse the prince, to vex Claudio, +to undo Hero and kill Leonato. Look you for any +other issue? + + + +DON JOHN +Only to despite them, I will endeavour any thing. + + + +BORACHIO +Go, then; find me a meet hour to draw Don Pedro and +the Count Claudio alone: tell them that you know +that Hero loves me; intend a kind of zeal both to the +prince and Claudio, as,--in love of your brother's +honour, who hath made this match, and his friend's +reputation, who is thus like to be cozened with the +semblance of a maid,--that you have discovered +thus. They will scarcely believe this without trial: +offer them instances; which shall bear no less +likelihood than to see me at her chamber-window, +hear me call Margaret Hero, hear Margaret term me +Claudio; and bring them to see this the very night +before the intended wedding,--for in the meantime I +will so fashion the matter that Hero shall be +absent,--and there shall appear such seeming truth +of Hero's disloyalty that jealousy shall be called +assurance and all the preparation overthrown. + + + +DON JOHN +Grow this to what adverse issue it can, I will put +it in practise. Be cunning in the working this, and +thy fee is a thousand ducats. + + + +BORACHIO +Be you constant in the accusation, and my cunning +shall not shame me. + + + +DON JOHN +I will presently go learn their day of marriage. + + + +Exeunt + + +SCENE III. LEONATO'S orchard. +Enter BENEDICK + + +BENEDICK +Boy! + + + +Enter Boy + + +Boy +Signior? + + + +BENEDICK +In my chamber-window lies a book: bring it hither +to me in the orchard. + + + +Boy +I am here already, sir. + + + +BENEDICK +I know that; but I would have thee hence, and here again. +Exit Boy +I do much wonder that one man, seeing how much +another man is a fool when he dedicates his +behaviors to love, will, after he hath laughed at +such shallow follies in others, become the argument +of his own scorn by failing in love: and such a man +is Claudio. I have known when there was no music +with him but the drum and the fife; and now had he +rather hear the tabour and the pipe: I have known +when he would have walked ten mile a-foot to see a +good armour; and now will he lie ten nights awake, +carving the fashion of a new doublet. He was wont to +speak plain and to the purpose, like an honest man +and a soldier; and now is he turned orthography; his +words are a very fantastical banquet, just so many +strange dishes. May I be so converted and see with +these eyes? I cannot tell; I think not: I will not +be sworn, but love may transform me to an oyster; but +I'll take my oath on it, till he have made an oyster +of me, he shall never make me such a fool. One woman +is fair, yet I am well; another is wise, yet I am +well; another virtuous, yet I am well; but till all +graces be in one woman, one woman shall not come in +my grace. Rich she shall be, that's certain; wise, +or I'll none; virtuous, or I'll never cheapen her; +fair, or I'll never look on her; mild, or come not +near me; noble, or not I for an angel; of good +discourse, an excellent musician, and her hair shall +be of what colour it please God. Ha! the prince and +Monsieur Love! I will hide me in the arbour. + + +Withdraws +Enter DON PEDRO, CLAUDIO, and LEONATO + + +DON PEDRO +Come, shall we hear this music? + + + +CLAUDIO +Yea, my good lord. How still the evening is, +As hush'd on purpose to grace harmony! + + + +DON PEDRO +See you where Benedick hath hid himself? + + + +CLAUDIO +O, very well, my lord: the music ended, +We'll fit the kid-fox with a pennyworth. + + + +Enter BALTHASAR with Music + + +DON PEDRO +Come, Balthasar, we'll hear that song again. + + + +BALTHASAR +O, good my lord, tax not so bad a voice +To slander music any more than once. + + + +DON PEDRO +It is the witness still of excellency +To put a strange face on his own perfection. +I pray thee, sing, and let me woo no more. + + + +BALTHASAR +Because you talk of wooing, I will sing; +Since many a wooer doth commence his suit +To her he thinks not worthy, yet he wooes, +Yet will he swear he loves. + + + +DON PEDRO +Now, pray thee, come; +Or, if thou wilt hold longer argument, +Do it in notes. + + + +BALTHASAR +Note this before my notes; +There's not a note of mine that's worth the noting. + + + +DON PEDRO +Why, these are very crotchets that he speaks; +Note, notes, forsooth, and nothing. + + + +Air + + +BENEDICK +Now, divine air! now is his soul ravished! Is it +not strange that sheeps' guts should hale souls out +of men's bodies? Well, a horn for my money, when +all's done. + + + +The Song + + +BALTHASAR +Sigh no more, ladies, sigh no more, +Men were deceivers ever, +One foot in sea and one on shore, +To one thing constant never: +Then sigh not so, but let them go, +And be you blithe and bonny, +Converting all your sounds of woe +Into Hey nonny, nonny. +Sing no more ditties, sing no moe, +Of dumps so dull and heavy; +The fraud of men was ever so, +Since summer first was leafy: +Then sigh not so, &c. + + + +DON PEDRO +By my troth, a good song. + + + +BALTHASAR +And an ill singer, my lord. + + + +DON PEDRO +Ha, no, no, faith; thou singest well enough for a shift. + + + +BENEDICK +An he had been a dog that should have howled thus, +they would have hanged him: and I pray God his bad +voice bode no mischief. I had as lief have heard the +night-raven, come what plague could have come after +it. + + + +DON PEDRO +Yea, marry, dost thou hear, Balthasar? I pray thee, +get us some excellent music; for to-morrow night we +would have it at the Lady Hero's chamber-window. + + + +BALTHASAR +The best I can, my lord. + + + +DON PEDRO +Do so: farewell. +Exit BALTHASAR +Come hither, Leonato. What was it you told me of +to-day, that your niece Beatrice was in love with +Signior Benedick? + + + +CLAUDIO +O, ay: stalk on. stalk on; the fowl sits. I did +never think that lady would have loved any man. + + + +LEONATO +No, nor I neither; but most wonderful that she +should so dote on Signior Benedick, whom she hath in +all outward behaviors seemed ever to abhor. + + + +BENEDICK +Is't possible? Sits the wind in that corner? + + + +LEONATO +By my troth, my lord, I cannot tell what to think +of it but that she loves him with an enraged +affection: it is past the infinite of thought. + + + +DON PEDRO +May be she doth but counterfeit. + + + +CLAUDIO +Faith, like enough. + + + +LEONATO +O God, counterfeit! There was never counterfeit of +passion came so near the life of passion as she +discovers it. + + + +DON PEDRO +Why, what effects of passion shows she? + + + +CLAUDIO +Bait the hook well; this fish will bite. + + + +LEONATO +What effects, my lord? She will sit you, you heard +my daughter tell you how. + + + +CLAUDIO +She did, indeed. + + + +DON PEDRO +How, how, pray you? You amaze me: I would have I +thought her spirit had been invincible against all +assaults of affection. + + + +LEONATO +I would have sworn it had, my lord; especially +against Benedick. + + + +BENEDICK +I should think this a gull, but that the +white-bearded fellow speaks it: knavery cannot, +sure, hide himself in such reverence. + + + +CLAUDIO +He hath ta'en the infection: hold it up. + + + +DON PEDRO +Hath she made her affection known to Benedick? + + + +LEONATO +No; and swears she never will: that's her torment. + + + +CLAUDIO +'Tis true, indeed; so your daughter says: 'Shall +I,' says she, 'that have so oft encountered him +with scorn, write to him that I love him?' + + + +LEONATO +This says she now when she is beginning to write to +him; for she'll be up twenty times a night, and +there will she sit in her smock till she have writ a +sheet of paper: my daughter tells us all. + + + +CLAUDIO +Now you talk of a sheet of paper, I remember a +pretty jest your daughter told us of. + + + +LEONATO +O, when she had writ it and was reading it over, she +found Benedick and Beatrice between the sheet? + + + +CLAUDIO +That. + + + +LEONATO +O, she tore the letter into a thousand halfpence; +railed at herself, that she should be so immodest +to write to one that she knew would flout her; 'I +measure him,' says she, 'by my own spirit; for I +should flout him, if he writ to me; yea, though I +love him, I should.' + + + +CLAUDIO +Then down upon her knees she falls, weeps, sobs, +beats her heart, tears her hair, prays, curses; 'O +sweet Benedick! God give me patience!' + + + +LEONATO +She doth indeed; my daughter says so: and the +ecstasy hath so much overborne her that my daughter +is sometime afeared she will do a desperate outrage +to herself: it is very true. + + + +DON PEDRO +It were good that Benedick knew of it by some +other, if she will not discover it. + + + +CLAUDIO +To what end? He would make but a sport of it and +torment the poor lady worse. + + + +DON PEDRO +An he should, it were an alms to hang him. She's an +excellent sweet lady; and, out of all suspicion, +she is virtuous. + + + +CLAUDIO +And she is exceeding wise. + + + +DON PEDRO +In every thing but in loving Benedick. + + + +LEONATO +O, my lord, wisdom and blood combating in so tender +a body, we have ten proofs to one that blood hath +the victory. I am sorry for her, as I have just +cause, being her uncle and her guardian. + + + +DON PEDRO +I would she had bestowed this dotage on me: I would +have daffed all other respects and made her half +myself. I pray you, tell Benedick of it, and hear +what a' will say. + + + +LEONATO +Were it good, think you? + + + +CLAUDIO +Hero thinks surely she will die; for she says she +will die, if he love her not, and she will die, ere +she make her love known, and she will die, if he woo +her, rather than she will bate one breath of her +accustomed crossness. + + + +DON PEDRO +She doth well: if she should make tender of her +love, 'tis very possible he'll scorn it; for the +man, as you know all, hath a contemptible spirit. + + + +CLAUDIO +He is a very proper man. + + + +DON PEDRO +He hath indeed a good outward happiness. + + + +CLAUDIO +Before God! and, in my mind, very wise. + + + +DON PEDRO +He doth indeed show some sparks that are like wit. + + + +CLAUDIO +And I take him to be valiant. + + + +DON PEDRO +As Hector, I assure you: and in the managing of +quarrels you may say he is wise; for either he +avoids them with great discretion, or undertakes +them with a most Christian-like fear. + + + +LEONATO +If he do fear God, a' must necessarily keep peace: +if he break the peace, he ought to enter into a +quarrel with fear and trembling. + + + +DON PEDRO +And so will he do; for the man doth fear God, +howsoever it seems not in him by some large jests +he will make. Well I am sorry for your niece. Shall +we go seek Benedick, and tell him of her love? + + + +CLAUDIO +Never tell him, my lord: let her wear it out with +good counsel. + + + +LEONATO +Nay, that's impossible: she may wear her heart out first. + + + +DON PEDRO +Well, we will hear further of it by your daughter: +let it cool the while. I love Benedick well; and I +could wish he would modestly examine himself, to see +how much he is unworthy so good a lady. + + + +LEONATO +My lord, will you walk? dinner is ready. + + + +CLAUDIO +If he do not dote on her upon this, I will never +trust my expectation. + + + +DON PEDRO +Let there be the same net spread for her; and that +must your daughter and her gentlewomen carry. The +sport will be, when they hold one an opinion of +another's dotage, and no such matter: that's the +scene that I would see, which will be merely a +dumb-show. Let us send her to call him in to dinner. + + + +Exeunt DON PEDRO, CLAUDIO, and LEONATO + + +BENEDICK +Coming forward This can be no trick: the +conference was sadly borne. They have the truth of +this from Hero. They seem to pity the lady: it +seems her affections have their full bent. Love me! +why, it must be requited. I hear how I am censured: +they say I will bear myself proudly, if I perceive +the love come from her; they say too that she will +rather die than give any sign of affection. I did +never think to marry: I must not seem proud: happy +are they that hear their detractions and can put +them to mending. They say the lady is fair; 'tis a +truth, I can bear them witness; and virtuous; 'tis +so, I cannot reprove it; and wise, but for loving +me; by my troth, it is no addition to her wit, nor +no great argument of her folly, for I will be +horribly in love with her. I may chance have some +odd quirks and remnants of wit broken on me, +because I have railed so long against marriage: but +doth not the appetite alter? a man loves the meat +in his youth that he cannot endure in his age. +Shall quips and sentences and these paper bullets of +the brain awe a man from the career of his humour? +No, the world must be peopled. When I said I would +die a bachelor, I did not think I should live till I +were married. Here comes Beatrice. By this day! +she's a fair lady: I do spy some marks of love in +her. + + + +Enter BEATRICE + + +BEATRICE +Against my will I am sent to bid you come in to dinner. + + + +BENEDICK +Fair Beatrice, I thank you for your pains. + + + +BEATRICE +I took no more pains for those thanks than you take +pains to thank me: if it had been painful, I would +not have come. + + + +BENEDICK +You take pleasure then in the message? + + + +BEATRICE +Yea, just so much as you may take upon a knife's +point and choke a daw withal. You have no stomach, +signior: fare you well. + + + +Exit + + +BENEDICK +Ha! 'Against my will I am sent to bid you come in +to dinner;' there's a double meaning in that 'I took +no more pains for those thanks than you took pains +to thank me.' that's as much as to say, Any pains +that I take for you is as easy as thanks. If I do +not take pity of her, I am a villain; if I do not +love her, I am a Jew. I will go get her picture. + + + +Exit + + + + +ACT III + +SCENE I. LEONATO'S garden. +Enter HERO, MARGARET, and URSULA + + +HERO +Good Margaret, run thee to the parlor; +There shalt thou find my cousin Beatrice +Proposing with the prince and Claudio: +Whisper her ear and tell her, I and Ursula +Walk in the orchard and our whole discourse +Is all of her; say that thou overheard'st us; +And bid her steal into the pleached bower, +Where honeysuckles, ripen'd by the sun, +Forbid the sun to enter, like favourites, +Made proud by princes, that advance their pride +Against that power that bred it: there will she hide her, +To listen our purpose. This is thy office; +Bear thee well in it and leave us alone. + + + +MARGARET +I'll make her come, I warrant you, presently. + + + +Exit + + +HERO +Now, Ursula, when Beatrice doth come, +As we do trace this alley up and down, +Our talk must only be of Benedick. +When I do name him, let it be thy part +To praise him more than ever man did merit: +My talk to thee must be how Benedick +Is sick in love with Beatrice. Of this matter +Is little Cupid's crafty arrow made, +That only wounds by hearsay. +Enter BEATRICE, behind +Now begin; +For look where Beatrice, like a lapwing, runs +Close by the ground, to hear our conference. + + + +URSULA +The pleasant'st angling is to see the fish +Cut with her golden oars the silver stream, +And greedily devour the treacherous bait: +So angle we for Beatrice; who even now +Is couched in the woodbine coverture. +Fear you not my part of the dialogue. + + + +HERO +Then go we near her, that her ear lose nothing +Of the false sweet bait that we lay for it. +Approaching the bower +No, truly, Ursula, she is too disdainful; +I know her spirits are as coy and wild +As haggerds of the rock. + + + +URSULA +But are you sure +That Benedick loves Beatrice so entirely? + + + +HERO +So says the prince and my new-trothed lord. + + + +URSULA +And did they bid you tell her of it, madam? + + + +HERO +They did entreat me to acquaint her of it; +But I persuaded them, if they loved Benedick, +To wish him wrestle with affection, +And never to let Beatrice know of it. + + + +URSULA +Why did you so? Doth not the gentleman +Deserve as full as fortunate a bed +As ever Beatrice shall couch upon? + + + +HERO +O god of love! I know he doth deserve +As much as may be yielded to a man: +But Nature never framed a woman's heart +Of prouder stuff than that of Beatrice; +Disdain and scorn ride sparkling in her eyes, +Misprising what they look on, and her wit +Values itself so highly that to her +All matter else seems weak: she cannot love, +Nor take no shape nor project of affection, +She is so self-endeared. + + + +URSULA +Sure, I think so; +And therefore certainly it were not good +She knew his love, lest she make sport at it. + + + +HERO +Why, you speak truth. I never yet saw man, +How wise, how noble, young, how rarely featured, +But she would spell him backward: if fair-faced, +She would swear the gentleman should be her sister; +If black, why, Nature, drawing of an antique, +Made a foul blot; if tall, a lance ill-headed; +If low, an agate very vilely cut; +If speaking, why, a vane blown with all winds; +If silent, why, a block moved with none. +So turns she every man the wrong side out +And never gives to truth and virtue that +Which simpleness and merit purchaseth. + + + +URSULA +Sure, sure, such carping is not commendable. + + + +HERO +No, not to be so odd and from all fashions +As Beatrice is, cannot be commendable: +But who dare tell her so? If I should speak, +She would mock me into air; O, she would laugh me +Out of myself, press me to death with wit. +Therefore let Benedick, like cover'd fire, +Consume away in sighs, waste inwardly: +It were a better death than die with mocks, +Which is as bad as die with tickling. + + + +URSULA +Yet tell her of it: hear what she will say. + + + +HERO +No; rather I will go to Benedick +And counsel him to fight against his passion. +And, truly, I'll devise some honest slanders +To stain my cousin with: one doth not know +How much an ill word may empoison liking. + + + +URSULA +O, do not do your cousin such a wrong. +She cannot be so much without true judgment-- +Having so swift and excellent a wit +As she is prized to have--as to refuse +So rare a gentleman as Signior Benedick. + + + +HERO +He is the only man of Italy. +Always excepted my dear Claudio. + + + +URSULA +I pray you, be not angry with me, madam, +Speaking my fancy: Signior Benedick, +For shape, for bearing, argument and valour, +Goes foremost in report through Italy. + + + +HERO +Indeed, he hath an excellent good name. + + + +URSULA +His excellence did earn it, ere he had it. +When are you married, madam? + + + +HERO +Why, every day, to-morrow. Come, go in: +I'll show thee some attires, and have thy counsel +Which is the best to furnish me to-morrow. + + + +URSULA +She's limed, I warrant you: we have caught her, madam. + + + +HERO +If it proves so, then loving goes by haps: +Some Cupid kills with arrows, some with traps. + + + +Exeunt HERO and URSULA + + +BEATRICE +Coming forward +What fire is in mine ears? Can this be true? +Stand I condemn'd for pride and scorn so much? +Contempt, farewell! and maiden pride, adieu! +No glory lives behind the back of such. +And, Benedick, love on; I will requite thee, +Taming my wild heart to thy loving hand: +If thou dost love, my kindness shall incite thee +To bind our loves up in a holy band; +For others say thou dost deserve, and I +Believe it better than reportingly. + + + +Exit + + +SCENE II. A room in LEONATO'S house +Enter DON PEDRO, CLAUDIO, BENEDICK, and LEONATO + + +DON PEDRO +I do but stay till your marriage be consummate, and +then go I toward Arragon. + + + +CLAUDIO +I'll bring you thither, my lord, if you'll +vouchsafe me. + + + +DON PEDRO +Nay, that would be as great a soil in the new gloss +of your marriage as to show a child his new coat +and forbid him to wear it. I will only be bold +with Benedick for his company; for, from the crown +of his head to the sole of his foot, he is all +mirth: he hath twice or thrice cut Cupid's +bow-string and the little hangman dare not shoot at +him; he hath a heart as sound as a bell and his +tongue is the clapper, for what his heart thinks his +tongue speaks. + + + +BENEDICK +Gallants, I am not as I have been. + + + +LEONATO +So say I methinks you are sadder. + + + +CLAUDIO +I hope he be in love. + + + +DON PEDRO +Hang him, truant! there's no true drop of blood in +him, to be truly touched with love: if he be sad, +he wants money. + + + +BENEDICK +I have the toothache. + + + +DON PEDRO +Draw it. + + + +BENEDICK +Hang it! + + + +CLAUDIO +You must hang it first, and draw it afterwards. + + + +DON PEDRO +What! sigh for the toothache? + + + +LEONATO +Where is but a humour or a worm. + + + +BENEDICK +Well, every one can master a grief but he that has +it. + + + +CLAUDIO +Yet say I, he is in love. + + + +DON PEDRO +There is no appearance of fancy in him, unless it be +a fancy that he hath to strange disguises; as, to be +a Dutchman today, a Frenchman to-morrow, or in the +shape of two countries at once, as, a German from +the waist downward, all slops, and a Spaniard from +the hip upward, no doublet. Unless he have a fancy +to this foolery, as it appears he hath, he is no +fool for fancy, as you would have it appear he is. + + + +CLAUDIO +If he be not in love with some woman, there is no +believing old signs: a' brushes his hat o' +mornings; what should that bode? + + + +DON PEDRO +Hath any man seen him at the barber's? + + + +CLAUDIO +No, but the barber's man hath been seen with him, +and the old ornament of his cheek hath already +stuffed tennis-balls. + + + +LEONATO +Indeed, he looks younger than he did, by the loss of a beard. + + + +DON PEDRO +Nay, a' rubs himself with civet: can you smell him +out by that? + + + +CLAUDIO +That's as much as to say, the sweet youth's in love. + + + +DON PEDRO +The greatest note of it is his melancholy. + + + +CLAUDIO +And when was he wont to wash his face? + + + +DON PEDRO +Yea, or to paint himself? for the which, I hear +what they say of him. + + + +CLAUDIO +Nay, but his jesting spirit; which is now crept into +a lute-string and now governed by stops. + + + +DON PEDRO +Indeed, that tells a heavy tale for him: conclude, +conclude he is in love. + + + +CLAUDIO +Nay, but I know who loves him. + + + +DON PEDRO +That would I know too: I warrant, one that knows him not. + + + +CLAUDIO +Yes, and his ill conditions; and, in despite of +all, dies for him. + + + +DON PEDRO +She shall be buried with her face upwards. + + + +BENEDICK +Yet is this no charm for the toothache. Old +signior, walk aside with me: I have studied eight +or nine wise words to speak to you, which these +hobby-horses must not hear. + + + +Exeunt BENEDICK and LEONATO + + +DON PEDRO +For my life, to break with him about Beatrice. + + + +CLAUDIO +'Tis even so. Hero and Margaret have by this +played their parts with Beatrice; and then the two +bears will not bite one another when they meet. + + + +Enter DON JOHN + + +DON JOHN +My lord and brother, God save you! + + + +DON PEDRO +Good den, brother. + + + +DON JOHN +If your leisure served, I would speak with you. + + + +DON PEDRO +In private? + + + +DON JOHN +If it please you: yet Count Claudio may hear; for +what I would speak of concerns him. + + + +DON PEDRO +What's the matter? + + + +DON JOHN +To CLAUDIO Means your lordship to be married +to-morrow? + + + +DON PEDRO +You know he does. + + + +DON JOHN +I know not that, when he knows what I know. + + + +CLAUDIO +If there be any impediment, I pray you discover it. + + + +DON JOHN +You may think I love you not: let that appear +hereafter, and aim better at me by that I now will +manifest. For my brother, I think he holds you +well, and in dearness of heart hath holp to effect +your ensuing marriage;--surely suit ill spent and +labour ill bestowed. + + + +DON PEDRO +Why, what's the matter? + + + +DON JOHN +I came hither to tell you; and, circumstances +shortened, for she has been too long a talking of, +the lady is disloyal. + + + +CLAUDIO +Who, Hero? + + + +DON PEDRO +Even she; Leonato's Hero, your Hero, every man's Hero: + + + +CLAUDIO +Disloyal? + + + +DON JOHN +The word is too good to paint out her wickedness; I +could say she were worse: think you of a worse +title, and I will fit her to it. Wonder not till +further warrant: go but with me to-night, you shall +see her chamber-window entered, even the night +before her wedding-day: if you love her then, +to-morrow wed her; but it would better fit your honour +to change your mind. + + + +CLAUDIO +May this be so? + + + +DON PEDRO +I will not think it. + + + +DON JOHN +If you dare not trust that you see, confess not +that you know: if you will follow me, I will show +you enough; and when you have seen more and heard +more, proceed accordingly. + + + +CLAUDIO +If I see any thing to-night why I should not marry +her to-morrow in the congregation, where I should +wed, there will I shame her. + + + +DON PEDRO +And, as I wooed for thee to obtain her, I will join +with thee to disgrace her. + + + +DON JOHN +I will disparage her no farther till you are my +witnesses: bear it coldly but till midnight, and +let the issue show itself. + + + +DON PEDRO +O day untowardly turned! + + + +CLAUDIO +O mischief strangely thwarting! + + + +DON JOHN +O plague right well prevented! so will you say when +you have seen the sequel. + + + +Exeunt + + +SCENE III. A street. +Enter DOGBERRY and VERGES with the Watch + + +DOGBERRY +Are you good men and true? + + + +VERGES +Yea, or else it were pity but they should suffer +salvation, body and soul. + + + +DOGBERRY +Nay, that were a punishment too good for them, if +they should have any allegiance in them, being +chosen for the prince's watch. + + + +VERGES +Well, give them their charge, neighbour Dogberry. + + + +DOGBERRY +First, who think you the most desertless man to be +constable? + + + +First Watchman +Hugh Otecake, sir, or George Seacole; for they can +write and read. + + + +DOGBERRY +Come hither, neighbour Seacole. God hath blessed +you with a good name: to be a well-favoured man is +the gift of fortune; but to write and read comes by nature. + + + +Second Watchman +Both which, master constable,-- + + + +DOGBERRY +You have: I knew it would be your answer. Well, +for your favour, sir, why, give God thanks, and make +no boast of it; and for your writing and reading, +let that appear when there is no need of such +vanity. You are thought here to be the most +senseless and fit man for the constable of the +watch; therefore bear you the lantern. This is your +charge: you shall comprehend all vagrom men; you are +to bid any man stand, in the prince's name. + + + +Second Watchman +How if a' will not stand? + + + +DOGBERRY +Why, then, take no note of him, but let him go; and +presently call the rest of the watch together and +thank God you are rid of a knave. + + + +VERGES +If he will not stand when he is bidden, he is none +of the prince's subjects. + + + +DOGBERRY +True, and they are to meddle with none but the +prince's subjects. You shall also make no noise in +the streets; for, for the watch to babble and to +talk is most tolerable and not to be endured. + + + +Watchman +We will rather sleep than talk: we know what +belongs to a watch. + + + +DOGBERRY +Why, you speak like an ancient and most quiet +watchman; for I cannot see how sleeping should +offend: only, have a care that your bills be not +stolen. Well, you are to call at all the +ale-houses, and bid those that are drunk get them to bed. + + + +Watchman +How if they will not? + + + +DOGBERRY +Why, then, let them alone till they are sober: if +they make you not then the better answer, you may +say they are not the men you took them for. + + + +Watchman +Well, sir. + + + +DOGBERRY +If you meet a thief, you may suspect him, by virtue +of your office, to be no true man; and, for such +kind of men, the less you meddle or make with them, +why the more is for your honesty. + + + +Watchman +If we know him to be a thief, shall we not lay +hands on him? + + + +DOGBERRY +Truly, by your office, you may; but I think they +that touch pitch will be defiled: the most peaceable +way for you, if you do take a thief, is to let him +show himself what he is and steal out of your company. + + + +VERGES +You have been always called a merciful man, partner. + + + +DOGBERRY +Truly, I would not hang a dog by my will, much more +a man who hath any honesty in him. + + + +VERGES +If you hear a child cry in the night, you must call +to the nurse and bid her still it. + + + +Watchman +How if the nurse be asleep and will not hear us? + + + +DOGBERRY +Why, then, depart in peace, and let the child wake +her with crying; for the ewe that will not hear her +lamb when it baes will never answer a calf when he bleats. + + + +VERGES +'Tis very true. + + + +DOGBERRY +This is the end of the charge:--you, constable, are +to present the prince's own person: if you meet the +prince in the night, you may stay him. + + + +VERGES +Nay, by'r our lady, that I think a' cannot. + + + +DOGBERRY +Five shillings to one on't, with any man that knows +the statutes, he may stay him: marry, not without +the prince be willing; for, indeed, the watch ought +to offend no man; and it is an offence to stay a +man against his will. + + + +VERGES +By'r lady, I think it be so. + + + +DOGBERRY +Ha, ha, ha! Well, masters, good night: an there be +any matter of weight chances, call up me: keep your +fellows' counsels and your own; and good night. +Come, neighbour. + + + +Watchman +Well, masters, we hear our charge: let us go sit here +upon the church-bench till two, and then all to bed. + + + +DOGBERRY +One word more, honest neighbours. I pray you watch +about Signior Leonato's door; for the wedding being +there to-morrow, there is a great coil to-night. +Adieu: be vigitant, I beseech you. + + +Exeunt DOGBERRY and VERGES +Enter BORACHIO and CONRADE + + +BORACHIO +What Conrade! + + + +Watchman +Aside Peace! stir not. + + + +BORACHIO +Conrade, I say! + + + +CONRADE +Here, man; I am at thy elbow. + + + +BORACHIO +Mass, and my elbow itched; I thought there would a +scab follow. + + + +CONRADE +I will owe thee an answer for that: and now forward +with thy tale. + + + +BORACHIO +Stand thee close, then, under this pent-house, for +it drizzles rain; and I will, like a true drunkard, +utter all to thee. + + + +Watchman +Aside Some treason, masters: yet stand close. + + + +BORACHIO +Therefore know I have earned of Don John a thousand ducats. + + + +CONRADE +Is it possible that any villany should be so dear? + + + +BORACHIO +Thou shouldst rather ask if it were possible any +villany should be so rich; for when rich villains +have need of poor ones, poor ones may make what +price they will. + + + +CONRADE +I wonder at it. + + + +BORACHIO +That shows thou art unconfirmed. Thou knowest that +the fashion of a doublet, or a hat, or a cloak, is +nothing to a man. + + + +CONRADE +Yes, it is apparel. + + + +BORACHIO +I mean, the fashion. + + + +CONRADE +Yes, the fashion is the fashion. + + + +BORACHIO +Tush! I may as well say the fool's the fool. But +seest thou not what a deformed thief this fashion +is? + + + +Watchman +Aside I know that Deformed; a' has been a vile +thief this seven year; a' goes up and down like a +gentleman: I remember his name. + + + +BORACHIO +Didst thou not hear somebody? + + + +CONRADE +No; 'twas the vane on the house. + + + +BORACHIO +Seest thou not, I say, what a deformed thief this +fashion is? how giddily a' turns about all the hot +bloods between fourteen and five-and-thirty? +sometimes fashioning them like Pharaoh's soldiers +in the reeky painting, sometime like god Bel's +priests in the old church-window, sometime like the +shaven Hercules in the smirched worm-eaten tapestry, +where his codpiece seems as massy as his club? + + + +CONRADE +All this I see; and I see that the fashion wears +out more apparel than the man. But art not thou +thyself giddy with the fashion too, that thou hast +shifted out of thy tale into telling me of the fashion? + + + +BORACHIO +Not so, neither: but know that I have to-night +wooed Margaret, the Lady Hero's gentlewoman, by the +name of Hero: she leans me out at her mistress' +chamber-window, bids me a thousand times good +night,--I tell this tale vilely:--I should first +tell thee how the prince, Claudio and my master, +planted and placed and possessed by my master Don +John, saw afar off in the orchard this amiable encounter. + + + +CONRADE +And thought they Margaret was Hero? + + + +BORACHIO +Two of them did, the prince and Claudio; but the +devil my master knew she was Margaret; and partly +by his oaths, which first possessed them, partly by +the dark night, which did deceive them, but chiefly +by my villany, which did confirm any slander that +Don John had made, away went Claudio enraged; swore +he would meet her, as he was appointed, next morning +at the temple, and there, before the whole +congregation, shame her with what he saw o'er night +and send her home again without a husband. + + + +First Watchman +We charge you, in the prince's name, stand! + + + +Second Watchman +Call up the right master constable. We have here +recovered the most dangerous piece of lechery that +ever was known in the commonwealth. + + + +First Watchman +And one Deformed is one of them: I know him; a' +wears a lock. + + + +CONRADE +Masters, masters,-- + + + +Second Watchman +You'll be made bring Deformed forth, I warrant you. + + + +CONRADE +Masters,-- + + + +First Watchman +Never speak: we charge you let us obey you to go with us. + + + +BORACHIO +We are like to prove a goodly commodity, being taken +up of these men's bills. + + + +CONRADE +A commodity in question, I warrant you. Come, we'll obey you. + + + +Exeunt + + +SCENE IV. HERO's apartment. +Enter HERO, MARGARET, and URSULA + + +HERO +Good Ursula, wake my cousin Beatrice, and desire +her to rise. + + + +URSULA +I will, lady. + + + +HERO +And bid her come hither. + + + +URSULA +Well. + + + +Exit + + +MARGARET +Troth, I think your other rabato were better. + + + +HERO +No, pray thee, good Meg, I'll wear this. + + + +MARGARET +By my troth, 's not so good; and I warrant your +cousin will say so. + + + +HERO +My cousin's a fool, and thou art another: I'll wear +none but this. + + + +MARGARET +I like the new tire within excellently, if the hair +were a thought browner; and your gown's a most rare +fashion, i' faith. I saw the Duchess of Milan's +gown that they praise so. + + + +HERO +O, that exceeds, they say. + + + +MARGARET +By my troth, 's but a night-gown in respect of +yours: cloth o' gold, and cuts, and laced with +silver, set with pearls, down sleeves, side sleeves, +and skirts, round underborne with a bluish tinsel: +but for a fine, quaint, graceful and excellent +fashion, yours is worth ten on 't. + + + +HERO +God give me joy to wear it! for my heart is +exceeding heavy. + + + +MARGARET +'Twill be heavier soon by the weight of a man. + + + +HERO +Fie upon thee! art not ashamed? + + + +MARGARET +Of what, lady? of speaking honourably? Is not +marriage honourable in a beggar? Is not your lord +honourable without marriage? I think you would have +me say, 'saving your reverence, a husband:' and bad +thinking do not wrest true speaking, I'll offend +nobody: is there any harm in 'the heavier for a +husband'? None, I think, and it be the right husband +and the right wife; otherwise 'tis light, and not +heavy: ask my Lady Beatrice else; here she comes. + + + +Enter BEATRICE + + +HERO +Good morrow, coz. + + + +BEATRICE +Good morrow, sweet Hero. + + + +HERO +Why how now? do you speak in the sick tune? + + + +BEATRICE +I am out of all other tune, methinks. + + + +MARGARET +Clap's into 'Light o' love;' that goes without a +burden: do you sing it, and I'll dance it. + + + +BEATRICE +Ye light o' love, with your heels! then, if your +husband have stables enough, you'll see he shall +lack no barns. + + + +MARGARET +O illegitimate construction! I scorn that with my heels. + + + +BEATRICE +'Tis almost five o'clock, cousin; tis time you were +ready. By my troth, I am exceeding ill: heigh-ho! + + + +MARGARET +For a hawk, a horse, or a husband? + + + +BEATRICE +For the letter that begins them all, H. + + + +MARGARET +Well, and you be not turned Turk, there's no more +sailing by the star. + + + +BEATRICE +What means the fool, trow? + + + +MARGARET +Nothing I; but God send every one their heart's desire! + + + +HERO +These gloves the count sent me; they are an +excellent perfume. + + + +BEATRICE +I am stuffed, cousin; I cannot smell. + + + +MARGARET +A maid, and stuffed! there's goodly catching of cold. + + + +BEATRICE +O, God help me! God help me! how long have you +professed apprehension? + + + +MARGARET +Even since you left it. Doth not my wit become me rarely? + + + +BEATRICE +It is not seen enough, you should wear it in your +cap. By my troth, I am sick. + + + +MARGARET +Get you some of this distilled Carduus Benedictus, +and lay it to your heart: it is the only thing for a qualm. + + + +HERO +There thou prickest her with a thistle. + + + +BEATRICE +Benedictus! why Benedictus? you have some moral in +this Benedictus. + + + +MARGARET +Moral! no, by my troth, I have no moral meaning; I +meant, plain holy-thistle. You may think perchance +that I think you are in love: nay, by'r lady, I am +not such a fool to think what I list, nor I list +not to think what I can, nor indeed I cannot think, +if I would think my heart out of thinking, that you +are in love or that you will be in love or that you +can be in love. Yet Benedick was such another, and +now is he become a man: he swore he would never +marry, and yet now, in despite of his heart, he eats +his meat without grudging: and how you may be +converted I know not, but methinks you look with +your eyes as other women do. + + + +BEATRICE +What pace is this that thy tongue keeps? + + + +MARGARET +Not a false gallop. + + + +Re-enter URSULA + + +URSULA +Madam, withdraw: the prince, the count, Signior +Benedick, Don John, and all the gallants of the +town, are come to fetch you to church. + + + +HERO +Help to dress me, good coz, good Meg, good Ursula. + + + +Exeunt + + +SCENE V. Another room in LEONATO'S house. +Enter LEONATO, with DOGBERRY and VERGES + + +LEONATO +What would you with me, honest neighbour? + + + +DOGBERRY +Marry, sir, I would have some confidence with you +that decerns you nearly. + + + +LEONATO +Brief, I pray you; for you see it is a busy time with me. + + + +DOGBERRY +Marry, this it is, sir. + + + +VERGES +Yes, in truth it is, sir. + + + +LEONATO +What is it, my good friends? + + + +DOGBERRY +Goodman Verges, sir, speaks a little off the +matter: an old man, sir, and his wits are not so +blunt as, God help, I would desire they were; but, +in faith, honest as the skin between his brows. + + + +VERGES +Yes, I thank God I am as honest as any man living +that is an old man and no honester than I. + + + +DOGBERRY +Comparisons are odorous: palabras, neighbour Verges. + + + +LEONATO +Neighbours, you are tedious. + + + +DOGBERRY +It pleases your worship to say so, but we are the +poor duke's officers; but truly, for mine own part, +if I were as tedious as a king, I could find it in +my heart to bestow it all of your worship. + + + +LEONATO +All thy tediousness on me, ah? + + + +DOGBERRY +Yea, an 'twere a thousand pound more than 'tis; for +I hear as good exclamation on your worship as of any +man in the city; and though I be but a poor man, I +am glad to hear it. + + + +VERGES +And so am I. + + + +LEONATO +I would fain know what you have to say. + + + +VERGES +Marry, sir, our watch to-night, excepting your +worship's presence, ha' ta'en a couple of as arrant +knaves as any in Messina. + + + +DOGBERRY +A good old man, sir; he will be talking: as they +say, when the age is in, the wit is out: God help +us! it is a world to see. Well said, i' faith, +neighbour Verges: well, God's a good man; an two men +ride of a horse, one must ride behind. An honest +soul, i' faith, sir; by my troth he is, as ever +broke bread; but God is to be worshipped; all men +are not alike; alas, good neighbour! + + + +LEONATO +Indeed, neighbour, he comes too short of you. + + + +DOGBERRY +Gifts that God gives. + + + +LEONATO +I must leave you. + + + +DOGBERRY +One word, sir: our watch, sir, have indeed +comprehended two aspicious persons, and we would +have them this morning examined before your worship. + + + +LEONATO +Take their examination yourself and bring it me: I +am now in great haste, as it may appear unto you. + + + +DOGBERRY +It shall be suffigance. + + + +LEONATO +Drink some wine ere you go: fare you well. + + + +Enter a Messenger + + +Messenger +My lord, they stay for you to give your daughter to +her husband. + + + +LEONATO +I'll wait upon them: I am ready. + + + +Exeunt LEONATO and Messenger + + +DOGBERRY +Go, good partner, go, get you to Francis Seacole; +bid him bring his pen and inkhorn to the gaol: we +are now to examination these men. + + + +VERGES +And we must do it wisely. + + + +DOGBERRY +We will spare for no wit, I warrant you; here's +that shall drive some of them to a non-come: only +get the learned writer to set down our +excommunication and meet me at the gaol. + + + +Exeunt + + + + +ACT IV + +SCENE I. A church. +Enter DON PEDRO, DON JOHN, LEONATO, FRIAR FRANCIS, +CLAUDIO, BENEDICK, HERO, BEATRICE, and Attendants + + +LEONATO +Come, Friar Francis, be brief; only to the plain +form of marriage, and you shall recount their +particular duties afterwards. + + + +FRIAR FRANCIS +You come hither, my lord, to marry this lady. + + + +CLAUDIO +No. + + + +LEONATO +To be married to her: friar, you come to marry her. + + + +FRIAR FRANCIS +Lady, you come hither to be married to this count. + + + +HERO +I do. + + + +FRIAR FRANCIS +If either of you know any inward impediment why you +should not be conjoined, charge you, on your souls, +to utter it. + + + +CLAUDIO +Know you any, Hero? + + + +HERO +None, my lord. + + + +FRIAR FRANCIS +Know you any, count? + + + +LEONATO +I dare make his answer, none. + + + +CLAUDIO +O, what men dare do! what men may do! what men daily +do, not knowing what they do! + + + +BENEDICK +How now! interjections? Why, then, some be of +laughing, as, ah, ha, he! + + + +CLAUDIO +Stand thee by, friar. Father, by your leave: +Will you with free and unconstrained soul +Give me this maid, your daughter? + + + +LEONATO +As freely, son, as God did give her me. + + + +CLAUDIO +And what have I to give you back, whose worth +May counterpoise this rich and precious gift? + + + +DON PEDRO +Nothing, unless you render her again. + + + +CLAUDIO +Sweet prince, you learn me noble thankfulness. +There, Leonato, take her back again: +Give not this rotten orange to your friend; +She's but the sign and semblance of her honour. +Behold how like a maid she blushes here! +O, what authority and show of truth +Can cunning sin cover itself withal! +Comes not that blood as modest evidence +To witness simple virtue? Would you not swear, +All you that see her, that she were a maid, +By these exterior shows? But she is none: +She knows the heat of a luxurious bed; +Her blush is guiltiness, not modesty. + + + +LEONATO +What do you mean, my lord? + + + +CLAUDIO +Not to be married, +Not to knit my soul to an approved wanton. + + + +LEONATO +Dear my lord, if you, in your own proof, +Have vanquish'd the resistance of her youth, +And made defeat of her virginity,-- + + + +CLAUDIO +I know what you would say: if I have known her, +You will say she did embrace me as a husband, +And so extenuate the 'forehand sin: +No, Leonato, +I never tempted her with word too large; +But, as a brother to his sister, show'd +Bashful sincerity and comely love. + + + +HERO +And seem'd I ever otherwise to you? + + + +CLAUDIO +Out on thee! Seeming! I will write against it: +You seem to me as Dian in her orb, +As chaste as is the bud ere it be blown; +But you are more intemperate in your blood +Than Venus, or those pamper'd animals +That rage in savage sensuality. + + + +HERO +Is my lord well, that he doth speak so wide? + + + +LEONATO +Sweet prince, why speak not you? + + + +DON PEDRO +What should I speak? +I stand dishonour'd, that have gone about +To link my dear friend to a common stale. + + + +LEONATO +Are these things spoken, or do I but dream? + + + +DON JOHN +Sir, they are spoken, and these things are true. + + + +BENEDICK +This looks not like a nuptial. + + + +HERO +True! O God! + + + +CLAUDIO +Leonato, stand I here? +Is this the prince? is this the prince's brother? +Is this face Hero's? are our eyes our own? + + + +LEONATO +All this is so: but what of this, my lord? + + + +CLAUDIO +Let me but move one question to your daughter; +And, by that fatherly and kindly power +That you have in her, bid her answer truly. + + + +LEONATO +I charge thee do so, as thou art my child. + + + +HERO +O, God defend me! how am I beset! +What kind of catechising call you this? + + + +CLAUDIO +To make you answer truly to your name. + + + +HERO +Is it not Hero? Who can blot that name +With any just reproach? + + + +CLAUDIO +Marry, that can Hero; +Hero itself can blot out Hero's virtue. +What man was he talk'd with you yesternight +Out at your window betwixt twelve and one? +Now, if you are a maid, answer to this. + + + +HERO +I talk'd with no man at that hour, my lord. + + + +DON PEDRO +Why, then are you no maiden. Leonato, +I am sorry you must hear: upon mine honour, +Myself, my brother and this grieved count +Did see her, hear her, at that hour last night +Talk with a ruffian at her chamber-window +Who hath indeed, most like a liberal villain, +Confess'd the vile encounters they have had +A thousand times in secret. + + + +DON JOHN +Fie, fie! they are not to be named, my lord, +Not to be spoke of; +There is not chastity enough in language +Without offence to utter them. Thus, pretty lady, +I am sorry for thy much misgovernment. + + + +CLAUDIO +O Hero, what a Hero hadst thou been, +If half thy outward graces had been placed +About thy thoughts and counsels of thy heart! +But fare thee well, most foul, most fair! farewell, +Thou pure impiety and impious purity! +For thee I'll lock up all the gates of love, +And on my eyelids shall conjecture hang, +To turn all beauty into thoughts of harm, +And never shall it more be gracious. + + + +LEONATO +Hath no man's dagger here a point for me? + + + +HERO swoons + + +BEATRICE +Why, how now, cousin! wherefore sink you down? + + + +DON JOHN +Come, let us go. These things, come thus to light, +Smother her spirits up. + + + +Exeunt DON PEDRO, DON JOHN, and CLAUDIO + + +BENEDICK +How doth the lady? + + + +BEATRICE +Dead, I think. Help, uncle! +Hero! why, Hero! Uncle! Signior Benedick! Friar! + + + +LEONATO +O Fate! take not away thy heavy hand. +Death is the fairest cover for her shame +That may be wish'd for. + + + +BEATRICE +How now, cousin Hero! + + + +FRIAR FRANCIS +Have comfort, lady. + + + +LEONATO +Dost thou look up? + + + +FRIAR FRANCIS +Yea, wherefore should she not? + + + +LEONATO +Wherefore! Why, doth not every earthly thing +Cry shame upon her? Could she here deny +The story that is printed in her blood? +Do not live, Hero; do not ope thine eyes: +For, did I think thou wouldst not quickly die, +Thought I thy spirits were stronger than thy shames, +Myself would, on the rearward of reproaches, +Strike at thy life. Grieved I, I had but one? +Chid I for that at frugal nature's frame? +O, one too much by thee! Why had I one? +Why ever wast thou lovely in my eyes? +Why had I not with charitable hand +Took up a beggar's issue at my gates, +Who smirch'd thus and mired with infamy, +I might have said 'No part of it is mine; +This shame derives itself from unknown loins'? +But mine and mine I loved and mine I praised +And mine that I was proud on, mine so much +That I myself was to myself not mine, +Valuing of her,--why, she, O, she is fallen +Into a pit of ink, that the wide sea +Hath drops too few to wash her clean again +And salt too little which may season give +To her foul-tainted flesh! + + + +BENEDICK +Sir, sir, be patient. +For my part, I am so attired in wonder, +I know not what to say. + + + +BEATRICE +O, on my soul, my cousin is belied! + + + +BENEDICK +Lady, were you her bedfellow last night? + + + +BEATRICE +No, truly not; although, until last night, +I have this twelvemonth been her bedfellow. + + + +LEONATO +Confirm'd, confirm'd! O, that is stronger made +Which was before barr'd up with ribs of iron! +Would the two princes lie, and Claudio lie, +Who loved her so, that, speaking of her foulness, +Wash'd it with tears? Hence from her! let her die. + + + +FRIAR FRANCIS +Hear me a little; for I have only been +Silent so long and given way unto +This course of fortune +By noting of the lady. I have mark'd +A thousand blushing apparitions +To start into her face, a thousand innocent shames +In angel whiteness beat away those blushes; +And in her eye there hath appear'd a fire, +To burn the errors that these princes hold +Against her maiden truth. Call me a fool; +Trust not my reading nor my observations, +Which with experimental seal doth warrant +The tenor of my book; trust not my age, +My reverence, calling, nor divinity, +If this sweet lady lie not guiltless here +Under some biting error. + + + +LEONATO +Friar, it cannot be. +Thou seest that all the grace that she hath left +Is that she will not add to her damnation +A sin of perjury; she not denies it: +Why seek'st thou then to cover with excuse +That which appears in proper nakedness? + + + +FRIAR FRANCIS +Lady, what man is he you are accused of? + + + +HERO +They know that do accuse me; I know none: +If I know more of any man alive +Than that which maiden modesty doth warrant, +Let all my sins lack mercy! O my father, +Prove you that any man with me conversed +At hours unmeet, or that I yesternight +Maintain'd the change of words with any creature, +Refuse me, hate me, torture me to death! + + + +FRIAR FRANCIS +There is some strange misprision in the princes. + + + +BENEDICK +Two of them have the very bent of honour; +And if their wisdoms be misled in this, +The practise of it lives in John the bastard, +Whose spirits toil in frame of villanies. + + + +LEONATO +I know not. If they speak but truth of her, +These hands shall tear her; if they wrong her honour, +The proudest of them shall well hear of it. +Time hath not yet so dried this blood of mine, +Nor age so eat up my invention, +Nor fortune made such havoc of my means, +Nor my bad life reft me so much of friends, +But they shall find, awaked in such a kind, +Both strength of limb and policy of mind, +Ability in means and choice of friends, +To quit me of them throughly. + + + +FRIAR FRANCIS +Pause awhile, +And let my counsel sway you in this case. +Your daughter here the princes left for dead: +Let her awhile be secretly kept in, +And publish it that she is dead indeed; +Maintain a mourning ostentation +And on your family's old monument +Hang mournful epitaphs and do all rites +That appertain unto a burial. + + + +LEONATO +What shall become of this? what will this do? + + + +FRIAR FRANCIS +Marry, this well carried shall on her behalf +Change slander to remorse; that is some good: +But not for that dream I on this strange course, +But on this travail look for greater birth. +She dying, as it must so be maintain'd, +Upon the instant that she was accused, +Shall be lamented, pitied and excused +Of every hearer: for it so falls out +That what we have we prize not to the worth +Whiles we enjoy it, but being lack'd and lost, +Why, then we rack the value, then we find +The virtue that possession would not show us +Whiles it was ours. So will it fare with Claudio: +When he shall hear she died upon his words, +The idea of her life shall sweetly creep +Into his study of imagination, +And every lovely organ of her life +Shall come apparell'd in more precious habit, +More moving-delicate and full of life, +Into the eye and prospect of his soul, +Than when she lived indeed; then shall he mourn, +If ever love had interest in his liver, +And wish he had not so accused her, +No, though he thought his accusation true. +Let this be so, and doubt not but success +Will fashion the event in better shape +Than I can lay it down in likelihood. +But if all aim but this be levell'd false, +The supposition of the lady's death +Will quench the wonder of her infamy: +And if it sort not well, you may conceal her, +As best befits her wounded reputation, +In some reclusive and religious life, +Out of all eyes, tongues, minds and injuries. + + + +BENEDICK +Signior Leonato, let the friar advise you: +And though you know my inwardness and love +Is very much unto the prince and Claudio, +Yet, by mine honour, I will deal in this +As secretly and justly as your soul +Should with your body. + + + +LEONATO +Being that I flow in grief, +The smallest twine may lead me. + + + +FRIAR FRANCIS +'Tis well consented: presently away; +For to strange sores strangely they strain the cure. +Come, lady, die to live: this wedding-day +Perhaps is but prolong'd: have patience and endure. + + + +Exeunt all but BENEDICK and BEATRICE + + +BENEDICK +Lady Beatrice, have you wept all this while? + + + +BEATRICE +Yea, and I will weep a while longer. + + + +BENEDICK +I will not desire that. + + + +BEATRICE +You have no reason; I do it freely. + + + +BENEDICK +Surely I do believe your fair cousin is wronged. + + + +BEATRICE +Ah, how much might the man deserve of me that would right her! + + + +BENEDICK +Is there any way to show such friendship? + + + +BEATRICE +A very even way, but no such friend. + + + +BENEDICK +May a man do it? + + + +BEATRICE +It is a man's office, but not yours. + + + +BENEDICK +I do love nothing in the world so well as you: is +not that strange? + + + +BEATRICE +As strange as the thing I know not. It were as +possible for me to say I loved nothing so well as +you: but believe me not; and yet I lie not; I +confess nothing, nor I deny nothing. I am sorry for my cousin. + + + +BENEDICK +By my sword, Beatrice, thou lovest me. + + + +BEATRICE +Do not swear, and eat it. + + + +BENEDICK +I will swear by it that you love me; and I will make +him eat it that says I love not you. + + + +BEATRICE +Will you not eat your word? + + + +BENEDICK +With no sauce that can be devised to it. I protest +I love thee. + + + +BEATRICE +Why, then, God forgive me! + + + +BENEDICK +What offence, sweet Beatrice? + + + +BEATRICE +You have stayed me in a happy hour: I was about to +protest I loved you. + + + +BENEDICK +And do it with all thy heart. + + + +BEATRICE +I love you with so much of my heart that none is +left to protest. + + + +BENEDICK +Come, bid me do any thing for thee. + + + +BEATRICE +Kill Claudio. + + + +BENEDICK +Ha! not for the wide world. + + + +BEATRICE +You kill me to deny it. Farewell. + + + +BENEDICK +Tarry, sweet Beatrice. + + + +BEATRICE +I am gone, though I am here: there is no love in +you: nay, I pray you, let me go. + + + +BENEDICK +Beatrice,-- + + + +BEATRICE +In faith, I will go. + + + +BENEDICK +We'll be friends first. + + + +BEATRICE +You dare easier be friends with me than fight with mine enemy. + + + +BENEDICK +Is Claudio thine enemy? + + + +BEATRICE +Is he not approved in the height a villain, that +hath slandered, scorned, dishonoured my kinswoman? O +that I were a man! What, bear her in hand until they +come to take hands; and then, with public +accusation, uncovered slander, unmitigated rancour, +--O God, that I were a man! I would eat his heart +in the market-place. + + + +BENEDICK +Hear me, Beatrice,-- + + + +BEATRICE +Talk with a man out at a window! A proper saying! + + + +BENEDICK +Nay, but, Beatrice,-- + + + +BEATRICE +Sweet Hero! She is wronged, she is slandered, she is undone. + + + +BENEDICK +Beat-- + + + +BEATRICE +Princes and counties! Surely, a princely testimony, +a goodly count, Count Comfect; a sweet gallant, +surely! O that I were a man for his sake! or that I +had any friend would be a man for my sake! But +manhood is melted into courtesies, valour into +compliment, and men are only turned into tongue, and +trim ones too: he is now as valiant as Hercules +that only tells a lie and swears it. I cannot be a +man with wishing, therefore I will die a woman with grieving. + + + +BENEDICK +Tarry, good Beatrice. By this hand, I love thee. + + + +BEATRICE +Use it for my love some other way than swearing by it. + + + +BENEDICK +Think you in your soul the Count Claudio hath wronged Hero? + + + +BEATRICE +Yea, as sure as I have a thought or a soul. + + + +BENEDICK +Enough, I am engaged; I will challenge him. I will +kiss your hand, and so I leave you. By this hand, +Claudio shall render me a dear account. As you +hear of me, so think of me. Go, comfort your +cousin: I must say she is dead: and so, farewell. + + + +Exeunt + + +SCENE II. A prison. +Enter DOGBERRY, VERGES, and Sexton, in gowns; and +the Watch, with CONRADE and BORACHIO + + +DOGBERRY +Is our whole dissembly appeared? + + + +VERGES +O, a stool and a cushion for the sexton. + + + +Sexton +Which be the malefactors? + + + +DOGBERRY +Marry, that am I and my partner. + + + +VERGES +Nay, that's certain; we have the exhibition to examine. + + + +Sexton +But which are the offenders that are to be +examined? let them come before master constable. + + + +DOGBERRY +Yea, marry, let them come before me. What is your +name, friend? + + + +BORACHIO +Borachio. + + + +DOGBERRY +Pray, write down, Borachio. Yours, sirrah? + + + +CONRADE +I am a gentleman, sir, and my name is Conrade. + + + +DOGBERRY +Write down, master gentleman Conrade. Masters, do +you serve God? + + + +CONRADE +BORACHIO +Yea, sir, we hope. + + + +DOGBERRY +Write down, that they hope they serve God: and +write God first; for God defend but God should go +before such villains! Masters, it is proved already +that you are little better than false knaves; and it +will go near to be thought so shortly. How answer +you for yourselves? + + + +CONRADE +Marry, sir, we say we are none. + + + +DOGBERRY +A marvellous witty fellow, I assure you: but I +will go about with him. Come you hither, sirrah; a +word in your ear: sir, I say to you, it is thought +you are false knaves. + + + +BORACHIO +Sir, I say to you we are none. + + + +DOGBERRY +Well, stand aside. 'Fore God, they are both in a +tale. Have you writ down, that they are none? + + + +Sexton +Master constable, you go not the way to examine: +you must call forth the watch that are their accusers. + + + +DOGBERRY +Yea, marry, that's the eftest way. Let the watch +come forth. Masters, I charge you, in the prince's +name, accuse these men. + + + +First Watchman +This man said, sir, that Don John, the prince's +brother, was a villain. + + + +DOGBERRY +Write down Prince John a villain. Why, this is flat +perjury, to call a prince's brother villain. + + + +BORACHIO +Master constable,-- + + + +DOGBERRY +Pray thee, fellow, peace: I do not like thy look, +I promise thee. + + + +Sexton +What heard you him say else? + + + +Second Watchman +Marry, that he had received a thousand ducats of +Don John for accusing the Lady Hero wrongfully. + + + +DOGBERRY +Flat burglary as ever was committed. + + + +VERGES +Yea, by mass, that it is. + + + +Sexton +What else, fellow? + + + +First Watchman +And that Count Claudio did mean, upon his words, to +disgrace Hero before the whole assembly. and not marry her. + + + +DOGBERRY +O villain! thou wilt be condemned into everlasting +redemption for this. + + + +Sexton +What else? + + + +Watchman +This is all. + + + +Sexton +And this is more, masters, than you can deny. +Prince John is this morning secretly stolen away; +Hero was in this manner accused, in this very manner +refused, and upon the grief of this suddenly died. +Master constable, let these men be bound, and +brought to Leonato's: I will go before and show +him their examination. + + + +Exit + + +DOGBERRY +Come, let them be opinioned. + + + +VERGES +Let them be in the hands-- + + + +CONRADE +Off, coxcomb! + + + +DOGBERRY +God's my life, where's the sexton? let him write +down the prince's officer coxcomb. Come, bind them. +Thou naughty varlet! + + + +CONRADE +Away! you are an ass, you are an ass. + + + +DOGBERRY +Dost thou not suspect my place? dost thou not +suspect my years? O that he were here to write me +down an ass! But, masters, remember that I am an +ass; though it be not written down, yet forget not +that I am an ass. No, thou villain, thou art full of +piety, as shall be proved upon thee by good witness. +I am a wise fellow, and, which is more, an officer, +and, which is more, a householder, and, which is +more, as pretty a piece of flesh as any is in +Messina, and one that knows the law, go to; and a +rich fellow enough, go to; and a fellow that hath +had losses, and one that hath two gowns and every +thing handsome about him. Bring him away. O that +I had been writ down an ass! + + + +Exeunt + + + + +ACT V + +SCENE I. Before LEONATO'S house. +Enter LEONATO and ANTONIO + + +ANTONIO +If you go on thus, you will kill yourself: +And 'tis not wisdom thus to second grief +Against yourself. + + + +LEONATO +I pray thee, cease thy counsel, +Which falls into mine ears as profitless +As water in a sieve: give not me counsel; +Nor let no comforter delight mine ear +But such a one whose wrongs do suit with mine. +Bring me a father that so loved his child, +Whose joy of her is overwhelm'd like mine, +And bid him speak of patience; +Measure his woe the length and breadth of mine +And let it answer every strain for strain, +As thus for thus and such a grief for such, +In every lineament, branch, shape, and form: +If such a one will smile and stroke his beard, +Bid sorrow wag, cry 'hem!' when he should groan, +Patch grief with proverbs, make misfortune drunk +With candle-wasters; bring him yet to me, +And I of him will gather patience. +But there is no such man: for, brother, men +Can counsel and speak comfort to that grief +Which they themselves not feel; but, tasting it, +Their counsel turns to passion, which before +Would give preceptial medicine to rage, +Fetter strong madness in a silken thread, +Charm ache with air and agony with words: +No, no; 'tis all men's office to speak patience +To those that wring under the load of sorrow, +But no man's virtue nor sufficiency +To be so moral when he shall endure +The like himself. Therefore give me no counsel: +My griefs cry louder than advertisement. + + + +ANTONIO +Therein do men from children nothing differ. + + + +LEONATO +I pray thee, peace. I will be flesh and blood; +For there was never yet philosopher +That could endure the toothache patiently, +However they have writ the style of gods +And made a push at chance and sufferance. + + + +ANTONIO +Yet bend not all the harm upon yourself; +Make those that do offend you suffer too. + + + +LEONATO +There thou speak'st reason: nay, I will do so. +My soul doth tell me Hero is belied; +And that shall Claudio know; so shall the prince +And all of them that thus dishonour her. + + + +ANTONIO +Here comes the prince and Claudio hastily. + + + +Enter DON PEDRO and CLAUDIO + + +DON PEDRO +Good den, good den. + + + +CLAUDIO +Good day to both of you. + + + +LEONATO +Hear you. my lords,-- + + + +DON PEDRO +We have some haste, Leonato. + + + +LEONATO +Some haste, my lord! well, fare you well, my lord: +Are you so hasty now? well, all is one. + + + +DON PEDRO +Nay, do not quarrel with us, good old man. + + + +ANTONIO +If he could right himself with quarreling, +Some of us would lie low. + + + +CLAUDIO +Who wrongs him? + + + +LEONATO +Marry, thou dost wrong me; thou dissembler, thou:-- +Nay, never lay thy hand upon thy sword; +I fear thee not. + + + +CLAUDIO +Marry, beshrew my hand, +If it should give your age such cause of fear: +In faith, my hand meant nothing to my sword. + + + +LEONATO +Tush, tush, man; never fleer and jest at me: +I speak not like a dotard nor a fool, +As under privilege of age to brag +What I have done being young, or what would do +Were I not old. Know, Claudio, to thy head, +Thou hast so wrong'd mine innocent child and me +That I am forced to lay my reverence by +And, with grey hairs and bruise of many days, +Do challenge thee to trial of a man. +I say thou hast belied mine innocent child; +Thy slander hath gone through and through her heart, +And she lies buried with her ancestors; +O, in a tomb where never scandal slept, +Save this of hers, framed by thy villany! + + + +CLAUDIO +My villany? + + + +LEONATO +Thine, Claudio; thine, I say. + + + +DON PEDRO +You say not right, old man. + + + +LEONATO +My lord, my lord, +I'll prove it on his body, if he dare, +Despite his nice fence and his active practise, +His May of youth and bloom of lustihood. + + + +CLAUDIO +Away! I will not have to do with you. + + + +LEONATO +Canst thou so daff me? Thou hast kill'd my child: +If thou kill'st me, boy, thou shalt kill a man. + + + +ANTONIO +He shall kill two of us, and men indeed: +But that's no matter; let him kill one first; +Win me and wear me; let him answer me. +Come, follow me, boy; come, sir boy, come, follow me: +Sir boy, I'll whip you from your foining fence; +Nay, as I am a gentleman, I will. + + + +LEONATO +Brother,-- + + + +ANTONIO +Content yourself. God knows I loved my niece; +And she is dead, slander'd to death by villains, +That dare as well answer a man indeed +As I dare take a serpent by the tongue: +Boys, apes, braggarts, Jacks, milksops! + + + +LEONATO +Brother Antony,-- + + + +ANTONIO +Hold you content. What, man! I know them, yea, +And what they weigh, even to the utmost scruple,-- +Scrambling, out-facing, fashion-monging boys, +That lie and cog and flout, deprave and slander, +Go anticly, show outward hideousness, +And speak off half a dozen dangerous words, +How they might hurt their enemies, if they durst; +And this is all. + + + +LEONATO +But, brother Antony,-- + + + +ANTONIO +Come, 'tis no matter: +Do not you meddle; let me deal in this. + + + +DON PEDRO +Gentlemen both, we will not wake your patience. +My heart is sorry for your daughter's death: +But, on my honour, she was charged with nothing +But what was true and very full of proof. + + + +LEONATO +My lord, my lord,-- + + + +DON PEDRO +I will not hear you. + + + +LEONATO +No? Come, brother; away! I will be heard. + + + +ANTONIO +And shall, or some of us will smart for it. + + + +Exeunt LEONATO and ANTONIO + + +DON PEDRO +See, see; here comes the man we went to seek. + + + +Enter BENEDICK + + +CLAUDIO +Now, signior, what news? + + + +BENEDICK +Good day, my lord. + + + +DON PEDRO +Welcome, signior: you are almost come to part +almost a fray. + + + +CLAUDIO +We had like to have had our two noses snapped off +with two old men without teeth. + + + +DON PEDRO +Leonato and his brother. What thinkest thou? Had +we fought, I doubt we should have been too young for them. + + + +BENEDICK +In a false quarrel there is no true valour. I came +to seek you both. + + + +CLAUDIO +We have been up and down to seek thee; for we are +high-proof melancholy and would fain have it beaten +away. Wilt thou use thy wit? + + + +BENEDICK +It is in my scabbard: shall I draw it? + + + +DON PEDRO +Dost thou wear thy wit by thy side? + + + +CLAUDIO +Never any did so, though very many have been beside +their wit. I will bid thee draw, as we do the +minstrels; draw, to pleasure us. + + + +DON PEDRO +As I am an honest man, he looks pale. Art thou +sick, or angry? + + + +CLAUDIO +What, courage, man! What though care killed a cat, +thou hast mettle enough in thee to kill care. + + + +BENEDICK +Sir, I shall meet your wit in the career, and you +charge it against me. I pray you choose another subject. + + + +CLAUDIO +Nay, then, give him another staff: this last was +broke cross. + + + +DON PEDRO +By this light, he changes more and more: I think +he be angry indeed. + + + +CLAUDIO +If he be, he knows how to turn his girdle. + + + +BENEDICK +Shall I speak a word in your ear? + + + +CLAUDIO +God bless me from a challenge! + + + +BENEDICK +Aside to CLAUDIO You are a villain; I jest not: +I will make it good how you dare, with what you +dare, and when you dare. Do me right, or I will +protest your cowardice. You have killed a sweet +lady, and her death shall fall heavy on you. Let me +hear from you. + + + +CLAUDIO +Well, I will meet you, so I may have good cheer. + + + +DON PEDRO +What, a feast, a feast? + + + +CLAUDIO +I' faith, I thank him; he hath bid me to a calf's +head and a capon; the which if I do not carve most +curiously, say my knife's naught. Shall I not find +a woodcock too? + + + +BENEDICK +Sir, your wit ambles well; it goes easily. + + + +DON PEDRO +I'll tell thee how Beatrice praised thy wit the +other day. I said, thou hadst a fine wit: 'True,' +said she, 'a fine little one.' 'No,' said I, 'a +great wit:' 'Right,' says she, 'a great gross one.' +'Nay,' said I, 'a good wit:' 'Just,' said she, 'it +hurts nobody.' 'Nay,' said I, 'the gentleman +is wise:' 'Certain,' said she, 'a wise gentleman.' +'Nay,' said I, 'he hath the tongues:' 'That I +believe,' said she, 'for he swore a thing to me on +Monday night, which he forswore on Tuesday morning; +there's a double tongue; there's two tongues.' Thus +did she, an hour together, transshape thy particular +virtues: yet at last she concluded with a sigh, thou +wast the properest man in Italy. + + + +CLAUDIO +For the which she wept heartily and said she cared +not. + + + +DON PEDRO +Yea, that she did: but yet, for all that, an if she +did not hate him deadly, she would love him dearly: +the old man's daughter told us all. + + + +CLAUDIO +All, all; and, moreover, God saw him when he was +hid in the garden. + + + +DON PEDRO +But when shall we set the savage bull's horns on +the sensible Benedick's head? + + + +CLAUDIO +Yea, and text underneath, 'Here dwells Benedick the +married man'? + + + +BENEDICK +Fare you well, boy: you know my mind. I will leave +you now to your gossip-like humour: you break jests +as braggarts do their blades, which God be thanked, +hurt not. My lord, for your many courtesies I thank +you: I must discontinue your company: your brother +the bastard is fled from Messina: you have among +you killed a sweet and innocent lady. For my Lord +Lackbeard there, he and I shall meet: and, till +then, peace be with him. + + + +Exit + + +DON PEDRO +He is in earnest. + + + +CLAUDIO +In most profound earnest; and, I'll warrant you, for +the love of Beatrice. + + + +DON PEDRO +And hath challenged thee. + + + +CLAUDIO +Most sincerely. + + + +DON PEDRO +What a pretty thing man is when he goes in his +doublet and hose and leaves off his wit! + + + +CLAUDIO +He is then a giant to an ape; but then is an ape a +doctor to such a man. + + + +DON PEDRO +But, soft you, let me be: pluck up, my heart, and +be sad. Did he not say, my brother was fled? + + + +Enter DOGBERRY, VERGES, and the Watch, with CONRADE +and BORACHIO + + +DOGBERRY +Come you, sir: if justice cannot tame you, she +shall ne'er weigh more reasons in her balance: nay, +an you be a cursing hypocrite once, you must be looked to. + + + +DON PEDRO +How now? two of my brother's men bound! Borachio +one! + + + +CLAUDIO +Hearken after their offence, my lord. + + + +DON PEDRO +Officers, what offence have these men done? + + + +DOGBERRY +Marry, sir, they have committed false report; +moreover, they have spoken untruths; secondarily, +they are slanders; sixth and lastly, they have +belied a lady; thirdly, they have verified unjust +things; and, to conclude, they are lying knaves. + + + +DON PEDRO +First, I ask thee what they have done; thirdly, I +ask thee what's their offence; sixth and lastly, why +they are committed; and, to conclude, what you lay +to their charge. + + + +CLAUDIO +Rightly reasoned, and in his own division: and, by +my troth, there's one meaning well suited. + + + +DON PEDRO +Who have you offended, masters, that you are thus +bound to your answer? this learned constable is +too cunning to be understood: what's your offence? + + + +BORACHIO +Sweet prince, let me go no farther to mine answer: +do you hear me, and let this count kill me. I have +deceived even your very eyes: what your wisdoms +could not discover, these shallow fools have brought +to light: who in the night overheard me confessing +to this man how Don John your brother incensed me +to slander the Lady Hero, how you were brought into +the orchard and saw me court Margaret in Hero's +garments, how you disgraced her, when you should +marry her: my villany they have upon record; which +I had rather seal with my death than repeat over +to my shame. The lady is dead upon mine and my +master's false accusation; and, briefly, I desire +nothing but the reward of a villain. + + + +DON PEDRO +Runs not this speech like iron through your blood? + + + +CLAUDIO +I have drunk poison whiles he utter'd it. + + + +DON PEDRO +But did my brother set thee on to this? + + + +BORACHIO +Yea, and paid me richly for the practise of it. + + + +DON PEDRO +He is composed and framed of treachery: +And fled he is upon this villany. + + + +CLAUDIO +Sweet Hero! now thy image doth appear +In the rare semblance that I loved it first. + + + +DOGBERRY +Come, bring away the plaintiffs: by this time our +sexton hath reformed Signior Leonato of the matter: +and, masters, do not forget to specify, when time +and place shall serve, that I am an ass. + + + +VERGES +Here, here comes master Signior Leonato, and the +Sexton too. + + + +Re-enter LEONATO and ANTONIO, with the Sexton + + +LEONATO +Which is the villain? let me see his eyes, +That, when I note another man like him, +I may avoid him: which of these is he? + + + +BORACHIO +If you would know your wronger, look on me. + + + +LEONATO +Art thou the slave that with thy breath hast kill'd +Mine innocent child? + + + +BORACHIO +Yea, even I alone. + + + +LEONATO +No, not so, villain; thou beliest thyself: +Here stand a pair of honourable men; +A third is fled, that had a hand in it. +I thank you, princes, for my daughter's death: +Record it with your high and worthy deeds: +'Twas bravely done, if you bethink you of it. + + + +CLAUDIO +I know not how to pray your patience; +Yet I must speak. Choose your revenge yourself; +Impose me to what penance your invention +Can lay upon my sin: yet sinn'd I not +But in mistaking. + + + +DON PEDRO +By my soul, nor I: +And yet, to satisfy this good old man, +I would bend under any heavy weight +That he'll enjoin me to. + + + +LEONATO +I cannot bid you bid my daughter live; +That were impossible: but, I pray you both, +Possess the people in Messina here +How innocent she died; and if your love +Can labour ought in sad invention, +Hang her an epitaph upon her tomb +And sing it to her bones, sing it to-night: +To-morrow morning come you to my house, +And since you could not be my son-in-law, +Be yet my nephew: my brother hath a daughter, +Almost the copy of my child that's dead, +And she alone is heir to both of us: +Give her the right you should have given her cousin, +And so dies my revenge. + + + +CLAUDIO +O noble sir, +Your over-kindness doth wring tears from me! +I do embrace your offer; and dispose +For henceforth of poor Claudio. + + + +LEONATO +To-morrow then I will expect your coming; +To-night I take my leave. This naughty man +Shall face to face be brought to Margaret, +Who I believe was pack'd in all this wrong, +Hired to it by your brother. + + + +BORACHIO +No, by my soul, she was not, +Nor knew not what she did when she spoke to me, +But always hath been just and virtuous +In any thing that I do know by her. + + + +DOGBERRY +Moreover, sir, which indeed is not under white and +black, this plaintiff here, the offender, did call +me ass: I beseech you, let it be remembered in his +punishment. And also, the watch heard them talk of +one Deformed: they say be wears a key in his ear and +a lock hanging by it, and borrows money in God's +name, the which he hath used so long and never paid +that now men grow hard-hearted and will lend nothing +for God's sake: pray you, examine him upon that point. + + + +LEONATO +I thank thee for thy care and honest pains. + + + +DOGBERRY +Your worship speaks like a most thankful and +reverend youth; and I praise God for you. + + + +LEONATO +There's for thy pains. + + + +DOGBERRY +God save the foundation! + + + +LEONATO +Go, I discharge thee of thy prisoner, and I thank thee. + + + +DOGBERRY +I leave an arrant knave with your worship; which I +beseech your worship to correct yourself, for the +example of others. God keep your worship! I wish +your worship well; God restore you to health! I +humbly give you leave to depart; and if a merry +meeting may be wished, God prohibit it! Come, neighbour. + + + +Exeunt DOGBERRY and VERGES + + +LEONATO +Until to-morrow morning, lords, farewell. + + + +ANTONIO +Farewell, my lords: we look for you to-morrow. + + + +DON PEDRO +We will not fail. + + + +CLAUDIO +To-night I'll mourn with Hero. + + + +LEONATO +To the Watch Bring you these fellows on. We'll +talk with Margaret, +How her acquaintance grew with this lewd fellow. + + + +Exeunt, severally + + +SCENE II. LEONATO'S garden. +Enter BENEDICK and MARGARET, meeting + + +BENEDICK +Pray thee, sweet Mistress Margaret, deserve well at +my hands by helping me to the speech of Beatrice. + + + +MARGARET +Will you then write me a sonnet in praise of my beauty? + + + +BENEDICK +In so high a style, Margaret, that no man living +shall come over it; for, in most comely truth, thou +deservest it. + + + +MARGARET +To have no man come over me! why, shall I always +keep below stairs? + + + +BENEDICK +Thy wit is as quick as the greyhound's mouth; it catches. + + + +MARGARET +And yours as blunt as the fencer's foils, which hit, +but hurt not. + + + +BENEDICK +A most manly wit, Margaret; it will not hurt a +woman: and so, I pray thee, call Beatrice: I give +thee the bucklers. + + + +MARGARET +Give us the swords; we have bucklers of our own. + + + +BENEDICK +If you use them, Margaret, you must put in the +pikes with a vice; and they are dangerous weapons for maids. + + + +MARGARET +Well, I will call Beatrice to you, who I think hath legs. + + + +BENEDICK +And therefore will come. +Exit MARGARET +Sings +The god of love, +That sits above, +And knows me, and knows me, +How pitiful I deserve,-- +I mean in singing; but in loving, Leander the good +swimmer, Troilus the first employer of panders, and +a whole bookful of these quondam carpet-mangers, +whose names yet run smoothly in the even road of a +blank verse, why, they were never so truly turned +over and over as my poor self in love. Marry, I +cannot show it in rhyme; I have tried: I can find +out no rhyme to 'lady' but 'baby,' an innocent +rhyme; for 'scorn,' 'horn,' a hard rhyme; for, +'school,' 'fool,' a babbling rhyme; very ominous +endings: no, I was not born under a rhyming planet, +nor I cannot woo in festival terms. +Enter BEATRICE +Sweet Beatrice, wouldst thou come when I called thee? + + + +BEATRICE +Yea, signior, and depart when you bid me. + + + +BENEDICK +O, stay but till then! + + + +BEATRICE +'Then' is spoken; fare you well now: and yet, ere +I go, let me go with that I came; which is, with +knowing what hath passed between you and Claudio. + + + +BENEDICK +Only foul words; and thereupon I will kiss thee. + + + +BEATRICE +Foul words is but foul wind, and foul wind is but +foul breath, and foul breath is noisome; therefore I +will depart unkissed. + + + +BENEDICK +Thou hast frighted the word out of his right sense, +so forcible is thy wit. But I must tell thee +plainly, Claudio undergoes my challenge; and either +I must shortly hear from him, or I will subscribe +him a coward. And, I pray thee now, tell me for +which of my bad parts didst thou first fall in love with me? + + + +BEATRICE +For them all together; which maintained so politic +a state of evil that they will not admit any good +part to intermingle with them. But for which of my +good parts did you first suffer love for me? + + + +BENEDICK +Suffer love! a good epithet! I do suffer love +indeed, for I love thee against my will. + + + +BEATRICE +In spite of your heart, I think; alas, poor heart! +If you spite it for my sake, I will spite it for +yours; for I will never love that which my friend hates. + + + +BENEDICK +Thou and I are too wise to woo peaceably. + + + +BEATRICE +It appears not in this confession: there's not one +wise man among twenty that will praise himself. + + + +BENEDICK +An old, an old instance, Beatrice, that lived in +the lime of good neighbours. If a man do not erect +in this age his own tomb ere he dies, he shall live +no longer in monument than the bell rings and the +widow weeps. + + + +BEATRICE +And how long is that, think you? + + + +BENEDICK +Question: why, an hour in clamour and a quarter in +rheum: therefore is it most expedient for the +wise, if Don Worm, his conscience, find no +impediment to the contrary, to be the trumpet of his +own virtues, as I am to myself. So much for +praising myself, who, I myself will bear witness, is +praiseworthy: and now tell me, how doth your cousin? + + + +BEATRICE +Very ill. + + + +BENEDICK +And how do you? + + + +BEATRICE +Very ill too. + + + +BENEDICK +Serve God, love me and mend. There will I leave +you too, for here comes one in haste. + + + +Enter URSULA + + +URSULA +Madam, you must come to your uncle. Yonder's old +coil at home: it is proved my Lady Hero hath been +falsely accused, the prince and Claudio mightily +abused; and Don John is the author of all, who is +fed and gone. Will you come presently? + + + +BEATRICE +Will you go hear this news, signior? + + + +BENEDICK +I will live in thy heart, die in thy lap, and be +buried in thy eyes; and moreover I will go with +thee to thy uncle's. + + + +Exeunt + + +SCENE III. A church. +Enter DON PEDRO, CLAUDIO, and three or four +with tapers + + +CLAUDIO +Is this the monument of Leonato? + + + +Lord +It is, my lord. + + + +CLAUDIO +Reading out of a scroll +Done to death by slanderous tongues +Was the Hero that here lies: +Death, in guerdon of her wrongs, +Gives her fame which never dies. +So the life that died with shame +Lives in death with glorious fame. +Hang thou there upon the tomb, +Praising her when I am dumb. +Now, music, sound, and sing your solemn hymn. +SONG. +Pardon, goddess of the night, +Those that slew thy virgin knight; +For the which, with songs of woe, +Round about her tomb they go. +Midnight, assist our moan; +Help us to sigh and groan, +Heavily, heavily: +Graves, yawn and yield your dead, +Till death be uttered, +Heavily, heavily. + + + +CLAUDIO +Now, unto thy bones good night! +Yearly will I do this rite. + + + +DON PEDRO +Good morrow, masters; put your torches out: +The wolves have prey'd; and look, the gentle day, +Before the wheels of Phoebus, round about +Dapples the drowsy east with spots of grey. +Thanks to you all, and leave us: fare you well. + + + +CLAUDIO +Good morrow, masters: each his several way. + + + +DON PEDRO +Come, let us hence, and put on other weeds; +And then to Leonato's we will go. + + + +CLAUDIO +And Hymen now with luckier issue speed's +Than this for whom we render'd up this woe. + + + +Exeunt + + +SCENE IV. A room in LEONATO'S house. +Enter LEONATO, ANTONIO, BENEDICK, BEATRICE, +MARGARET, URSULA, FRIAR FRANCIS, and HERO + + +FRIAR FRANCIS +Did I not tell you she was innocent? + + + +LEONATO +So are the prince and Claudio, who accused her +Upon the error that you heard debated: +But Margaret was in some fault for this, +Although against her will, as it appears +In the true course of all the question. + + + +ANTONIO +Well, I am glad that all things sort so well. + + + +BENEDICK +And so am I, being else by faith enforced +To call young Claudio to a reckoning for it. + + + +LEONATO +Well, daughter, and you gentle-women all, +Withdraw into a chamber by yourselves, +And when I send for you, come hither mask'd. +Exeunt Ladies +The prince and Claudio promised by this hour +To visit me. You know your office, brother: +You must be father to your brother's daughter +And give her to young Claudio. + + + +ANTONIO +Which I will do with confirm'd countenance. + + + +BENEDICK +Friar, I must entreat your pains, I think. + + + +FRIAR FRANCIS +To do what, signior? + + + +BENEDICK +To bind me, or undo me; one of them. +Signior Leonato, truth it is, good signior, +Your niece regards me with an eye of favour. + + + +LEONATO +That eye my daughter lent her: 'tis most true. + + + +BENEDICK +And I do with an eye of love requite her. + + + +LEONATO +The sight whereof I think you had from me, +From Claudio and the prince: but what's your will? + + + +BENEDICK +Your answer, sir, is enigmatical: +But, for my will, my will is your good will +May stand with ours, this day to be conjoin'd +In the state of honourable marriage: +In which, good friar, I shall desire your help. + + + +LEONATO +My heart is with your liking. + + + +FRIAR FRANCIS +And my help. +Here comes the prince and Claudio. + + + +Enter DON PEDRO and CLAUDIO, and two or +three others + + +DON PEDRO +Good morrow to this fair assembly. + + + +LEONATO +Good morrow, prince; good morrow, Claudio: +We here attend you. Are you yet determined +To-day to marry with my brother's daughter? + + + +CLAUDIO +I'll hold my mind, were she an Ethiope. + + + +LEONATO +Call her forth, brother; here's the friar ready. + + + +Exit ANTONIO + + +DON PEDRO +Good morrow, Benedick. Why, what's the matter, +That you have such a February face, +So full of frost, of storm and cloudiness? + + + +CLAUDIO +I think he thinks upon the savage bull. +Tush, fear not, man; we'll tip thy horns with gold +And all Europa shall rejoice at thee, +As once Europa did at lusty Jove, +When he would play the noble beast in love. + + + +BENEDICK +Bull Jove, sir, had an amiable low; +And some such strange bull leap'd your father's cow, +And got a calf in that same noble feat +Much like to you, for you have just his bleat. + + + +CLAUDIO +For this I owe you: here comes other reckonings. +Re-enter ANTONIO, with the Ladies masked +Which is the lady I must seize upon? + + + +ANTONIO +This same is she, and I do give you her. + + + +CLAUDIO +Why, then she's mine. Sweet, let me see your face. + + + +LEONATO +No, that you shall not, till you take her hand +Before this friar and swear to marry her. + + + +CLAUDIO +Give me your hand: before this holy friar, +I am your husband, if you like of me. + + + +HERO +And when I lived, I was your other wife: +Unmasking +And when you loved, you were my other husband. + + + +CLAUDIO +Another Hero! + + + +HERO +Nothing certainer: +One Hero died defiled, but I do live, +And surely as I live, I am a maid. + + + +DON PEDRO +The former Hero! Hero that is dead! + + + +LEONATO +She died, my lord, but whiles her slander lived. + + + +FRIAR FRANCIS +All this amazement can I qualify: +When after that the holy rites are ended, +I'll tell you largely of fair Hero's death: +Meantime let wonder seem familiar, +And to the chapel let us presently. + + + +BENEDICK +Soft and fair, friar. Which is Beatrice? + + + +BEATRICE +Unmasking I answer to that name. What is your will? + + + +BENEDICK +Do not you love me? + + + +BEATRICE +Why, no; no more than reason. + + + +BENEDICK +Why, then your uncle and the prince and Claudio +Have been deceived; they swore you did. + + + +BEATRICE +Do not you love me? + + + +BENEDICK +Troth, no; no more than reason. + + + +BEATRICE +Why, then my cousin Margaret and Ursula +Are much deceived; for they did swear you did. + + + +BENEDICK +They swore that you were almost sick for me. + + + +BEATRICE +They swore that you were well-nigh dead for me. + + + +BENEDICK +'Tis no such matter. Then you do not love me? + + + +BEATRICE +No, truly, but in friendly recompense. + + + +LEONATO +Come, cousin, I am sure you love the gentleman. + + + +CLAUDIO +And I'll be sworn upon't that he loves her; +For here's a paper written in his hand, +A halting sonnet of his own pure brain, +Fashion'd to Beatrice. + + + +HERO +And here's another +Writ in my cousin's hand, stolen from her pocket, +Containing her affection unto Benedick. + + + +BENEDICK +A miracle! here's our own hands against our hearts. +Come, I will have thee; but, by this light, I take +thee for pity. + + + +BEATRICE +I would not deny you; but, by this good day, I yield +upon great persuasion; and partly to save your life, +for I was told you were in a consumption. + + + +BENEDICK +Peace! I will stop your mouth. + + + +Kissing her + + +DON PEDRO +How dost thou, Benedick, the married man? + + + +BENEDICK +I'll tell thee what, prince; a college of +wit-crackers cannot flout me out of my humour. Dost +thou think I care for a satire or an epigram? No: +if a man will be beaten with brains, a' shall wear +nothing handsome about him. In brief, since I do +purpose to marry, I will think nothing to any +purpose that the world can say against it; and +therefore never flout at me for what I have said +against it; for man is a giddy thing, and this is my +conclusion. For thy part, Claudio, I did think to +have beaten thee, but in that thou art like to be my +kinsman, live unbruised and love my cousin. + + + +CLAUDIO +I had well hoped thou wouldst have denied Beatrice, +that I might have cudgelled thee out of thy single +life, to make thee a double-dealer; which, out of +question, thou wilt be, if my cousin do not look +exceedingly narrowly to thee. + + + +BENEDICK +Come, come, we are friends: let's have a dance ere +we are married, that we may lighten our own hearts +and our wives' heels. + + + +LEONATO +We'll have dancing afterward. + + + +BENEDICK +First, of my word; therefore play, music. Prince, +thou art sad; get thee a wife, get thee a wife: +there is no staff more reverend than one tipped with horn. + + + +Enter a Messenger + + +Messenger +My lord, your brother John is ta'en in flight, +And brought with armed men back to Messina. + + + +BENEDICK +Think not on him till to-morrow: +I'll devise thee brave punishments for him. +Strike up, pipers. + + +Dance +Exeunt + + +
diff --git a/jni/ruby/test/rexml/data/namespaces.xml b/jni/ruby/test/rexml/data/namespaces.xml new file mode 100644 index 0000000..e8e4df8 --- /dev/null +++ b/jni/ruby/test/rexml/data/namespaces.xml @@ -0,0 +1,18 @@ + + + + Hello + + + + Hey + + + + Hey2 + + + + Hey3 + + diff --git a/jni/ruby/test/rexml/data/nitf.xml b/jni/ruby/test/rexml/data/nitf.xml new file mode 100644 index 0000000..269d99e --- /dev/null +++ b/jni/ruby/test/rexml/data/nitf.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Use of Napster Quadruples + + By PETER SVENSSON + AP Business Writer + + The Associated Press + + NEW YORK + + + + +

Despite the uncertain legality of the Napster online music-sharing service, the number of people +using it more than quadrupled in just five months, Media Metrix said Monday.

+

That made Napster the fastest-growing software application ever recorded by the Internet research +company.

+

From 1.1 million home users in the United States in February, the first month Media Metrix +tracked the application, Napster use rocketed to 4.9 million users in July.

+

That represents 6 percent of U.S. home PC users who have modems, said Media Metrix, which pays +people to install monitoring software on their computers.

+

It estimates total usage from a panel of about 50,000 people in the United States.

+

Napster was also used at work by 887,000 people in July, Media Metrix said.

+

Napster Inc. has been sued by the recording industry for allegedly enabling copyright +infringement. The federal government weighed in on the case Friday, saying the service is not protected +under a key copyright law, as the San Mateo, Calif., company claims.

+

Bruce Ryon, head of Media Metrix's New Media Group, said Napster was used by "the full spectrum of PC users, not just the youth with time on their hands and a passion for music."

+

The Napster program allows users to copy digital music files from the hard drives of other +users over the Internet.

+

Napster Inc. said last week that 28 million people had downloaded its program. It does not reveal +its own figures for how many people actually use the software.

+

Because the program connects to the company's computers over the Internet every time +it is run, Napster Inc. can track usage exactly.

+

__

+

On the Net:

+

+http://www.napster.com

+

+http://www.mediametrix.com

+
+
+ +
diff --git a/jni/ruby/test/rexml/data/numbers.xml b/jni/ruby/test/rexml/data/numbers.xml new file mode 100644 index 0000000..a1791cd --- /dev/null +++ b/jni/ruby/test/rexml/data/numbers.xml @@ -0,0 +1,18 @@ + + + + + 3 + 24 + 55 + 11 + 2 + -3 + + + + + + + + diff --git a/jni/ruby/test/rexml/data/ofbiz-issues-full-177.xml b/jni/ruby/test/rexml/data/ofbiz-issues-full-177.xml new file mode 100644 index 0000000..bfff771 --- /dev/null +++ b/jni/ruby/test/rexml/data/ofbiz-issues-full-177.xml @@ -0,0 +1,13971 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + 1 + RESOLVED + P3 + FIXED + Documentation + CVS + All + issues@ofbiz + 20030820210924 + website + ajzeneski + not determined + DEFECT + 2003-08-13 22:35:10 + issues@ofbiz + + + + All + Website missing + + + ajzeneski + 2003-08-13 22:35:10 + Website is missing from CVS. + + + ajzeneski + 2003-08-19 12:09:17 + Website starting to move + + + ajzeneski + 2003-08-19 12:11:57 + Changed milestone + + + ajzeneski + 2003-08-20 21:09:24 + Website has been imported into CVS + + + ajzeneski + 2003-08-19 12:09:17 + issue_status + Status + NEW + STARTED + + + ajzeneski + 2003-08-19 12:09:17 + version + Version + unspecified + CVS + + + ajzeneski + 2003-08-19 12:11:57 + target_milestone + Target Milestone + milestone 1 + not determined + + + ajzeneski + 2003-08-20 21:09:24 + issue_status + Status + STARTED + RESOLVED + + + ajzeneski + 2003-08-20 21:09:24 + resolution + Resolution + + FIXED + + + + 2 + RESOLVED + P3 + FIXED + Components + CVS + All + jonesde + 20030824004146 + Product + ajzeneski + not determined + DEFECT + 2003-08-23 14:25:20 + issues@ofbiz + + + + All + Missing FTL + + + ajzeneski + 2003-08-23 14:25:20 + Missing FTL file: + +Error: File not found: /feature/EditFeatureCategoryFeatures.ftl + + + jonesde + 2003-08-24 00:41:46 + Converted JSP to FTL, made some small corrections. + + + jonesde + 2003-08-24 00:41:46 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2003-08-24 00:41:46 + resolution + Resolution + + FIXED + + + + 3 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20030828103031 + Product + ajzeneski + not determined + DEFECT + 2003-08-23 14:27:14 + issues@ofbiz + + + + All + Edit Promo Bug + + + ajzeneski + 2003-08-23 14:27:14 + When editing a promo rule; the drop down for the current condition contains only +the existing condition (many times). + + + jonesde + 2003-08-28 10:30:31 + #list directive had a type. Fix in CVS. + + + jonesde + 2003-08-28 10:30:31 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2003-08-28 10:30:31 + resolution + Resolution + + FIXED + + + + 4 + VERIFIED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20030828103057 + Product + ajzeneski + not determined + DEFECT + 2003-08-23 14:30:52 + issues@ofbiz + + + + All + Price Rule Bug + + + ajzeneski + 2003-08-23 14:30:52 + When editing a price rule; changing the is "sale price" flag sets properly, +however always displays "no" as the selected choice. + + + jonesde + 2003-08-28 10:20:59 + Fixed conditional on the no button, now appears correctly. + + + jonesde + 2003-08-28 10:30:57 + Done + + + jonesde + 2003-08-28 10:20:59 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2003-08-28 10:20:59 + resolution + Resolution + + FIXED + + + jonesde + 2003-08-28 10:30:57 + issue_status + Status + RESOLVED + VERIFIED + + + + 5 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20030823144138 + Party + ajzeneski + not determined + DEFECT + 2003-08-23 14:41:38 + issues@ofbiz + + + + All + Relationship missing button + + + ajzeneski + 2003-08-23 14:41:38 + View/Edit party relationships page first is still JSP and second is missing the +links to communication event(s). + + + + 6 + CLOSED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20030918144334 + Entity + robdawson + not determined + DEFECT + 2003-09-04 02:09:57 + jonesde + + + + All + Entity Engine ConnectionFactory and DBCPConnectionFactory issues with Oracle + + + robdawson + 2003-09-04 02:09:57 + When using the Inline JDBC Functionality of the Entity Engine to access an Oracle +database the Entity Engine gives SQL no suitable driver exceptions. + +The fix for this involves changing: + loader.loadClass(driverClassName); +to + Class clazz = loader.loadClass(driverClassName); + clazz.newInstance(); +in both the ConnectionFactory and DBCPConnectionFactory classes. + +There will also need to be the appropriate exception handling. + +Please contact me if this requires any clarification. + + + ajzeneski + 2003-09-04 22:15:06 + The message you are getting means that the JDBC drivers for Oracle cannot be +found on the classpath. Contact the users mailing list if you need further help +with this issue. + + + ajzeneski + 2003-09-04 22:17:28 + Sorry; DBCP support is currently outdated and not used due to the fact that +there is no transaction support. It is recommended you use the JOTM/XAPool +connections. This issue will be addressed during a refactor of this class in the +coming months. + + + jonesde + 2003-09-18 14:43:34 + +This issue has been resolved with code changes similar to those recommended. + +HOWEVER: There is one caveat with this: I would NOT recommend running using +either of these blocks of code. Without a transaction aware connection pool +performance will be severely affected or operations may be performed outside of +transactions. So, I wouldn't use straight JDBC or DBCP right now. Hopefully in +the future DBCP will support XADataSources, then it may be an option. + +Later, +-David Jones + + + + ajzeneski + 2003-09-04 22:15:06 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2003-09-04 22:15:06 + resolution + Resolution + + INVALID + + + jonesde + 2003-09-18 14:43:34 + issue_status + Status + RESOLVED + CLOSED + + + jonesde + 2003-09-18 14:43:34 + qa_contact + QA Contact + issues@ofbiz + jonesde + + + + 7 + NEW + P4 + + Components + CVS + All + issues@ofbiz + 20040304194045 + WebTools + fzhu_genshare + not determined + DEFECT + 2003-09-21 07:35:08 + issues@ofbiz + + http://localhost:8080/webtools/control/view/ModelGroupWriter?savetofile=true + + All + "Save Entity Group XML to File" error + + + 8 + jonesde + 2003-11-04 01:04:02 + + + fzhu_genshare + 2003-09-21 07:35:08 + If click "Save Entity Group XML to File" on the webtools, the new page opens and +the following error message appears: + +org.apache.jasper.JasperException: Unable to compile class for JSP + +An error occurred at line: -1 in the jsp file: null + +Generated servlet error: +[javac] Since fork is true, ignoring compiler setting. +[javac] Compiling 1 source file +[javac] Since fork is true, ignoring compiler setting. +[javac] C:\DOCUME~1\ADMINI~1\LOCALS~1 +\Temp\Jetty_0_0_0_0_8080__webtools\entity\ModelGroupWriter_jsp.java:72: +cannot resolve symbol +[javac] symbol : variable entityGroupResourceHandler +[javac] location: class org.ofbiz.entity.model.ModelGroupReader +[javac] ResourceHandler resourceHandler = +modelGroupReader.entityGroupResourceHandler; +[javac] ^ +[javac] 1 error + + + jonesde + 2003-11-04 01:04:02 + *** Issue 8 has been marked as a duplicate of this issue. *** + + + jonesde + 2004-03-04 19:40:45 + lower priority + + + jonesde + 2004-03-04 19:40:45 + priority + Priority + P3 + P4 + + + + 8 + RESOLVED + P3 + DUPLICATE + Components + CVS + All + issues@ofbiz + 20031104010402 + WebTools + fzhu_genshare + not determined + DEFECT + 2003-09-21 07:40:53 + issues@ofbiz + + http://localhost:8080/webtools/control/view/ModelGroupWriter + + All + "Generate Entity Group XML" error + + + 7 + jonesde + 2003-11-04 01:04:02 + + + fzhu_genshare + 2003-09-21 07:40:53 + If clicked "Generate Entity Group XML" on webtools, an error message occurs: + +org.apache.jasper.JasperException: Unable to compile class for JSP + +An error occurred at line: -1 in the jsp file: null + +Generated servlet error: +[javac] Since fork is true, ignoring compiler setting. +[javac] Compiling 1 source file +[javac] Since fork is true, ignoring compiler setting. +[javac] C:\DOCUME~1\ADMINI~1\LOCALS~1 +\Temp\Jetty_0_0_0_0_8080__webtools\entity\ModelGroupWriter_jsp.java:72: +cannot resolve symbol +[javac] symbol : variable entityGroupResourceHandler +[javac] location: class org.ofbiz.entity.model.ModelGroupReader +[javac] ResourceHandler resourceHandler = +modelGroupReader.entityGroupResourceHandler; +[javac] ^ +[javac] 1 error + +It seems the class ResourceHandler is missing. The same error result in several +links of webtools concerning entity engine xml export broken. + + + jonesde + 2003-11-04 01:04:02 + This issue is a duplicate of #7, they may be different links but they hit the same +request and code. + +*** This issue has been marked as a duplicate of 7 *** + + + jonesde + 2003-11-04 01:04:02 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2003-11-04 01:04:02 + resolution + Resolution + + DUPLICATE + + + + 9 + RESOLVED + P3 + WONTFIX + Components + CVS + All + issues@ofbiz + 20040223211140 + Entity + byersa + not determined + DEFECT + 2003-10-28 09:27:31 + issues@ofbiz + + + + All + GenericEntity.getBytes fails with HSQLDB + + + byersa + 2003-10-28 09:27:31 + getBytes internally casts to ByteWrapper which causes a ClassCastException. +Casting directly to byte[] seems to work. + +Don't know if it fails with other dbs. + + + jonesde + 2004-02-23 21:11:40 + This does not appear to be something that can be fixed in OFBiz, it appears to be a bug in HSQLDB, and +only in certain versions. Trying it with an earlier version it worked, but various other things didn't. We +may just have to be patient until HSQLDB has another stable release. + + + jonesde + 2004-02-23 21:11:40 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-02-23 21:11:40 + resolution + Resolution + + WONTFIX + + + + 10 + RESOLVED + P5 + FIXED + Components + CVS + All + ajzeneski + 20040630193003 + Service + byersa + not determined + ENHANCEMENT + 2003-10-31 08:53:59 + issues@ofbiz + + + + All + missing or incorrect service parameter message + + + byersa + 2003-10-31 08:53:59 + If possible, I think it would be very helpful to developers if the message that +informs on invalid service parameter conditions would clearly indicate whether +it is in the IN or OUT mode that the problem is occurring. + + + ajzeneski + 2004-03-08 12:17:42 + changed to enhancement + + + ajzeneski + 2004-03-08 17:49:18 + reassigned + + + ajzeneski + 2004-06-30 19:30:03 + The ServiceValidationException has been updated to support missing and extra fields as well as +knowing which "mode" (IN/OUT) the error occured in. + + + ajzeneski + 2004-03-08 12:17:42 + issue_type + Issue Type + DEFECT + ENHANCEMENT + + + ajzeneski + 2004-03-08 12:17:42 + priority + Priority + P3 + P5 + + + ajzeneski + 2004-03-08 17:49:17 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-06-30 19:30:03 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-06-30 19:30:03 + resolution + Resolution + + FIXED + + + + 11 + RESOLVED + P2 + INVALID + Components + CVS + PC + jonesde + 20031104002629 + Content + cyf + not determined + DEFECT + 2003-11-03 22:26:18 + issues@ofbiz + + + + Windows 2000 + "response.sendRedirect" in jsp could not take effect + + + cyf + 2003-11-03 22:26:18 + I have write a test.jsp code(like): +..... +hello world! +<%response.sendRedirect("control/main");%> +.... + +define : +in controller.xml: +<request-map uri="test" edit="true"> + <response name="success" type="view" value="test"/> + <response name="error" type="view" value="error"/> +</request-map> +..... +<view-map name="test" type="region"/> + +in region also configued + +when I test the page : +it's appear "hello world!",but didn't redirect. + +When I use this code as jsp page in normal web app,redirect can take effect. + +I think this is a bug of in region process. + + + jonesde + 2003-11-04 00:26:29 + +If I understand your complaint correctly it is because the way you organized +things the response output stream is committed before the sendRedirect is +called. There is absolutely nothing that can be done about this. + +If you want to send a redirect you should do so in an event or a non-region view +(and non-jpublish for that matter). Those composite view tools are meant for +generating views and involve templates that may cause the response to be +committed before you wrapped view is even called. + +BTW, this may be more appropriate as a question on the users list, not as a defect +bug report. + +Later, +-David Jones + + + jonesde + 2003-11-04 00:26:29 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2003-11-04 00:26:29 + resolution + Resolution + + INVALID + + + + 12 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040223213513 + Entity + quake_wang + not determined + DEFECT + 2003-11-04 01:39:16 + issues@ofbiz + + + + All + entity cache is not synchronized with DB + + + quake_wang + 2003-11-04 01:39:16 + Quake, + +It might make sense to have an issue created on the ofbiz.dev.java.net +site that covers this problem, since it may take some time to resolve. +Could you create one there? It could just include text from messages +send back and forth in this email thread. + +Thanks, +-David + +On Nov 3, 2003, at 6:57 PM, Quake_Wang wrote: + +> The immutable flag can solve some cache synchronize issues, it will +> help for debugging. But, please consider this scenario: +> +> Service A: +> OK, now base on policy: "NEVER read from the cache if you are planning +> on updating", we directly read from DB, +> order = findByPK ("Order", 10000); +> order.set("status", "DEF"); +> order.store(); +> +> +> Service B: +> order = findByPKCache("Order", 10000); +> just query, do not change any fields, entity engine will put the order +> 10000 with "DEF" status in cache, after some other operations (not on +> the order generic value) throw exception, rolled back service A and B, +> then PKCache is not synchronized with DB too, the immutable flag can +> not help any...... +> +> You wrote a service using cache for better performance, and someone +> may assembly your service in same transaction (group service, ECA +> service), the synchronizing may broken, it's really hard to find such +> problem. +> +> Any ideas? +> +> Quake +> +> -----Original Message----- +> From: David Jones [mailto:jonesde@ofbiz.org] +> Sent: Monday, November 03, 2003 11:05 PM +> To: dev@ofbiz.dev.java.net +> Subject: Re: [OFBiz] Dev - Important - [Bug] PKCache is not +> synchronized +> with DB +> +> +> +> Because of the possibility that this is happening and causing +> previously unexplained problems, I decided to go ahead and implement +> the immutable feature on the GenericEntity. This is now in CVS, but may +> cause problems with current code (and will most likely in many cases). +> Do disable this just comment out the line near the beginning of the set +> method in GenericEntity.java. It is around line 248 in the current +> revision of the file. +> +> I fixed a few places that had this problem, including createCustomer in +> ecommerce and the userLogin service. Creating a new customer and going +> through the checkout process works fine now, but variations on the way +> I did it may break. +> +> If we have too many problems with this, I'm okay with disabling it +> temporarily, but it would be nice to go this direction in the future. +> It will help resolve the possibility that strange things happen because +> things are being changed in the cache when they shouldn't be and the +> cache is out of sync with the database, ie is dirty. +> +> Feel free to report bugs along these lines, or better yet send +> patches... +> +> Later, +> -David +> +> +> On Nov 3, 2003, at 5:24 AM, David Jones wrote: +> +>> +>> Quake, +>> +>> Yes, I know this is a problem, although I had forgotten about it since +>> it hasn't come up for a long time. +>> +>> Our official answer on this, related to the use of the cache in +>> general is: NEVER read from the cache if you are planning on updating +>> something. It's tempting to change the GenericValue object to have an +>> unchangeable flag that is set for all versions that go into the +>> cache.... +>> +>> I agree with you, there doesn't seem to be an easy way to +>> automatically clear the cache on a rollback. In most cases the +>> rollback doesn't even go through the Entity Engine, it is done in +>> external code. So, the Entity Engine never gets a notification of the +>> rollback, and if it did it would have to remember every operation that +>> happened during that transaction so it could clear those dirty cache +>> entries. +>> +>> Thus the policy: never use the cache to read when you are planning on +>> writing to the database. And yeah, maybe I should throw some code in +>> there to enforce this... Any thoughts from anyone on that? +>> +>> Later, +>> -David +>> +>> +>> +>> On Nov 3, 2003, at 4:45 AM, Quake_Wang wrote: +>> +>>> Found a bug in the PKCache, below is the scenario +>>> +>>> Service A: +>>> 1. find an order with the order No. 10000, dummy code: +>>> order = findByPKCache("Order", 10000); +>>> assume we get an order with the status "ABC"; +>>> +>>> 2. set the order status to "DEF" and store, dummy code: +>>> order.set("status", "DEF"); +>>> order.store(); +>>> +>>> Service B: +>>> 1. find order 10000 again, dummy code: +>>> order = findByPKCache("Order", 10000); +>>> If the service A and B are in the same transaction (ex, group service +>>> or ECA service), entity engine will get the order with "DEF" status +>>> and put it in the PK cache. +>>> +>>> 2. some other operations, throw exception +>>> Service A and B are rolled back, as the result, the PKCache is not +>>> synchronized with DB: +>>> DB: order 10000, status "ABC" +>>> PKCache: order 10000, status "DEF" +>>> +>>> I spent some time to trace this bug, but can not find an easy way to +>>> fix it, just simply change the findByPKCache to findByPK in service +>>> B. +>>> I'm sending out this email in hopes of helping who may encounter the +>>> same problem and receiving a better fix method. +>>> +>>> Regards +>>> Quake +>>> +>>> --------------------------------------------------------------------- +>>> To unsubscribe, e-mail: dev-unsubscribe@ofbiz.dev.java.net +>>> For additional commands, e-mail: dev-help@ofbiz.dev.java.net +>> +>> +>> --------------------------------------------------------------------- +>> To unsubscribe, e-mail: dev-unsubscribe@ofbiz.dev.java.net +>> For additional commands, e-mail: dev-help@ofbiz.dev.java.net +> +> +> --------------------------------------------------------------------- +> To unsubscribe, e-mail: dev-unsubscribe@ofbiz.dev.java.net +> For additional commands, e-mail: dev-help@ofbiz.dev.java.net +> +> +> --------------------------------------------------------------------- +> To unsubscribe, e-mail: dev-unsubscribe@ofbiz.dev.java.net +> For additional commands, e-mail: dev-help@ofbiz.dev.java.net + + +--------------------------------------------------------------------- +To unsubscribe, e-mail: dev-unsubscribe@ofbiz.dev.java.net +For additional commands, e-mail: dev-help@ofbiz.dev.java.net + + + jonesde + 2004-02-23 21:35:13 + +Just a note on this. To fix it there need to be ThreadLocal caches that are maintained by a class that +implements the Synchronization interface for transactions. The idea would be that cache reads look in +the ThreadLocal cache first, then in the global cache, cache writes put everything in the ThreadLocal +cache and when the transaction is committed all ThreadLocal cache entries go into the global cache. +-David + + + + 13 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20031112065558 + Entity + byersa + not determined + DEFECT + 2003-11-12 06:15:27 + issues@ofbiz + + + + All + setNonPKFields + + + byersa + 2003-11-12 06:15:27 + I had a situation in which I used setNonPKFields to populate an entity that had +createdData and lastModifiedDate from parameters thinking that it would be a +sort of parameter map. My intention was to then add the individual fields to a +service input, but it turns out that instead of converting the date string to +DateTime format, it kept them as strings and the service complained. I guess the +GenericValue only converts datatypes during the persistence phase? If that is +the case, it would be useful if it converted up loading. + + + jonesde + 2003-11-12 06:55:58 + This is really not the responsibility of the GenericValue object (or really the +GenericEntity object). This is difficult to handle as a defect report and should +be sent to the dev mailing for discussion of the best way to go about what you +are trying to do. The email message should perhaps include more detail about the +overall goal you are trying to accomplish. Note that the GenericEntity, at the +moment, does not enforce types going in, but may be changed to do that and throw +an exception if the type is wrong. -David + + + jonesde + 2003-11-12 06:55:58 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2003-11-12 06:55:58 + resolution + Resolution + + INVALID + + + + 14 + NEW + P3 + + Components + CVS + Macintosh + issues@ofbiz + 20040107162053 + Order + jonesde + not determined + DEFECT + 2004-01-07 16:20:53 + issues@ofbiz + + + + All + Order Summary pages don't show free shipping promo + + + jonesde + 2004-01-07 16:20:53 + Here is a description from Si Chen who reported the problem: + +One thing that I noticed that is anomalous, though, is that the order review +pages still show an estimate for shipping charges, even though the customer +should get free shipping. It seems that the checkout review pages are using +org.ofbiz.order.shoppingcart.shipping.ShippingEvents.getShipEstimate, while on +actual checkout it is using +org.ofbiz.order.order.OrderReadHelper.getShippingTotal. + +The former is not taking into account shipping adjustments. + + + + 15 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040210064750 + Order + nowpulse + not determined + PATCH + 2004-02-10 01:36:16 + issues@ofbiz + + + + All + Order Stats showing incorrect YTD info + + + nowpulse + 2004-02-10 01:36:16 + The YTD info is incorrect since the Java month starts at 0 instead of 1. + +ofbiz/components/order/webapp/ordermgr/WEB-INF/actions/order/orderstats.bsh +On Line 71 the 1 should be replaced with a 0 + +cal.set(Calendar.MONTH, 0); + +thank you, +sterling + + + jonesde + 2004-02-10 06:47:50 + Fixed as recommended. + + + jonesde + 2004-02-10 06:47:50 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-02-10 06:47:50 + resolution + Resolution + + FIXED + + + + 16 + NEW + P4 + + Components + CVS + All + jonesde + 20040527233859 + Product + jonesde + not determined + FEATURE + 2004-02-24 02:56:29 + issues@ofbiz + + + + All + Limit Categories Shown in Drop Downs + + + jonesde + 2004-02-24 02:56:29 + Add "show in drop-down" option ProductCategory, filter by it in all combo style category drop downs, +and change existing category drop-downs to be combo-boxes, include those on the EditProduct, +EditProductCategories, EditCategory, EditCategoryProducts, EditPromoRules pages. + + + jonesde + 2004-05-27 23:38:59 + Some progress has been made on this, but something still needs to be done with the form tool, etc to +limit the drop downs. + + + ajzeneski + 2004-03-18 11:59:21 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-05-27 23:38:59 + priority + Priority + P1 + P4 + + + + 17 + RESOLVED + P1 + FIXED + Components + CVS + All + jonesde + 20040318120731 + Product + jonesde + not determined + FEATURE + 2004-02-24 02:58:45 + issues@ofbiz + + + + All + Filter Promotion Products to exclude discontinued + + + jonesde + 2004-02-24 02:58:45 + Add code to the ProductPromoWorker to (perhaps optionally) filter products included by the +salesDiscontinuationDate, and of course make sure the category member from/thru dates are being +honored. + + + jonesde + 2004-02-25 21:00:44 + Now implemented. + + + jonesde + 2004-02-25 21:00:44 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-02-25 21:00:44 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:07:31 + version + Version + Pre3.0.0 + CVS + + + + 18 + RESOLVED + P1 + FIXED + Components + CVS + All + jonesde + 20040318120740 + Product + jonesde + not determined + DEFECT + 2004-02-24 03:01:49 + issues@ofbiz + + + + All + Back ordered, or insufficient quantities not handled right + + + jonesde + 2004-02-24 03:01:49 + It appears that when a product is back-ordered, or reserved in excess of the AvailableToPromise the +calculations and setting of values are messed up. + +Here is a report on this from Bryce Ewing on Feb 5th, 2004: + +================================================= +I have found something that appears to be a bug (but I am not totally sure), I will explain this in two +cases below: + +case 1: buy 1 item of product1 with no inventory + - inventory item created with 0 on hand, and -1 available to promise + - order item inventory res created with quantity of 1 and quantity not available of 1 + +case 2: buy 2 items of product2 with 1 item in inventory + - inventory item updated with 1 on hand, and -1 available to promise + - order item inventory res created with quantity of 2 and quantity not available of 0 + +For case 1 the system is doing exactly what I would expect, but in case 2 I would have expected that +the order item inventory res record would have had a quantity not available of 1 rather than 0. + +Am I mistaken in this expectation, or is this infact a bug? +================================================= + +Here is a comment on some apparently related findings by Jacopo Cappellato: + +================================================= +I'm studying the simple method InventoryServices.reserveProductInventory +that implements the inventory reservation of on order/order item, and I've +got a question about this issue. +What is the meaning of the quantityNotAvailable field in +OrderItemInventoryRes entity? Where and how is it used (or intended to be +used for)? I've noticed that this quantity is considered in the pick list +reports... + +Probably the quantityNotAvailable field should contain the quantity reserved +that caused inventory item's atp to be less than zero: if so, why in the +reserveProductInventory method the quantityNotAvailable is set only in line +498 and not also after line 458? And in which way, once set, could this +quantity return to zero? +================================================= + + + jonesde + 2004-02-24 18:35:45 + After a patch from Bryce Ewing it appears to be fixed. + + + jonesde + 2004-02-24 18:35:45 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-02-24 18:35:45 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:07:40 + version + Version + Pre3.0.0 + CVS + + + + 19 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120748 + Product + jacopo + not determined + PATCH + 2004-02-24 06:44:51 + issues@ofbiz + + + + All + Patch for bug in the Inventory Receive function + + + jacopo + 2004-02-24 06:44:51 + In Facility manager, when you receive a purchase order delivered with more than +one shipments and you select to receive only one shipment the proposed +quantities are the quantities of the original purchase order and not the +quantities of the shipment. +In my patches I tried to change the minimum amount of code and the +result is that the code is not well written... obviously feel free to change +my code. +PS: I submitted this patches to the dev list in january 2004. +PPS: the two patches are in Unified Output Format + + +Index: ofbiz/components/product/webapp/facility/inventory/receiveInventory.ftl +=================================================================== +RCS +file: /cvs/ofbiz/components/product/webapp/facility/inventory/receiveInventory.f +tl,v +retrieving revision 1.5 +diff -u -r1.5 receiveInventory.ftl +--- ofbiz/components/product/webapp/facility/inventory/receiveInventory.ftl + 17 Dec 2003 22:46:36 -0000 1.5 ++++ ofbiz/components/product/webapp/facility/inventory/receiveInventory.ftl + 14 Jan 2004 11:05:06 -0000 +@@ -312,6 +312,9 @@ + </tr> + <#list purchaseOrderItems as orderItem> + <#assign defaultQuantity = orderItem.quantity - receivedQuantities +[orderItem.orderItemSeqId]?double> ++ <#if shipment?has_content> ++ <#assign defaultQuantity = shippedQuantities +[orderItem.orderItemSeqId]?double - receivedQuantities +[orderItem.orderItemSeqId]?double> ++ </#if> + <#if 0 < defaultQuantity> + <#assign orderItemType = orderItem.getRelatedOne("OrderItemType")> + <input type="hidden" name="orderId_o_${rowCount}" +value="${orderItem.orderId}"> + + + + + + + +Index: ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh +=================================================================== +RCS file: /cvs/ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh,v +retrieving revision 1.4 +diff -u -r1.4 receiveInventory.bsh +--- ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh 25 Aug 2003 15:28:00 -0000 + 1.4 ++++ ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh 14 Jan 2004 11:08:14 -0000 +@@ -69,6 +69,7 @@ + shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap +("shipmentId", shipmentId)); + } + ++shippedQuantities = new HashMap(); + purchaseOrderItems = null; + if (purchaseOrder != null) { + if (product != null) { +@@ -80,14 +81,18 @@ + exprs = new ArrayList(); + while (issueIter.hasNext()) { + issuance = issueIter.next(); +- exprs.add(new EntityExpr("orderItemSeqId", EntityOperator.EQUALS, +issuance.getString("orderItemSeqId"))); ++ exprs.add(new EntityExpr("orderItemSeqId", EntityOperator.EQUALS, +issuance.getString("orderItemSeqId"))); ++ double issuanceQty = issuance.getDouble("quantity").doubleValue(); ++ if (shippedQuantities.containsKey(issuance.getString +("orderItemSeqId"))) { ++ issuanceQty += ((Double)shippedQuantities.get +(issuance.getString("orderItemSeqId"))).doubleValue(); ++ } ++ shippedQuantities.put(issuance.getString("orderItemSeqId"), +issuanceQty); + } + purchaseOrderItems = EntityUtil.filterByOr(orderItems, exprs); + } else { + purchaseOrderItems = purchaseOrder.getRelated("OrderItem"); + } + } +- + receivedQuantities = new HashMap(); + if (purchaseOrderItems != null && purchaseOrderItems.size() > 0) { + context.put("firstOrderItem", EntityUtil.getFirst(purchaseOrderItems)); +@@ -100,7 +105,13 @@ + if (receipts != null && receipts.size() > 0) { + recIter = receipts.iterator(); + while (recIter.hasNext()) { +- rec = recIter.next(); ++ rec = recIter.next(); ++ if (shipment != null) { ++ if (rec.getString("shipmentId") == null || ++ !rec.getString("shipmentId").equals(shipment.getString +("shipmentId"))) { ++ continue; ++ } ++ } + accepted = rec.getDouble("quantityAccepted"); + rejected = rec.getDouble("quantityRejected"); + if (accepted != null) +@@ -140,6 +151,7 @@ + context.put("product", product); + context.put("shipments", shipments); + context.put("shipment", shipment); ++context.put("shippedQuantities", shippedQuantities); + context.put("purchaseOrderItems", purchaseOrderItems); + context.put("receivedQuantities", receivedQuantities); + context.put("rejectReasons", rejectReasons); + + + jacopo + 2004-02-24 06:55:45 + Created an attachment (id=1) +Patch files in UOF for receiveInventory,bsh and receiveInventory.ftl + + + + jonesde + 2004-03-01 06:35:22 + The changes are in CVS. Thanks Jacopo! + + + text/plain + 1 + 2004-02-24 06:55:45 + Patch files in UOF for receiveInventory,bsh and receiveInventory.ftl + 1 + receiveInventory.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/1/receiveInventory.patch + + + jacopo + 2004-02-24 06:55:45 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=1) +Patch files in UOF for receiveInventory,bsh and receiveInventory.ftl + + + + jonesde + 2004-03-01 06:35:22 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 06:35:22 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:07:48 + version + Version + Pre3.0.0 + CVS + + + + 20 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120758 + Party + jacopo + not determined + PATCH + 2004-02-24 07:36:49 + issues@ofbiz + + + + All + List All Visits link in the Party Profile page returns an error with 0 visits + + + jacopo + 2004-02-24 07:36:50 + List All Visits link in the Party Profile page returns an error with 0 visits +(see attached patch file) due to wrong bsh code. + + + jacopo + 2004-02-24 07:38:20 + Created an attachment (id=2) +Patch for bug in uof + + + + jonesde + 2004-03-01 06:39:57 + The changes are in CVS. Thanks Jacopo! + + + text/plain + 2 + 2004-02-24 07:38:20 + Patch for bug in uof + 1 + showvisits.bsh.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/2/showvisits.bsh.patch + + + jacopo + 2004-02-24 07:38:20 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=2) +Patch for bug in uof + + + + jonesde + 2004-03-01 06:39:57 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 06:39:57 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:07:58 + version + Version + Pre3.0.0 + CVS + + + + 21 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120807 + Party + jacopo + not determined + PATCH + 2004-02-24 07:40:56 + issues@ofbiz + + + + All + findparty page returns JavaScript errors when clicking on the LookupParty link and when the lookup fields are hidden + + + jacopo + 2004-02-24 07:40:56 + findparty page returns JavaScript errors when clicking on the LookupParty link +and when the lookup fields are hidden. The attached patch should fix the +problem. + + + jacopo + 2004-02-24 07:41:29 + Created an attachment (id=3) +Patch for bug in uof + + + + jonesde + 2004-03-01 06:44:01 + Your changes are in CVS. Thanks Jacopo! + + + text/plain + 3 + 2004-02-24 07:41:29 + Patch for bug in uof + 1 + findparty.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/3/findparty.ftl.patch + + + jacopo + 2004-02-24 07:41:29 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=3) +Patch for bug in uof + + + + jonesde + 2004-03-01 06:44:01 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 06:44:01 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:08:07 + version + Version + Pre3.0.0 + CVS + + + + 22 + NEW + P3 + + Components + CVS + All + ajzeneski + 20040318115951 + Order + jacopo + not determined + DEFECT + 2004-02-24 08:52:07 + issues@ofbiz + + + + All + Errors in order entry when "Payment Already Received" type is selected. + + + jacopo + 2004-02-24 08:52:08 + In Order Entry: +when you finalize an order and, in the "Order Entry Payment +Settings" page, you select the "Payment Already Received" type, in the +following page you get JavaScript errors when you click over +the links (stating that the object "document.billsetupform" doesn't exist); +and so you cannot submit the order. + + + jonesde + 2004-02-26 07:08:20 + +This has been an issue for a while now. It's good to have it in the tracking system since it may not get +fixed right away. Andy is more aware of what is happening there than I am, so he may have more +feedback on it. -David + + + jonesde + 2004-02-26 07:08:20 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + jonesde + 2004-02-26 07:08:20 + priority + Priority + P2 + P3 + + + ajzeneski + 2004-03-18 11:59:51 + version + Version + Pre3.0.0 + CVS + + + + 23 + NEW + P4 + + Components + CVS + All + ajzeneski + 20040318120006 + Product + jacopo + not determined + DEFECT + 2004-02-24 08:56:40 + issues@ofbiz + + + + All + Inventory receive ignores the inventory item id field. + + + jacopo + 2004-02-24 08:56:40 + In Facility Manager -> Inventory receive: +it always creates a new inventory item even if the "inventory item id" optional +field is filled with an existing inventory item id. + + + ajzeneski + 2004-03-08 17:38:11 + reassigned + + + ajzeneski + 2004-03-08 17:38:11 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-03-18 12:00:06 + version + Version + Pre3.0.0 + CVS + + + + 24 + NEW + P4 + + Components + CVS + All + ajzeneski + 20040318120024 + Product + jacopo + not determined + DEFECT + 2004-02-24 09:01:59 + issues@ofbiz + + + + All + Receive return: it always creates serialized inventory items. + + + jacopo + 2004-02-24 09:01:59 + In Facility Manager -->Receive return + +it always creates a serialized inventory item (even if 'non-serialized' is +selected) and so the received quantities are lost (if more than one). + + + ajzeneski + 2004-03-08 17:38:55 + reassigned + + + ajzeneski + 2004-03-08 17:38:55 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-03-18 12:00:24 + version + Version + Pre3.0.0 + CVS + + + + 25 + RESOLVED + P2 + INVALID + Components + CVS + All + ajzeneski + 20040318120814 + Accounting + jonesde + not determined + DEFECT + 2004-02-25 14:58:53 + issues@ofbiz + + + + All + Permission Checks missing in various part of Accounting Manager + + + jonesde + 2004-02-25 14:58:53 + Various pages in the Accounting Manager have no view permission checking, including the billing +account, invoice, etc pages. + + + jaz + 2004-02-25 15:36:03 + I'm not involved in this project. + + + jonesde + 2004-02-25 16:13:54 + +Fixed assigned to mistake. + + + ajzeneski + 2004-03-08 10:48:28 + All components have a default VIEW permission based on the component configuration. Each page no +longer needs to have the added code as long as require auth is set in the controller.xml file. The +checkLogin event will make sure the user has the default permission for the specific component. +Additional permissions are only necessary when not using the default permission. + + + jaz + 2004-02-25 15:36:03 + assigned_to + Assigned To + jaz + jonesde + + + jonesde + 2004-02-25 16:13:54 + assigned_to + Assigned To + jonesde + ajzeneski + + + ajzeneski + 2004-03-08 10:48:28 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-03-08 10:48:28 + resolution + Resolution + + INVALID + + + ajzeneski + 2004-03-18 12:08:14 + version + Version + Pre3.0.0 + CVS + + + + 26 + RESOLVED + P3 + FIXED + Components + CVS + All + ajzeneski + 20040308115822 + Order + jonesde + not determined + DEFECT + 2004-02-25 21:11:36 + issues@ofbiz + + + + All + Billing Account Errors + + + jonesde + 2004-02-25 21:11:36 + This issue was reported by Si Chen, Olivier Heintz, and some others. + +The following is some text from an email fro Si Chen on Jan 26, 2004; the attached patch is also from +this email. + +======================================= +Hello. After some work we have tracked down the problem with using +billingAccount in the order manager and were able to fix it. The +problem is stated in the order manager's billsettings.ftl, it was +passing in "EXT_BILLACT|10000" for the checkoutPaymentId instead of +separate checkoutPaymentId and billingAccountId. Olivier had suggested +a good patch earlier which parses this form of checkoutPaymentId in the +CheckOutEvents.java. We took a different approach and used code from +ecommerce to pass both checkoutPaymentId and billingAccountId. We also +fixed CheckOutEvents.java to get the billingAccountId from the request +and associate it with the cart. Both are shown in the attached patch. + +One last problem: in ecommerce, in checkoutpayment.ftl, gift cards, +credit cards, and billing accounts are all using "amount_<account_id>" +as the name of the input fields. As a result, when the +toggleBillingAccount javascript function tries to toggle the billing +account selected for entering the amount to pay, it gets confused and +cannot do this. As a result, when you use the multi-page rather than +express checkout in ecommerce, it does not work properly. I'll be happy +to elaborate on this if you need me to. +======================================= + + + jonesde + 2004-02-25 21:14:01 + Created an attachment (id=4) +Patch to fix BillingAccount issues + + + + ajzeneski + 2004-03-08 11:58:22 + Applied patch; fixed JS in ecommerce + + + text/plain + 4 + 2004-02-25 21:14:01 + Patch to fix BillingAccount issues + 1 + BillingAccountError.patch + 3 + jonesde + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/4/BillingAccountError.patch + + + jonesde + 2004-02-25 21:14:01 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=4) +Patch to fix BillingAccount issues + + + + ajzeneski + 2004-03-08 11:58:22 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-03-08 11:58:22 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-08 11:58:22 + version + Version + Pre3.0.0 + CVS + + + + 27 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120822 + WorkEffort + jacopo + not determined + PATCH + 2004-02-26 03:20:00 + issues@ofbiz + + + + All + Patch for missing pagedef file for popup template that causes lookup error (due to i18n changes) + + + jacopo + 2004-02-26 03:20:00 + The lookup link in New Event -> Parties page is broken. +The popup template doesn't run the envsetup script that loads the localized +labels. + +PATCH: add a file named "popup.xml" to the template folder containing the +following lines: + +<?xml version="1.0" encoding="UTF-8"?> +<page> + <template-action name="/includes/envsetup.bsh"/> +</page> + + + jonesde + 2004-03-01 07:16:55 + +I have added the popup.xml file to CVS. Thanks for sending it over Jacopo. + + + jonesde + 2004-03-01 07:16:55 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 07:16:55 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:08:22 + version + Version + Pre3.0.0 + CVS + + + + 28 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040806161040 + WorkEffort + jacopo + not determined + PATCH + 2004-02-26 03:32:11 + issues@ofbiz + + + + All + Added lookup link for parties in month view + + + jacopo + 2004-02-26 03:32:11 + Added lookup link for parties in month view. +All the stuff was already in place... I just added the link. +However I think this is a very useful enhancement. + + + jacopo + 2004-02-26 03:32:44 + Created an attachment (id=5) +Patch in UOF + + + + jonesde + 2004-03-03 08:10:20 + Changed issue type as per email from Jacopo. + + + jonesde + 2004-08-06 16:10:40 + Thanks Jacopo, this is now in CVS. + + + text/plain + 5 + 2004-02-26 03:32:44 + Patch in UOF + 1 + month.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/5/month.ftl.patch + + + jacopo + 2004-02-26 03:32:44 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=5) +Patch in UOF + + + + jonesde + 2004-03-03 08:10:20 + issue_type + Issue Type + ENHANCEMENT + PATCH + + + ajzeneski + 2004-03-18 12:00:44 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-08-06 16:10:40 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-08-06 16:10:40 + resolution + Resolution + + FIXED + + + + 29 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120831 + WorkEffort + jacopo + not determined + PATCH + 2004-02-26 03:56:48 + issues@ofbiz + + + + All + When creating a new event from calendar, start and end date were not filled properly in the form + + + jacopo + 2004-02-26 03:56:48 + When creating a new event from calendar, start and end date were not filled +properly in the event form. +The two patches (one for the event.ftl file and one for the event.bsh file) +will solve this problem. + + + jacopo + 2004-02-26 03:59:24 + Created an attachment (id=6) +Patch for event.bsh in UOF + + + + jacopo + 2004-02-26 03:59:58 + Created an attachment (id=7) +Patch for event.ftl file in UOF + + + + jonesde + 2004-03-01 07:28:02 + Your changes are in CVS, thanks Jacopo! + + + text/plain + 6 + 2004-02-26 03:59:24 + Patch for event.bsh in UOF + 1 + event.bsh.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/6/event.bsh.patch + + + text/plain + 7 + 2004-02-26 03:59:58 + Patch for event.ftl file in UOF + 1 + event.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/7/event.ftl.patch + + + jacopo + 2004-02-26 03:59:24 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=6) +Patch for event.bsh in UOF + + + + jacopo + 2004-02-26 03:59:58 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=7) +Patch for event.ftl file in UOF + + + + jonesde + 2004-03-01 07:28:02 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 07:28:02 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:08:31 + version + Version + Pre3.0.0 + CVS + + + + 30 + NEW + P5 + + Components + CVS + All + ajzeneski + 20040308175050 + Order + jackhung + not determined + DEFECT + 2004-02-26 04:17:49 + issues@ofbiz + + + + All + Fail to approval order + + + jackhung + 2004-02-26 04:17:49 + 19285437[ ControlServlet.java:133:DEBUG] [[[updateactivityassign] Servlet +Starting, doing setup- total:0.0,since last(Begin):0.0]] +19285438[ ControlServlet.java:182:DEBUG] [[[updateactivityassign] Setup +done, doing Event(s) and View(s)- total:0.0,since last([updateactivityas...):0.0]] +19285440[ RequestHandler.java:200:INFO ] [Processing Request]: +updateactivityassign +19285744[ WfProcessMgrImpl.java:106:INFO ] [WfProcessMgr.init] : Create +process manager (org.ofbiz.order[20030730144901] / ProcessOrder[20030730144901]) +19285890[ BshUtil.java:75 :ERROR] BSH Evaluation error. +Sourced file: <Inline eval of: approvalCode.equals("0"); > : Attempt to resolve +method: equals() on undefined variable or class name: approvalCode : at Line: 1 +: in file: <Inline eval of: approvalCode.equals("0"); > : approvalCode .equals ( +"0" ) + + at bsh.UtilEvalError.toEvalError(UtilEvalError.java:82) + at bsh.UtilEvalError.toEvalError(UtilEvalError.java:87) + at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:79) + at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:69) + at bsh.Interpreter.evalParsedScript(Interpreter.java:1104) + at bsh.Interpreter.eval(Interpreter.java:590) + at bsh.Interpreter.eval(Interpreter.java:616) + at bsh.Interpreter.eval(Interpreter.java:606) + at org.ofbiz.base.util.BshUtil.eval(BshUtil.java:64) + at +org.ofbiz.workflow.impl.WfExecutionObjectImpl.evalBshCondition(WfExecutionObjectImpl.java:718) + at +org.ofbiz.workflow.impl.WfProcessImpl.getTransFrom(WfProcessImpl.java:477) + at org.ofbiz.workflow.impl.WfProcessImpl.queueNext(WfProcessImpl.java:298) + at +org.ofbiz.workflow.impl.WfProcessImpl.activityComplete(WfProcessImpl.java:286) + at org.ofbiz.workflow.impl.WfActivityImpl.complete(WfActivityImpl.java:408) + at +org.ofbiz.workflow.impl.WfAssignmentImpl.complete(WfAssignmentImpl.java:175) + at +org.ofbiz.workflow.client.WorkflowClient.complete(WorkflowClient.java:266) + at +org.ofbiz.workflow.client.WorkflowServices.completeAssignment(WorkflowServices.java:418) + + + ajzeneski + 2004-03-08 12:08:46 + I cannot duplicate this problem; please provide more information or we will have to close this has no +longer an issue. + + + ajzeneski + 2004-03-08 17:50:50 + reassigned + + + ajzeneski + 2004-03-08 12:08:46 + issue_status + Status + NEW + STARTED + + + ajzeneski + 2004-03-08 12:08:46 + op_sys + OS/Version + Linux + All + + + ajzeneski + 2004-03-08 12:08:46 + rep_platform + Platform + PC + All + + + ajzeneski + 2004-03-08 12:08:46 + short_desc + Summary + Fail to approval order + Fail to approval order + + + ajzeneski + 2004-03-08 17:50:50 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-03-08 17:50:50 + issue_status + Status + STARTED + NEW + + + ajzeneski + 2004-03-08 17:50:50 + priority + Priority + P2 + P5 + + + + 31 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040318120101 + WorkEffort + jacopo + not determined + DEFECT + 2004-02-26 05:39:36 + issues@ofbiz + + + + All + Error message when you try to create new contact information under an event + + + jacopo + 2004-02-26 05:39:36 + An error message is returned when you try to create new contact information +under an event: Cannot locate service by name (createWorkEffortContactMech) + +This is the complete message: + +ERROR: Could not complete the Create an email address for WorkEffort process +[problem invoking the [createWorkEffortContactMech] service with the map named +[context] containing [{locale=en_US, infoString=foo@bar.com, userLogin= +[GenericEntity:UserLogin][partyId,admin(java.lang.String)][disabledDateTime,null +()][passwordHint,null()][createdTxStamp,null()][successiveFailedLogins,null()] +[enabled,Y(java.lang.String)][userLoginId,admin(java.lang.String)] +[currentPassword,ofbiz(java.lang.String)][lastUpdatedTxStamp,null()] +[lastUpdatedStamp,null()][createdStamp,null()], workEffortId=10030, +contactMechTypeId=EMAIL_ADDRESS}]: Cannot locate service by name +(createWorkEffortContactMech)] + + + ajzeneski + 2004-03-18 12:01:01 + version + Version + Pre3.0.0 + CVS + + + + 32 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040409054533 + WorkEffort + jacopo + not determined + DEFECT + 2004-02-26 05:50:01 + issues@ofbiz + + + + All + Errors that prevent adding a new phase to a project. + + + jacopo + 2004-02-26 05:50:01 + It's impossible to add a new phase to a project. Even if you fill all the +fields of the new phase form when you press the 'create' button you get an +error in the system log (however no error messages are shown in the html page). + +This is the complete error message: + +1160388[ ServiceDispatcher.java:309:ERROR] Service Error [createPhase]: ERROR: +Could not complete the Create Project Phase process [problem creating the newEnt +ity value: while inserting: [GenericEntity:WorkEffortAssoc][createdTxStamp,2004- +02-26 14:44:26.096(java.sql.Timestamp)][workEffortIdTo,10034(java.lang.String)][ +workEffortIdFrom,10031(java.lang.String)][workEffortAssocTypeId,WORK_EFF_BREAKDO +WN(java.lang.String)][lastUpdatedTxStamp,2004-02-26 14:44:26.096(java.sql.Timest +amp)][createdStamp,2004-02-26 14:44:26.106(java.sql.Timestamp)][lastUpdatedStamp +,2004-02-26 14:44:26.106(java.sql.Timestamp)] (SQL Exception while executing the + following:INSERT INTO WORK_EFFORT_ASSOC (WORK_EFFORT_ID_FROM, WORK_EFFORT_ID_TO +, WORK_EFFORT_ASSOC_TYPE_ID, SEQUENCE_NUM, FROM_DATE, THRU_DATE, LAST_UPDATED_ST +AMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, + ?, ?, ?, ?, ?, ?) ([-5005] (at 124): Missing non-NULL value))] + + + jacopo + 2004-04-09 05:45:33 + David Jones has fixed this problem in date 2004-04-08 (see the +thread "createphase ERROR in OFBiz 3.0 and OFBiz CVS versions" in the dev-list). + + + + ajzeneski + 2004-03-18 12:01:18 + version + Version + Pre3.0.0 + CVS + + + jacopo + 2004-04-09 05:45:33 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-04-09 05:45:33 + resolution + Resolution + + FIXED + + + + 33 + RESOLVED + P4 + FIXED + Components + CVS + All + issues@ofbiz + 20050209023142 + WorkEffort + jacopo + not determined + DEFECT + 2004-02-26 06:00:26 + issues@ofbiz + + + + All + When you create a new request and you don't fill correctly all the fields no error messages are shown + + + jacopo + 2004-02-26 06:00:26 + When you create a new request and you don't fill correctly all the fields no +error messages are shown. + + + jacopo + 2005-02-09 02:31:42 + Fixed after the refactoring to screen widget. + + + ajzeneski + 2004-03-18 12:01:30 + version + Version + Pre3.0.0 + CVS + + + jacopo + 2005-02-09 02:31:42 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2005-02-09 02:31:42 + resolution + Resolution + + FIXED + + + + 34 + RESOLVED + P5 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120838 + Order + jacopo + not determined + PATCH + 2004-02-26 06:11:14 + issues@ofbiz + + + + All + Little JavaScript in "find returns" when lookup fields are hidden + + + jacopo + 2004-02-26 06:11:14 + Little JavaScript in "find returns" when lookup fields are hidden + +Patch for findReturns.ftl is attached. + + + jacopo + 2004-02-26 06:11:49 + Created an attachment (id=8) +Patch for findReturn.ftl in UOF + + + + jonesde + 2004-03-01 11:18:49 + Your changes are in CVS. Thanks for sending that over. + + + text/plain + 8 + 2004-02-26 06:11:49 + Patch for findReturn.ftl in UOF + 1 + findReturn.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/8/findReturn.ftl.patch + + + jacopo + 2004-02-26 06:11:49 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=8) +Patch for findReturn.ftl in UOF + + + + jonesde + 2004-03-01 11:18:49 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 11:18:49 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:08:38 + version + Version + Pre3.0.0 + CVS + + + + 35 + RESOLVED + P1 + FIXED + Components + CVS + All + ajzeneski + 20040308103928 + E-Commerce + razorb + not determined + DEFECT + 2004-02-26 06:18:48 + issues@ofbiz + + http://localhost:8080/ecommerce/control/product/~category_id=100/~product_id=GZ-1006 + + All + Single variant combo doesn't select properly + + + razorb + 2004-02-26 06:18:48 + Using the drop down menu to select a variantion i.e. LGPL does not set the +selection on the menu. Using the swatch/images does correctly set the menu +selection and allows adding to the basket. + +I suspect a little JS error somewhere for single variant items. + + + jonesde + 2004-02-26 06:52:49 + +I just reproduced this against the latest code base, appears to still be an issue with single feature type +virtual products. + + + ajzeneski + 2004-03-08 09:54:51 + Updated since this is a CVS bug and updated status + + + ajzeneski + 2004-03-08 10:39:28 + fixed JS bugs in productdetail + + + jonesde + 2004-02-26 06:52:48 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + jonesde + 2004-02-26 06:52:48 + priority + Priority + P3 + P1 + + + ajzeneski + 2004-03-08 09:54:51 + issue_status + Status + NEW + STARTED + + + ajzeneski + 2004-03-08 09:54:51 + version + Version + Pre3.0.0 + CVS + + + ajzeneski + 2004-03-08 10:39:28 + issue_status + Status + STARTED + RESOLVED + + + ajzeneski + 2004-03-08 10:39:28 + resolution + Resolution + + FIXED + + + + 36 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120846 + Product + jacopo + not determined + PATCH + 2004-02-26 23:17:51 + issues@ofbiz + + + + All + Facility Manager: in 'inventory receive' the type of order is not checked and it's possible to receive a sales order if you enter its id in the 'purchase order id' field + + + jacopo + 2004-02-26 23:17:51 + Facility Manager: in 'inventory receive' the type of order is not checked and +it's possible to receive a sales order if you enter its id in the 'purchase +order id' field. + +This is the patch in UOF for the receiveInventory.bsh file (pay attention that +some days ago I've submitted a patch for the same file against the same CVS +release): + +Index: ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh +=================================================================== +RCS file: /cvs/ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh,v +retrieving revision 1.4 +diff -u -r1.4 receiveInventory.bsh +--- ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh 25 Aug 2003 15:28:00 -0000 + 1.4 ++++ ofbiz/components/product/webapp/facility/WEB- +INF/actions/inventory/receiveInventory.bsh 27 Feb 2004 07:17:08 -0000 +@@ -43,6 +43,9 @@ + purchaseOrder = null; + if (purchaseOrderId != null && purchaseOrderId.length() > 0) { + purchaseOrder = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap +("orderId", purchaseOrderId)); ++ if (purchaseOrder != null && !"PURCHASE_ORDER".equals +(purchaseOrder.getString("orderTypeId"))) { ++ purchaseOrder = null; ++ } + } + + product = null; + + + jonesde + 2004-02-28 11:58:13 + The patch is in CVS. + + + jonesde + 2004-02-28 11:58:13 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-02-28 11:58:13 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:08:46 + version + Version + Pre3.0.0 + CVS + + + + 37 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120856 + Product + jacopo + not determined + DEFECT + 2004-02-27 02:05:25 + issues@ofbiz + + + + All + Facility Manager: error message when trying to confirm stock moves needed. + + + jacopo + 2004-02-27 02:05:25 + In the Facility Manager, int the PickList -> Stock Moves page, if I try to +confirm the "stock moves needed" proposed by the system I get the following +error: + +Error calling event: org.ofbiz.content.webapp.event.EventHandlerException: No +rows to process + +And the movements are not performed. + + + jonesde + 2004-03-01 17:22:23 + This is caused by some code that was added to display warning messages that wiped out the rowCount +variable. The warning message loop now uses a variable names messageCount. + + + jonesde + 2004-03-01 17:22:23 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 17:22:23 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:08:56 + version + Version + Pre3.0.0 + CVS + + + + 38 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120905 + Product + jacopo + not determined + PATCH + 2004-02-27 02:23:36 + issues@ofbiz + + + + All + Facility Manager: in Edit shipment -> items tab, a wrong link to EditProduct page caused a controller error. + + + jacopo + 2004-02-27 02:23:36 + Facility Manager: in Edit shipment -> items tab, a wrong link to EditProduct +page caused a controller error. + +Patch for EditShipmentItems.ftl file is attached. + + + jacopo + 2004-02-27 02:24:16 + Created an attachment (id=9) +Patch for EditShipmentItems.ftl in UOF + + + + jonesde + 2004-03-01 07:38:50 + Your changes are in CVS. Thanks for the patch Jacopo. + + + text/plain + 9 + 2004-02-27 02:24:16 + Patch for EditShipmentItems.ftl in UOF + 1 + EditShipmentItems.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/9/EditShipmentItems.ftl.patch + + + jacopo + 2004-02-27 02:24:16 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=9) +Patch for EditShipmentItems.ftl in UOF + + + + jonesde + 2004-03-01 07:38:50 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 07:38:50 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:09:05 + version + Version + Pre3.0.0 + CVS + + + + 39 + NEW + P2 + + Components + CVS + All + issues@ofbiz + 20040318120141 + Order + jacopo + not determined + DEFECT + 2004-02-27 04:05:34 + issues@ofbiz + + + + All + SapDB problem when displaying order task list assigned to user role + + + jacopo + 2004-02-27 04:05:34 + SapDB problem when displaying order task list assigned to user role: +if more than one order is assigned to user role, in "Order List" page the +orders are shown 5 times! +If only one order is assigned to the user role, the order is shown well (1 +time). + +See picture attached. + + + jacopo + 2004-02-27 04:07:00 + Created an attachment (id=10) +Bug example showing two orders waiting approval duplicated 5 times. + + + + image/gif + 10 + 2004-02-27 04:07:00 + Bug example showing two orders waiting approval duplicated 5 times. + + order_list_bug.GIF + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/10/order_list_bug.GIF + + + jacopo + 2004-02-27 04:07:00 + attachments.thedata + Attachment Data + + Created an attachment (id=10) +Bug example showing two orders waiting approval duplicated 5 times. + + + + ajzeneski + 2004-03-18 12:01:41 + version + Version + Pre3.0.0 + CVS + + + + 40 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20050209023003 + WorkEffort + jacopo + not determined + DEFECT + 2004-02-27 07:27:15 + issues@ofbiz + + + + All + Party lookup with empty fields returns only one person repeated many times (= number of persons). + + + jacopo + 2004-02-27 07:27:15 + If, in Party lookup, you perform a lookup with empty fields (all records), +returns only one person repeated many times (= number of persons). +I suspect that the problem is in the "lookupParty" simple method in common +component. + + + jacopo + 2005-02-09 02:30:03 + Fixed changing the way the lookup is implemented (see Jira issue OFBIZ-114). + + + ajzeneski + 2004-03-18 12:01:50 + version + Version + Pre3.0.0 + CVS + + + jacopo + 2005-02-09 02:30:03 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2005-02-09 02:30:03 + resolution + Resolution + + FIXED + + + + 41 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120912 + Product + jacopo + not determined + PATCH + 2004-02-27 08:53:04 + issues@ofbiz + + + + All + Facility Manager: in Edit shipment -> items tab, a wrong link to EditProduct caused a controller error (same as issue #38) + + + jacopo + 2004-02-27 08:53:04 + Facility Manager: in View shipment tab, a wrong link to EditProduct +page caused a controller error (same as issue #38). + +Patch for ViewShipmentItemInfo.ftl file is attached. + + + jacopo + 2004-02-27 08:53:50 + Created an attachment (id=11) +Patch for file ViewShipmentItemInfo.ftl in UOF + + + + jonesde + 2004-03-01 07:41:15 + Your changes are now in CVS. Thanks for sending those over Jacopo. + + + text/plain + 11 + 2004-02-27 08:53:50 + Patch for file ViewShipmentItemInfo.ftl in UOF + 1 + ViewShipmentItemInfo.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/11/ViewShipmentItemInfo.ftl.patch + + + jacopo + 2004-02-27 08:53:50 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=11) +Patch for file ViewShipmentItemInfo.ftl in UOF + + + + jonesde + 2004-03-01 07:41:15 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 07:41:15 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:09:12 + version + Version + Pre3.0.0 + CVS + + + + 42 + RESOLVED + P4 + WONTFIX + Components + CVS + All + ajzeneski + 20040630193328 + Product + jacopo + not determined + DEFECT + 2004-02-28 22:34:42 + issues@ofbiz + + + + All + In shipment, the following error message appears: "Applet Package Weight Reader notinited" + + + jacopo + 2004-02-28 22:34:42 + In shipment, the following error message appears: "Applet Package Weight Reader +notinited". +I think the problem is caused by the fact that the class ShipmentScaleApplet is +not built in the ant task. +Was this done intentionally? (I think this applet tries to connect to a scale +device connected to a serial port and so probably this could cause some +problems...). + + + ajzeneski + 2004-03-08 17:39:52 + reassigned; I will comment out the applet code until this is finished + + + ajzeneski + 2004-06-30 19:33:28 + The applet is going to be replaced with a think client shipment station UI + + + ajzeneski + 2004-03-08 17:39:52 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-03-18 12:01:59 + version + Version + Pre3.0.0 + CVS + + + ajzeneski + 2004-06-30 19:33:28 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-06-30 19:33:28 + resolution + Resolution + + WONTFIX + + + + 43 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040318120921 + E-Commerce + jacopo + not determined + PATCH + 2004-02-28 22:46:49 + issues@ofbiz + + + + All + In "Create Return", select-all checkbox doesn't work due to wrong form name. + + + jacopo + 2004-02-28 22:46:49 + In "Create Return", select-all checkbox doesn't work due to wrong form name. + +Patch attached for requestreturn.ftl in Unified Output Format. + + + jacopo + 2004-02-28 22:47:40 + Created an attachment (id=12) +Patch attached for requestreturn.ftl in UOF. + + + + jonesde + 2004-03-01 07:48:30 + Your changes are in CVS. Thanks for fixing that. + + + text/plain + 12 + 2004-02-28 22:47:39 + Patch attached for requestreturn.ftl in UOF. + 1 + requestreturn.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/12/requestreturn.ftl.patch + + + jacopo + 2004-02-28 22:47:40 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=12) +Patch attached for requestreturn.ftl in UOF. + + + + jonesde + 2004-03-01 07:48:30 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-01 07:48:30 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-18 12:09:21 + version + Version + Pre3.0.0 + CVS + + + + 44 + NEW + P4 + + Components + CVS + All + issues@ofbiz + 20040229030013 + Product + jacopo + not determined + ENHANCEMENT + 2004-02-29 03:00:13 + issues@ofbiz + + + + All + Packages: ShipmentPackage's weight automatically updated when ShipmentPackageContent entries are added/deleted (weight taken from the Product entity). + + + jacopo + 2004-02-29 03:00:13 + Packages: ShipmentPackage's weight automatically updated when +ShipmentPackageContent entries are added/deleted (weight taken from the Product +entity). + + + + 45 + RESOLVED + P1 + FIXED + Components + CVS + All + issues@ofbiz + 20040301155709 + Order + jacopo + not determined + DEFECT + 2004-02-29 06:17:33 + issues@ofbiz + + + + All + In orderview page, if you select the "QuickShip order link" you get a controller error. + + + jacopo + 2004-02-29 06:17:33 + In orderview page (/ordermgr/control/orderview), if you select the "QuickShip +order link" you get a controller error: + +org.ofbiz.content.webapp.control.RequestHandlerException: Unknown request +[quickShipOrderMultiFacility]; this request does not exist or cannot be called +directly. + + + jonesde + 2004-03-01 12:11:07 + I'll get on this... + + + jonesde + 2004-03-01 15:57:09 + Changed the default behavior for this; also added request-map and service defs for the quick ship from +multi facilites. + + + jonesde + 2004-03-01 12:11:07 + issue_status + Status + NEW + STARTED + + + jonesde + 2004-03-01 15:57:09 + issue_status + Status + STARTED + RESOLVED + + + jonesde + 2004-03-01 15:57:09 + resolution + Resolution + + FIXED + + + + 46 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040806152631 + Product + jacopo + not determined + PATCH + 2004-03-02 05:13:01 + issues@ofbiz + + + + All + Patch for multiple inventory facility reservation + + + jacopo + 2004-03-02 05:13:01 + Patch for multiple inventory facility reservation: +the intent of this is to perform reservation only if all items are available in +one facility: that, I think, is the declared behaviour, and what is checked +with the isInventoryAvailable method. + + + jacopo + 2004-03-02 05:13:49 + Created an attachment (id=13) +Patch for ProductStoreWorker.java in UOF + + + + jonesde + 2004-08-06 15:26:31 + Thanks Jacopo, your patch is now in CVS. + + + text/plain + 13 + 2004-03-02 05:13:49 + Patch for ProductStoreWorker.java in UOF + 1 + ProductStoreWorker.java.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/13/ProductStoreWorker.java.patch + + + jacopo + 2004-03-02 05:13:49 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=13) +Patch for ProductStoreWorker.java in UOF + + + + ajzeneski + 2004-03-18 12:02:10 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-08-06 15:26:31 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-08-06 15:26:31 + resolution + Resolution + + FIXED + + + + 47 + RESOLVED + P3 + FIXED + Components + CVS + All + ajzeneski + 20040323221326 + Product + jacopo + not determined + PATCH + 2004-03-02 06:06:51 + issues@ofbiz + + + + All + Facility -> Shipment: patch for JavaScript error introduced during i18n process. + + + jacopo + 2004-03-02 06:06:51 + Facility -> Shipment: patch for JavaScript error introduced during i18n process. + + + jacopo + 2004-03-02 06:07:51 + Created an attachment (id=14) +Patch for AddItemsFromOrder.ftl file in UOF + + + + ajzeneski + 2004-03-08 17:42:45 + reassigned + + + jacopo + 2004-03-23 22:13:26 + This bug has been fixed by the code for the new feature regarding shipment +plans. + + + text/plain + 14 + 2004-03-02 06:07:51 + Patch for AddItemsFromOrder.ftl file in UOF + 1 + AddItemsFromOrder.ftl.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/14/AddItemsFromOrder.ftl.patch + + + jacopo + 2004-03-02 06:07:51 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=14) +Patch for AddItemsFromOrder.ftl file in UOF + + + + ajzeneski + 2004-03-08 17:42:45 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-03-18 12:02:18 + version + Version + Pre3.0.0 + CVS + + + jacopo + 2004-03-23 22:13:26 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-03-23 22:13:26 + resolution + Resolution + + FIXED + + + + 48 + NEW + P2 + + Components + CVS + All + issues@ofbiz + 20040318120228 + Product + jacopo + not determined + DEFECT + 2004-03-02 06:28:37 + issues@ofbiz + + + + All + Facility -> Shipment -> Items: delete shipment item link returns a constraint violation error. + + + jacopo + 2004-03-02 06:28:37 + Facility -> Shipment -> Items: delete shipment item link returns a constraint +violation error: + +The following errors occurred: +ERROR: Could not complete the Delete ShipmentItem process [problem removing the +lookedUpValue value: Exception while deleting the following entity: +[GenericEntity:ShipmentItem][shipmentId,10010(java.lang.String)] +[shipmentItemSeqId,00001(java.lang.String)] (SQL Exception while executing the +following:DELETE FROM SHIPMENT_ITEM WHERE SHIPMENT_ID=? AND +SHIPMENT_ITEM_SEQ_ID=? (Integrity constraint violation ITEM_ISS_SHITM table: +ITEM_ISSUANCE in statement [DELETE FROM SHIPMENT_ITEM WHERE SHIPMENT_ID=? AND +SHIPMENT_ITEM_SEQ_ID=?]))] + +In my opinion, the delete shipment item link should perform something like this +(instead of barely trying to remove the ShipmentItem entry): it should remove +the item issuances, recreate the reservations and then remove the shipment item. + + + ajzeneski + 2004-03-18 12:02:28 + version + Version + Pre3.0.0 + CVS + + + + 49 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040528001027 + Product + jacopo + not determined + PATCH + 2004-03-03 03:11:18 + issues@ofbiz + + + + All + Facility -> Receive PO: at now it's possible to receive multiple times the same shipment items. This is a partial patch for this problem. + + + jacopo + 2004-03-03 03:11:18 + Facility -> Receive PO: at now it's possible to receive multiple times the same +shipment items. This is a partial patch for this problem. With the attached +patch the shipment already delivered (or cancelled) are not shown (and so the +user cannot receive them again). +In order to completely fix this issue the best solution is, in my opinion, to +automatically update the shipment status to "delivered" when the user receives +an item: this could be done modifying the service +group "receiveInventoryProduct" by adding to it the "updateShipment" service +(to update the shipment status). However I'm going to add this comments to a +new "DEFECT" issue. + + + jacopo + 2004-03-03 03:12:11 + Created an attachment (id=15) +Patch for file receiveInventory.bsh in UOF. + + + + jonesde + 2004-05-28 00:10:27 + This is now in CVS, thanks for sending it over Jacopo. + + + text/plain + 15 + 2004-03-03 03:12:11 + Patch for file receiveInventory.bsh in UOF. + 1 + receiveInventory.bsh.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/15/receiveInventory.bsh.patch + + + jacopo + 2004-03-03 03:12:11 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=15) +Patch for file receiveInventory.bsh in UOF. + + + + ajzeneski + 2004-03-18 12:02:37 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-05-28 00:10:27 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-28 00:10:27 + resolution + Resolution + + FIXED + + + + 50 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040528000924 + Product + jacopo + not determined + DEFECT + 2004-03-03 03:15:23 + issues@ofbiz + + + + All + Facility -> Receive PO: at now it's possible to receive multiple times the same shipment items. + + + jacopo + 2004-03-03 03:15:24 + Facility -> Receive PO: at now it's possible to receive multiple times the same +shipment items. +This problem was partially fixed by the patch attached to issue #49. +With that patch the shipment already delivered (or cancelled) are not shown +(and so the user cannot receive them again). +In order to completely fix this issue the best solution is, in my opinion, to +automatically update the shipment status to "delivered" when the user receives +an item: this could be done modifying the service +group "receiveInventoryProduct" by adding to it the "updateShipment" service +(to update the shipment status). However I'm going to add this comments to a +new "DEFECT" issue. + + + jonesde + 2004-05-28 00:09:24 + The patch is in, now just need to update the shipment status as mentioned in the description. + + + ajzeneski + 2004-03-18 12:02:49 + version + Version + Pre3.0.0 + CVS + + + + 51 + RESOLVED + P3 + REMIND + Base + CVS + All + issues@ofbiz + 20040811004716 + Startup + jacopo + not determined + DEFECT + 2004-03-03 06:37:30 + issues@ofbiz + + + + All + Several SapDB error messages are generated at startup when entities are created. + + + jacopo + 2004-03-03 06:37:30 + Several SapDB error messages are generated at startup when entities are created. +The messages appear during the indices' generation phase, not for all entities +(maybe 5-10%); here is an example: + +147042[ DatabaseUtil.java:319:ERROR] Could not create foreign key indices +for entity "EftAccount": SQL Exception while executing the following: +CREATE INDEX EFTACCT_PMETH ON EFT_ACCOUNT (PAYMENT_METHOD_ID) +Error was: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-7055] (at 44): +Column(s) already indexed:EFTACCT_PMETH +SQL Exception while executing the following: +CREATE INDEX EFTACCT_PADDR ON EFT_ACCOUNT (CONTACT_MECH_ID) +Error was: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-7055] (at 44): +Column(s) already indexed:EFTACCT_PADDR + + + jacopo + 2004-08-11 00:47:16 + I've created a new issue (OFBIZ-1) for this in Jira; in it you will find a lot +of details. + + + + ajzeneski + 2004-03-18 12:03:00 + version + Version + Pre3.0.0 + CVS + + + jacopo + 2004-08-11 00:47:16 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-08-11 00:47:16 + resolution + Resolution + + REMIND + + + + 52 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040308121509 + Order + jacopo + not determined + DEFECT + 2004-03-04 03:14:08 + issues@ofbiz + + + + All + Billing accounts selectable by users during order entry are not correctly filtered out. + + + jacopo + 2004-03-04 03:14:08 + Billing accounts selectable by users as payment methods during order entry are +not correctly filtered out: removed billing accounts are also shown (i.e. +billing accounts with thru date < now). + + + ajzeneski + 2004-03-08 12:15:09 + Billing accounts are now filtered by date so expired accounts no longer show on order manager order +entry and the ecommerce checkout pages + + + ajzeneski + 2004-03-08 12:15:09 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-03-08 12:15:09 + resolution + Resolution + + FIXED + + + ajzeneski + 2004-03-08 12:15:09 + version + Version + Pre3.0.0 + CVS + + + + 53 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040528010450 + Product + jacopo + not determined + DEFECT + 2004-03-05 06:01:05 + issues@ofbiz + + + + All + In Shipment: it's possible to issue 0 quantities from AddItemsFormOrder page. + + + jacopo + 2004-03-05 06:01:05 + In Shipment: it's possible to issue 0 quantities from AddItemsFormOrder page +(an ItemIssuance record is created with 0 quantity). +I think this should be avoided by submitting only quantities > 0. + + + jonesde + 2004-05-28 01:04:50 + Now checks to see if quantity is empty or 0 when issuing OIIRs to the shipment. + + + ajzeneski + 2004-03-18 12:03:13 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-05-28 01:04:50 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-28 01:04:50 + resolution + Resolution + + FIXED + + + + 54 + RESOLVED + P1 + FIXED + Components + CVS + All + issues@ofbiz + 20040630124239 + Product + jacopo + not determined + DEFECT + 2004-03-05 06:20:02 + issues@ofbiz + + + + All + In Shipment: if you enter a non numeric value (such as null quantity) in the issue field the program returns a bad error. + + + jacopo + 2004-03-05 06:20:02 + In Shipment: if you enter a non numeric value (such as null quantity) in the +issue field the program returns a bad error. +See also issue#53. +I'm running SapDB and after this error I need to restart OFBiz because in every +page I receive SQL errors like the following: + +Target exception: org.ofbiz.entity.GenericDataSourceException: SQL Exception +occurred on commit (Cannot commit a transactional connection: See JDBC 2.0 +Optional Package Specification section 7.1 (p25)) +BSF info: ..\ofbiz\components\content\webapp\content\WEB- +INF\actions\includes\envsetup.bsh at line: 0 column: 0) + + + ajzeneski + 2004-06-30 12:42:39 + Applied patch which fixes a bug in the service multi event handler + + + ajzeneski + 2004-03-18 12:03:23 + version + Version + Pre3.0.0 + CVS + + + ajzeneski + 2004-06-30 12:42:39 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-06-30 12:42:39 + resolution + Resolution + + FIXED + + + + 55 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040323221851 + Product + jacopo + not determined + DEFECT + 2004-03-05 06:25:34 + issues@ofbiz + + + + All + In shipment, it's possible to issue to shipment items with negative reservations (atp < 0); as a consequence of this, also the inventory items' quantity on hand can be negative. + + + jacopo + 2004-03-05 06:25:34 + I've noticed that, in shipment, it's possible to issue to shipment items with +negative reservations (atp < 0); as a consequence of this, also the inventory +items' quantity on hand can be negative. +In my opinion, in this situation at least a warning message should be +provided. + + + jacopo + 2004-03-23 22:18:51 + In "Order Items" page a new column has been added that tells users if they are +issuing negative reservations and the default issuance value is also +decremented by this quantity. +However is still possible to override this value and force an issuance for a +negative reservation. + + + + + ajzeneski + 2004-03-18 12:03:32 + version + Version + Pre3.0.0 + CVS + + + jacopo + 2004-03-23 22:18:51 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-03-23 22:18:51 + resolution + Resolution + + FIXED + + + + 56 + RESOLVED + P3 + WONTFIX + Components + CVS + PC + issues@ofbiz + 20040308173638 + Party + vivalinux + not determined + PATCH + 2004-03-08 14:07:32 + issues@ofbiz + + http://<ofbiz_root_url>/partymgr/control/findparty + + All + Selecting "Show All Records" displays all names as "(Not selected)" + + + vivalinux + 2004-03-08 14:07:32 + The findparty.bsh constructs a dynamic view tailored to the search fields +submited by the lookupparty form. Since selecting all does not give a hint about +which fields the client is interested in, the findparty.bsh fails to include any +of the name (firstName, lastName, groupName) fields. + +The can be corrected with the patch that follows or handling the select all +records as yet another case. I think, I'll side with simplicity, and sacrify +efficiency .... + +Hope this helps. + + +Index: components/party/webapp/partymgr/WEB-INF/actions/party/findparty.bsh +=================================================================== +RCS file: +/cvs/ofbiz/components/party/webapp/partymgr/WEB-INF/actions/party/findparty.bsh,v +retrieving revision 1.13 +diff -u -r1.13 findparty.bsh +--- components/party/webapp/partymgr/WEB-INF/actions/party/findparty.bsh 27 Jan +2004 19:44:36 -0000 1.13 ++++ components/party/webapp/partymgr/WEB-INF/actions/party/findparty.bsh 8 Mar +2004 22:06:24 -0000 +@@ -100,8 +100,15 @@ + + // default view settings + dynamicView.addMemberEntity("PT", "Party"); ++ dynamicView.addMemberEntity("PG", "PartyGroup"); ++ dynamicView.addMemberEntity("PP", "Person"); + dynamicView.addAlias("PT", "partyId"); + dynamicView.addAlias("PT", "partyTypeId"); ++ dynamicView.addAlias("PG", "groupName"); ++ dynamicView.addAlias("PP", "firstName"); ++ dynamicView.addAlias("PP", "lastName"); ++ dynamicView.addViewLink("PT","PG",true,UtilMisc.toList(new +ModelKeyMap("partyId", "partyId"))); ++ dynamicView.addViewLink("PT","PP",true,UtilMisc.toList(new +ModelKeyMap("partyId", "partyId"))); + dynamicView.addRelation("one-nofk", "", "PartyType", +ModelKeyMap.makeKeyMapList("partyTypeId")); + dynamicView.addRelation("many", "", "UserLogin", +ModelKeyMap.makeKeyMapList("partyId")); + +@@ -143,11 +150,6 @@ + if (groupName != null && groupName.length() > 0) { + paramList = paramList + "&groupName=" + groupName; + +- // modify the dynamic view +- dynamicView.addMemberEntity("PG", "PartyGroup"); +- dynamicView.addAlias("PG", "groupName"); +- dynamicView.addViewLink("PT", "PG", Boolean.FALSE, +ModelKeyMap.makeKeyMapList("partyId")); +- + // add the expr + andExprs.add(new EntityExpr("groupName", true, EntityOperator.LIKE, +"%"+groupName+"%", true)); + } +@@ -160,14 +162,6 @@ + firstName = request.getParameter("firstName"); + lastName = request.getParameter("lastName"); + +- // modify the dynamic view +- if ((firstName != null && firstName.length() > 0) || (lastName != null && +lastName.length() > 0)) { +- dynamicView.addMemberEntity("PE", "Person"); +- dynamicView.addAlias("PE", "firstName"); +- dynamicView.addAlias("PE", "lastName"); +- dynamicView.addViewLink("PT", "PE", Boolean.FALSE, +ModelKeyMap.makeKeyMapList("partyId")); +- } +- + // filter on firstName + if (firstName != null && firstName.length() > 0) { + paramList = paramList + "&firstName=" + firstName; +@@ -319,6 +313,12 @@ + List orderBy = new ArrayList(); + fieldsToSelect.add("partyId"); + fieldsToSelect.add("partyTypeId"); ++ fieldsToSelect.add("firstName"); ++ fieldsToSelect.add("lastName"); ++ fieldsToSelect.add("groupName"); ++ orderBy.add("-partyTypeId"); ++ orderBy.add("lastName"); ++ orderBy.add("groupName"); + + // UserLogin + if (userLoginId != null && userLoginId.length() > 0) { +@@ -327,14 +327,11 @@ + + // Person + if ((firstName != null && firstName.length() > 0) || (lastName != null +&& lastName.length() > 0)) { +- fieldsToSelect.add("firstName"); +- fieldsToSelect.add("lastName"); + orderBy.add("lastName"); + orderBy.add("firstName"); + } + // PartyGroup + if (groupName != null && groupName.length() > 0) { +- fieldsToSelect.add("groupName"); + orderBy.add("groupName"); + } + // RoleType +Index: components/party/webapp/partymgr/party/findparty.ftl +=================================================================== +RCS file: /cvs/ofbiz/components/party/webapp/partymgr/party/findparty.ftl,v +retrieving revision 1.10 +diff -u -r1.10 findparty.ftl +--- components/party/webapp/partymgr/party/findparty.ftl 1 Mar 2004 14:43:27 +-0000 1.10 ++++ components/party/webapp/partymgr/party/findparty.ftl 8 Mar 2004 22:06:24 -0000 +@@ -212,13 +212,12 @@ + </table> + <input type="image" src="/images/spacer.gif" +onClick="javascript:document.lookupparty.submit();"> + </form> +-<#if requestParameters.hideFields?default("N") != "Y"> + <script language="JavaScript"> + <!--// + document.lookupparty.partyId.focus(); + //--> + </script> +-</#if> ++ + <#if partyList?exists> + <br> + <table border=0 width='100%' cellspacing='0' cellpadding='0' +class='boxoutside'> +@@ -292,21 +291,13 @@ + </td> + <td> + <div class="tabletext"> +- <#if partyRow.containsKey("lastName")> + <#if partyRow.lastName?has_content> + ${partyRow.lastName}<#if +partyRow.firstName?has_content>, ${partyRow.firstName}</#if> +- <#else> +- (No Name Found) +- </#if> +- <#elseif partyRow.containsKey("groupName")> +- <#if partyRow.groupName?has_content> ++ <#elseif partyRow.groupName?has_content> + ${partyRow.groupName} + <#else> +- (No Name Found) ++ (Not Selected) + </#if> +- <#else> +- (Not Selected) +- </#if> + </td> + <#if extInfo?default("") == "P"> + <td><div +class="tabletext">${partyRow.postalCode?if_exists}</div></td> + + + ajzeneski + 2004-03-08 17:36:38 + This page has been changed from using the left joins in the dynamic view. Using left joins performs too +poorly for actual use. This patch has been rejected; a new task will be opened for fixing the problem of +the name not being displayed. + + + ajzeneski + 2004-03-08 17:36:38 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-03-08 17:36:38 + resolution + Resolution + + WONTFIX + + + + 57 + NEW + P4 + + Components + CVS + All + ajzeneski + 20040308174641 + Party + ajzeneski + not determined + DEFECT + 2004-03-08 17:36:18 + issues@ofbiz + + + + All + Find Party - Show all does not show name + + + ajzeneski + 2004-03-08 17:36:18 + The name is not displayed when selecting show all in the party manager. + + + ajzeneski + 2004-03-08 17:46:41 + reassigned + + + ajzeneski + 2004-03-08 17:46:41 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + + 58 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040308185722 + Content + vivalinux + not determined + ENHANCEMENT + 2004-03-08 18:57:22 + issues@ofbiz + + + + All + Inherited hidden fields overide child fields when they have use-when + + + vivalinux + 2004-03-08 18:57:22 + In working with inherited forms I noticed that hidden fields are hard +to override if the overriding field has a use-when attribute: + + Since the HtmlFormRenderer gives precedence to hidden fields, and new +fields with "use-when" are only placed in front of existing fields +but not merged with, the resulting behavior is that hidden fields of +parent forms always get rendered even when the use-when condition is +true. This causes the hidden field to take precedence over the user +input when the form is submitted. + + Here is a posible solution: + +Index: components/content/src/org/ofbiz/content/widget/form/ModelForm.java +=================================================================== +RCS file: +/usr/local/cvsrepos/newriverbiz/components/content/src/org/ofbiz/content/widget/form/ModelForm.java,v +retrieving revision 1.1.1.4 +diff -u -r1.1.1.4 ModelForm.java +--- components/content/src/org/ofbiz/content/widget/form/ModelForm.java +2004/01/08 14:19:55 1.1.1.4 ++++ components/content/src/org/ofbiz/content/widget/form/ModelForm.java +2004/01/29 20:23:20 +@@ -277,15 +277,25 @@ + public ModelFormField addUpdateField(ModelFormField modelFormField) { + if (!modelFormField.isUseWhenEmpty()) { + // is a conditional field, add to the List but don't worry about +the Map +- //for adding to list, see if there is another field with that name +in the list and if so, put it before that one ++ //for adding to list, see if there is another field with that name ++ //in the list and if so, put it before that one + boolean inserted = false; + for (int i = 0; i < this.fieldList.size(); i++) { + ModelFormField curField = (ModelFormField) this.fieldList.get(i); ++ // BUG FIX: parent hidden fields are left and rendered even when they ++ // are overriden with fields that have a use-when + if (curField.getName() != null && +curField.getName().equals(modelFormField.getName())) { +- this.fieldList.add(i, modelFormField); +- inserted = true; +- break; ++ if ((curField.getFieldInfo().getFieldType() != +ModelFormField.FieldInfo.HIDDEN) && ++ (curField.getFieldInfo().getFieldType() != ModelFormField.FieldInfo.IGNORED)) { ++ this.fieldList.add(i, modelFormField); ++ inserted = true; ++ break; ++ } else { ++ curField.mergeOverrideModelFormField(modelFormField); ++ break; ++ } + } ++ //End of BUG fix + } + if (!inserted) { + this.fieldList.add(modelFormField); + + + + 59 + NEW + P1 + + Components + CVS + All + issues@ofbiz + 20040318120354 + Workflow + mbennani + not determined + DEFECT + 2004-03-09 06:47:17 + issues@ofbiz + + + + All + Serious Problem in Sub-flow Implementation: in-Memory Requester Used!! + + + mbennani + 2004-03-09 06:47:17 + I am running ofbiz almost v.3 :-) (image from late 2003 from cvs). +(subflow implementation did not change since 1.2 anyways, I believe) + +Quick Description: +------------------ +Subflows are using the in-memory requester object which +does not persist over server re-starts. This is serious one guys. + +More Description (Scenario): +--------------------------- +I have a main process with 3 steps(step1,step2-subflow,step3). A subflow +process being the second step. This second step calls another process that I +call sub. sub has 2 simple steps (substep1,substep2). + +Now, in normal time (i.e no server restart), it all works fine and my main +process runs fine, calls the subflow, subflow runs, the call returns and my +step3 of the main process runs successfully and main completes fine. + +The problem arises when say I run step 1 of main process, subflow gets +initiated, substep1 is executed, and before substep2 is executed, I stop the +server (faking a server problem..., connection lost...whatever). +When I restart the server, the subflow resumes at substep2 which executes fine, +and eventually completes the subflow process. But, step-subflow activity in the +workeffort table still shows WF_RUNNING. Therefore, my main process is hanging +there and will never move along. The waitForResult() is not executed anymore +after server restart. +This is happening in WfActivitySubFlowImplementation on runService. + +Even More Details, code wise, if you want to look at it: +------------------------------------------------------- +In a normal scenario (no server stopped), the runService of +WfActivitySubFlowImplementation eventually calls the runSync in WorkflowEngine +and then waitForResult. I put a system out message in the waiter class and I +can see my message being displayed in the console forever ("waiting..."), until +the subflow process finishes. And that's ok, that's what we want. When the +subflow process finishes, the call is returned back to the runService in +WfActivitySubFlowImplementation() and the setComplete is called, which changes +the status of my step2-subflow activity in the main process to WF_COMPLETED to +advance the main process. It also calls setResults() to propagate the results +from the subflow up to the main process. + +BUT, now if I stop my server during that wait, and restart it the call never +reachs the setComplete nor the setResults, making therefore my main process +unusable anymore. + + + ajzeneski + 2004-03-18 12:03:54 + op_sys + OS/Version + Windows 2000 + All + + + ajzeneski + 2004-03-18 12:03:54 + version + Version + Pre3.0.0 + CVS + + + + 60 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040707152609 + Entity + doogie + not determined + ENHANCEMENT + 2004-03-09 07:09:04 + issues@ofbiz + + + + All + Replace simplistic caching with complex reverse dependency resolver + + + doogie + 2004-03-09 07:09:04 + This patch removes all simple caching from GenericDelegator, and replaces +it with a stand-alone class, that handles all entity cache management. It +uses new features in the entity model, that keeps track of view entities +that are referenced by regular entities. As entities are updated, all +cached lists of views or condition caches are cleared. + +With this patch applied, view entities can be cached, without worry that +they will become stale. Which then allows very complex views to be +created, that emulate complex code patterns, while still allowing for +caching. This can speed up code tremendously. + +Additionally, since cache clearing now works, it almost always makes more +sense to use the cache variation of the methods. + + + doogie + 2004-03-09 07:14:24 + Created an attachment (id=16) +The patch + + + + doogie + 2004-04-29 15:44:46 + This patch is on hold, until some other patches are committed. Some of them +need to have bugs filed, which I am working on. Plus, this patch needs to be +updated to the latest code base(not a big task, done locally). + + + doogie + 2004-07-07 15:26:09 + This is now in cvs. + + + text/plain + 16 + 2004-03-09 07:14:24 + The patch + 1 + EntityCache.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/16/EntityCache.patch + + + doogie + 2004-03-09 07:14:24 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=16) +The patch + + + + doogie + 2004-04-29 15:44:46 + issue_status + Status + NEW + STARTED + + + doogie + 2004-04-29 16:16:01 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-07-07 15:26:09 + issue_status + Status + STARTED + RESOLVED + + + doogie + 2004-07-07 15:26:09 + resolution + Resolution + + FIXED + + + + 61 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422222023 + Product + doogie + not determined + FEATURE + 2004-03-09 07:18:26 + issues@ofbiz + + + + All + Allow for easier extension of this class. + + + doogie + 2004-03-09 07:18:26 + This patch makes a protected writeValues() method, which allows sub-classes +to redirect the output to other places, as needed. + + + doogie + 2004-03-09 07:18:49 + Created an attachment (id=17) +The patch + + + + doogie + 2004-04-22 22:20:23 + Applied the patch. + + + text/plain + 17 + 2004-03-09 07:18:49 + The patch + 1 + EntitySaxReader-extension.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/17/EntitySaxReader-extension.patch + + + doogie + 2004-03-09 07:18:49 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=17) +The patch + + + + doogie + 2004-04-22 22:20:23 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:20:23 + resolution + Resolution + + FIXED + + + + 62 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422223418 + Entity + doogie + not determined + FEATURE + 2004-03-09 07:34:07 + issues@ofbiz + + + + All + Allow for UPPER() and LOWER() sorting + + + doogie + 2004-03-09 07:34:07 + See $summary. + + + doogie + 2004-03-09 07:34:26 + Created an attachment (id=18) +The patch. + + + + doogie + 2004-04-22 22:34:18 + Applied patch. + + + text/plain + 18 + 2004-03-09 07:34:26 + The patch. + 1 + EntityUtil-UPPER_LOWER.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/18/EntityUtil-UPPER_LOWER.patch + + + doogie + 2004-03-09 07:34:26 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=18) +The patch. + + + + doogie + 2004-04-22 22:34:18 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:34:18 + resolution + Resolution + + FIXED + + + + 63 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040429160209 + Entity + doogie + not determined + FEATURE + 2004-03-09 07:36:19 + issues@ofbiz + + + + All + Add support for turning off schemas completely + + + doogie + 2004-03-09 07:36:19 + See $summary. + + + doogie + 2004-03-09 07:36:42 + Created an attachment (id=19) +The patch + + + + doogie + 2004-04-29 16:02:09 + Applied this patch. + + + text/plain + 19 + 2004-03-09 07:36:42 + The patch + 1 + use-schemas.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/19/use-schemas.patch + + + doogie + 2004-03-09 07:36:42 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=19) +The patch + + + + doogie + 2004-04-29 16:02:09 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-29 16:02:09 + resolution + Resolution + + FIXED + + + + 64 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422222810 + Entity + doogie + not determined + FEATURE + 2004-03-09 07:43:55 + issues@ofbiz + + + + All + Make the code look like the rest of the file. + + + doogie + 2004-03-09 07:43:55 + See $summary. + + + doogie + 2004-03-09 07:44:21 + Created an attachment (id=20) +The patch + + + + doogie + 2004-04-22 22:28:10 + Applied patch. + + + text/plain + 20 + 2004-03-09 07:44:21 + The patch + 1 + SqlJdbcUtil-Cast.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/20/SqlJdbcUtil-Cast.patch + + + doogie + 2004-03-09 07:44:21 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=20) +The patch + + + + doogie + 2004-04-22 22:28:10 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:28:10 + resolution + Resolution + + FIXED + + + + 65 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040429163146 + Entity + doogie + not determined + ENHANCEMENT + 2004-03-09 07:46:14 + issues@ofbiz + + + + All + Add java.util.Date support. + + + doogie + 2004-03-09 07:46:14 + See $summary. + + + doogie + 2004-03-09 07:46:39 + Created an attachment (id=21) +The patch + + + + doogie + 2004-04-29 16:31:46 + Applied the patch. + + + text/plain + 21 + 2004-03-09 07:46:39 + The patch + 1 + SqlJdbcUtil-Java_Util_Date.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/21/SqlJdbcUtil-Java_Util_Date.patch + + + doogie + 2004-03-09 07:46:39 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=21) +The patch + + + + doogie + 2004-04-29 16:16:03 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 16:31:45 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-29 16:31:45 + resolution + Resolution + + FIXED + + + + 66 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422221943 + Entity + doogie + not determined + FEATURE + 2004-03-09 07:47:46 + issues@ofbiz + + + + All + Use UtilValidate.isNotEmpty. + + + doogie + 2004-03-09 07:47:46 + See $summary. + + + doogie + 2004-03-09 07:48:06 + Created an attachment (id=22) +The patch + + + + doogie + 2004-04-22 22:19:43 + Applied patch, which uses UtilValidate.isNotEmpty in SqlJdbcUtil. + + + text/plain + 22 + 2004-03-09 07:48:06 + The patch + 1 + SqlJdbcUtil-UtilValidate.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/22/SqlJdbcUtil-UtilValidate.patch + + + doogie + 2004-03-09 07:48:06 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=22) +The patch + + + + doogie + 2004-04-22 22:19:43 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:19:43 + resolution + Resolution + + FIXED + + + + 67 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040429161604 + Entity + doogie + not determined + ENHANCEMENT + 2004-03-09 07:49:20 + issues@ofbiz + + + + All + Add support for <constraint> on relations and views. + + + doogie + 2004-03-09 07:49:20 + When defining a view or relation, you can now constrain the returned +values to those that match an EntityCondition. This is really helpful +for complex views. + + + doogie + 2004-03-09 07:49:42 + Created an attachment (id=23) +The patch + + + + text/plain + 23 + 2004-03-09 07:49:42 + The patch + 1 + model-constraint.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/23/model-constraint.patch + + + doogie + 2004-03-09 07:49:42 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=23) +The patch + + + + doogie + 2004-04-29 16:16:04 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + + 68 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040423074926 + Entity + doogie + not determined + FEATURE + 2004-03-09 07:51:20 + issues@ofbiz + + + + All + Use a NumberFormat for casting number objects to strings. + + + doogie + 2004-03-09 07:51:20 + See $summary. + + + doogie + 2004-03-09 07:51:40 + Created an attachment (id=24) +The patch + + + + doogie + 2004-04-23 07:49:26 + Applied patch. + + + text/plain + 24 + 2004-03-09 07:51:40 + The patch + 1 + GenericEntity-NumberFormat.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/24/GenericEntity-NumberFormat.patch + + + doogie + 2004-03-09 07:51:40 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=24) +The patch + + + + doogie + 2004-04-23 07:49:26 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-23 07:49:26 + resolution + Resolution + + FIXED + + + + 69 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040423075223 + Entity + doogie + not determined + FEATURE + 2004-03-09 07:52:20 + issues@ofbiz + + + + All + Add addToXmlElement method + + + doogie + 2004-03-09 07:52:20 + See $summary. + + + doogie + 2004-03-09 07:52:42 + Created an attachment (id=25) +The patch + + + + doogie + 2004-04-23 07:52:23 + Applied patch. + + + text/plain + 25 + 2004-03-09 07:52:42 + The patch + 1 + GenericEntity-addToXmlElement.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/25/GenericEntity-addToXmlElement.patch + + + doogie + 2004-03-09 07:52:42 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=25) +The patch + + + + doogie + 2004-04-23 07:52:23 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-23 07:52:23 + resolution + Resolution + + FIXED + + + + 70 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422221512 + Entity + doogie + not determined + DEFECT + 2004-03-09 07:54:40 + issues@ofbiz + + + + All + Fix modelEntity dereferencing + + + doogie + 2004-03-09 07:54:40 + When GenericEntities have been deserialized, modelEntity will be null. +getModelEntity() should be called, to repopulate it. + + + doogie + 2004-03-09 07:54:57 + Created an attachment (id=26) +The patch + + + + doogie + 2004-04-22 22:15:12 + Applied patch, plus fixed it in a few other areas. + + + text/plain + 26 + 2004-03-09 07:54:57 + The patch + 1 + GenericEntity-getModelEntity.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/26/GenericEntity-getModelEntity.patch + + + doogie + 2004-03-09 07:54:57 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=26) +The patch + + + + doogie + 2004-04-22 22:15:12 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:15:12 + resolution + Resolution + + FIXED + + + + 71 + NEW + P4 + + Components + CVS + All + issues@ofbiz + 20040501214447 + Content + doogie + not determined + ENHANCEMENT + 2004-03-09 07:56:46 + issues@ofbiz + + + + All + Factor out the code + + + doogie + 2004-03-09 07:56:46 + See $summary. + + + doogie + 2004-03-09 07:57:40 + Created an attachment (id=27) +The patch. + + + + doogie + 2004-04-29 19:57:51 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 06:06:43 + Not adding this patch, breaks the Server Stats Since Start page in WebTools, and not totally sure the +cleanup is worth it yet. + + + doogie + 2004-05-01 21:44:47 + I'll fix that page then, and submit a revised patch. + + + text/plain + 27 + 2004-03-09 07:57:40 + The patch. + 1 + ServerHitBin-factor.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/27/ServerHitBin-factor.patch + + + doogie + 2004-03-09 07:57:40 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=27) +The patch. + + + + doogie + 2004-04-29 16:16:02 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 19:57:51 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 06:07:05 + priority + Priority + P2 + P4 + + + + 72 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422223139 + Entity + doogie + not determined + FEATURE + 2004-03-09 08:04:05 + issues@ofbiz + + + + All + Add a matches(condition) helper method. + + + doogie + 2004-03-09 08:04:05 + See $summary. + + + doogie + 2004-03-09 08:04:31 + Created an attachment (id=28) +The patch + + + + doogie + 2004-04-22 22:31:39 + Applied patch. + + + text/plain + 28 + 2004-03-09 08:04:31 + The patch + 1 + GenericEntity-matches-condition.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/28/GenericEntity-matches-condition.patch + + + doogie + 2004-03-09 08:04:31 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=28) +The patch + + + + doogie + 2004-04-22 22:31:39 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:31:39 + resolution + Resolution + + FIXED + + + + 73 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422221835 + Entity + doogie + not determined + DEFECT + 2004-03-09 08:05:30 + issues@ofbiz + + + + All + Fix deserializing of these objects. + + + doogie + 2004-03-09 08:05:30 + See $summary. + + + doogie + 2004-03-09 08:05:51 + Created an attachment (id=29) +The patch. + + + + doogie + 2004-04-22 22:18:35 + Applied patch, which set delegatorName to "default" when it is null. + + + text/plain + 29 + 2004-03-09 08:05:50 + The patch. + 1 + GenericDelegator-fix-serialization.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/29/GenericDelegator-fix-serialization.patch + + + doogie + 2004-03-09 08:05:51 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=29) +The patch. + + + + doogie + 2004-04-22 22:18:35 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:18:35 + resolution + Resolution + + FIXED + + + + 74 + NEW + P2 + + Components + CVS + All + issues@ofbiz + 20040429200642 + Order + doogie + not determined + ENHANCEMENT + 2004-03-09 08:08:00 + issues@ofbiz + + + + All + Fix all fetchers of shopping cart to use a static method + + + doogie + 2004-03-09 08:08:00 + This patch fixes all code that fetches the ShoppingCart from the session, +to use a static method instead. It also adds the beginning of named +ShoppingCart support. + + + doogie + 2004-03-09 08:08:22 + Created an attachment (id=30) +The patch. + + + + doogie + 2004-04-29 19:57:51 + Changing priority, so that someone else can see the ones I want applied next. + + + doogie + 2004-04-29 20:05:04 + This patch depends on EntityCache, which isn't ready for inclussion yet, +reducing priority. + + + doogie + 2004-04-29 20:06:42 + Oops, modified wrong issue. + + + text/plain + 30 + 2004-03-09 08:08:22 + The patch. + 1 + ShoppingCart-getShoppingCart.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/30/ShoppingCart-getShoppingCart.patch + + + doogie + 2004-03-09 08:08:22 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=30) +The patch. + + + + doogie + 2004-04-29 16:16:03 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 19:57:51 + priority + Priority + P3 + P2 + + + doogie + 2004-04-29 20:05:04 + priority + Priority + P2 + P3 + + + doogie + 2004-04-29 20:06:41 + priority + Priority + P3 + P2 + + + + 75 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040429171641 + Base + doogie + not determined + ENHANCEMENT + 2004-03-09 08:09:21 + issues@ofbiz + + + + All + Allow code to detect whether a cacheline has expired. + + + doogie + 2004-03-09 08:09:21 + See $summary. + + + doogie + 2004-03-09 08:09:41 + Created an attachment (id=31) +The patch + + + + doogie + 2004-04-29 16:57:47 + Changing priority to P2, as I need these applied before I can commit my entity +cache work. + + + jonesde + 2004-04-29 17:16:41 + Now in CVS, thanks Adam. + + + text/plain + 31 + 2004-03-09 08:09:41 + The patch + 1 + UtilCache-hasExpired.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/31/UtilCache-hasExpired.patch + + + doogie + 2004-03-09 08:09:41 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=31) +The patch + + + + doogie + 2004-04-29 16:16:04 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 16:57:47 + priority + Priority + P3 + P2 + + + jonesde + 2004-04-29 17:16:41 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-29 17:16:41 + resolution + Resolution + + FIXED + + + + 76 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040429171643 + Base + doogie + not determined + ENHANCEMENT + 2004-03-09 08:10:31 + issues@ofbiz + + + + All + Allow code to get the values stored in the cache. + + + doogie + 2004-03-09 08:10:31 + See $summary. + + + doogie + 2004-03-09 08:10:58 + Created an attachment (id=32) +The patch + + + + doogie + 2004-04-29 16:57:47 + Changing priority to P2, as I need these applied before I can commit my entity +cache work. + + + jonesde + 2004-04-29 17:16:43 + Now in CVS, thanks Adam. + + + text/plain + 32 + 2004-03-09 08:10:58 + The patch + 1 + UtilCache-getCacheLineValues.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/32/UtilCache-getCacheLineValues.patch + + + doogie + 2004-03-09 08:10:58 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=32) +The patch + + + + doogie + 2004-04-29 16:16:05 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 16:57:47 + priority + Priority + P3 + P2 + + + jonesde + 2004-04-29 17:16:43 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-29 17:16:43 + resolution + Resolution + + FIXED + + + + 77 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040429171648 + Base + doogie + not determined + ENHANCEMENT + 2004-03-09 08:11:52 + issues@ofbiz + + + + All + Allow registering of listeners for the various events on caches. + + + doogie + 2004-03-09 08:11:52 + See $summary. + + + doogie + 2004-03-09 08:12:13 + Created an attachment (id=33) +The patch + + + + doogie + 2004-04-29 16:57:48 + Changing priority to P2, as I need these applied before I can commit my entity +cache work. + + + jonesde + 2004-04-29 17:16:48 + Now in CVS, thanks Adam. + + + text/plain + 33 + 2004-03-09 08:12:12 + The patch + 1 + UtilCache-listeners.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/33/UtilCache-listeners.patch + + + doogie + 2004-03-09 08:12:13 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=33) +The patch + + + + doogie + 2004-04-29 16:16:05 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 16:57:48 + priority + Priority + P3 + P2 + + + jonesde + 2004-04-29 17:16:48 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-29 17:16:48 + resolution + Resolution + + FIXED + + + + 78 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040423080723 + Entity + doogie + not determined + FEATURE + 2004-03-09 08:19:59 + issues@ofbiz + + + + All + Some additional methods to manipulate the embedded cache. + + + doogie + 2004-03-09 08:19:59 + See $summary. + + + doogie + 2004-03-09 08:20:20 + Created an attachment (id=34) +The patch + + + + doogie + 2004-04-23 08:07:23 + Add some more methods to GenericValue to manipulate the cache. + + + text/plain + 34 + 2004-03-09 08:20:20 + The patch + 1 + GenericValue-EmbeddedCache.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/34/GenericValue-EmbeddedCache.patch + + + doogie + 2004-03-09 08:20:20 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=34) +The patch + + + + doogie + 2004-04-23 08:07:23 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-23 08:07:23 + resolution + Resolution + + FIXED + + + + 79 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040429200727 + Product + doogie + not determined + ENHANCEMENT + 2004-03-09 08:21:27 + issues@ofbiz + + + + All + methods to fetch the list of available catalogs. + + + doogie + 2004-03-09 08:21:27 + See $summary. + + + doogie + 2004-03-09 08:21:46 + Created an attachment (id=35) +The patch + + + + doogie + 2004-04-29 19:57:52 + Changing priority, so that someone else can see the ones I want applied next. + + + doogie + 2004-04-29 20:07:27 + This patch depends on EntityCache, which isn't ready for inclussion yet, +reducing priority. + + + text/plain + 35 + 2004-03-09 08:21:46 + The patch + 1 + CatalogWorker-getCatalogsAvailable.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/35/CatalogWorker-getCatalogsAvailable.patch + + + doogie + 2004-03-09 08:21:46 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=35) +The patch + + + + doogie + 2004-04-29 16:16:05 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 19:57:52 + priority + Priority + P3 + P2 + + + doogie + 2004-04-29 20:07:27 + priority + Priority + P2 + P3 + + + + 80 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040422222535 + Entity + doogie + not determined + DEFECT + 2004-03-09 08:22:53 + issues@ofbiz + + + + All + Create a separate makeIndexName helper method. + + + doogie + 2004-03-09 08:22:53 + This patch also truncates the index name, based on the clipping value. + + + doogie + 2004-03-09 08:23:14 + Created an attachment (id=36) +The patch + + + + doogie + 2004-04-22 22:25:35 + Applied patch. + + + text/plain + 36 + 2004-03-09 08:23:14 + The patch + 1 + DatabaseUtil-makeIndexName.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/36/DatabaseUtil-makeIndexName.patch + + + doogie + 2004-03-09 08:23:14 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=36) +The patch + + + + doogie + 2004-04-22 22:25:35 + issue_status + Status + NEW + RESOLVED + + + doogie + 2004-04-22 22:25:35 + resolution + Resolution + + FIXED + + + + 81 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040429172408 + Base + doogie + not determined + ENHANCEMENT + 2004-03-09 08:23:52 + issues@ofbiz + + + + All + Add support for writing elements. + + + doogie + 2004-03-09 08:23:52 + See $summary. + + + doogie + 2004-03-09 08:24:13 + Created an attachment (id=37) +The patch + + + + doogie + 2004-04-29 16:57:47 + Changing priority to P2, as I need these applied before I can commit my entity +cache work. + + + jonesde + 2004-04-29 17:24:08 + Now in CVS, thanks Adam. + + + text/plain + 37 + 2004-03-09 08:24:12 + The patch + 1 + UtilXml-writeElement.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/37/UtilXml-writeElement.patch + + + doogie + 2004-03-09 08:24:13 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=37) +The patch + + + + doogie + 2004-04-29 16:16:03 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 16:57:47 + priority + Priority + P3 + P2 + + + jonesde + 2004-04-29 17:24:08 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-29 17:24:08 + resolution + Resolution + + FIXED + + + + 82 + NEW + P2 + + Components + CVS + All + issues@ofbiz + 20040429195752 + Party + doogie + not determined + ENHANCEMENT + 2004-03-09 08:25:06 + issues@ofbiz + + + + All + Services/etc for manipulating PartyAttributes. + + + doogie + 2004-03-09 08:25:06 + See $summary. + + + doogie + 2004-03-09 08:25:27 + Created an attachment (id=38) +The patch + + + + doogie + 2004-04-29 19:57:52 + Changing priority, so that someone else can see the ones I want applied next. + + + text/plain + 38 + 2004-03-09 08:25:27 + The patch + 1 + PartyAttributes.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/38/PartyAttributes.patch + + + doogie + 2004-03-09 08:25:27 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=38) +The patch + + + + doogie + 2004-04-29 16:16:04 + issue_type + Issue Type + FEATURE + ENHANCEMENT + + + doogie + 2004-04-29 19:57:52 + priority + Priority + P3 + P2 + + + + 83 + NEW + P5 + + Components + CVS + All + issues@ofbiz + 20040309095844 + Content + jacopo + not determined + DEFECT + 2004-03-09 09:58:44 + issues@ofbiz + + + + All + Problems displaying the Euro symbol in order confirmation by email with MS Outlook + + + jacopo + 2004-03-09 09:58:44 + Problems displaying the Euro symbol in order confirmation by email with MS +Outlook: instead of the beautyful Euro symbol you see a '?'. +Ok, maybe I should create an issue to the Microsoft issue tracker... however +I've reported this for two reasons: +1) other users reported this some time ago in the mailing lists +2) maybe, in general, for the currency symbols in ftl templates we should use +the html entity references (i.e. &euro; for the Euro symbol): this will solve +all the display problems with virtually any client software. + + + + 84 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040309101202 + Product + jacopo + not determined + ENHANCEMENT + 2004-03-09 10:12:02 + issues@ofbiz + + + + All + In shipment, it's possible to issue to shipment items with negative reservations (atp < 0); as a consequence of this, also the inventory items' quantity on hand can be negative. + + + jacopo + 2004-03-09 10:12:02 + In shipment, it's possible to issue to shipment items with negative +reservations (atp < 0); as a consequence of this, also the inventory items' +quantity on hand can be negative. +In fact, when the issuance is performed, the (negative) reservation is deleted +and a new issuance is created and the inventory's qoh is decremented. +In my opinion, in this situation a warning message should be provided. +Also, David Jones has suggested to create a report of all negative QOH +InventoryItems and add a link for each one to get a physical inventory variance +started. + + + + 85 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040730212116 + Party + jonesde + not determined + ENHANCEMENT + 2004-03-11 08:14:35 + issues@ofbiz + + + + All + The showvisits page in the Party Manager is very slow when there are many visits + + + jonesde + 2004-03-11 08:14:35 + The showvisits page is not coded to efficiently display a subset of the visits when there are many active. +When there are tens of thousands the current code doesn't work very efficiently. + + + ajzeneski + 2004-07-30 21:21:16 + The code for visit display utilized the entity list iterator and pulls a subset for each page. The query +fields are indexed (as of now) so depending on the JDBC driver being used this should be quite efficient. +If you experience further problems, send more information to the DEV list. + + + ajzeneski + 2004-03-18 12:04:04 + version + Version + Pre3.0.0 + CVS + + + ajzeneski + 2004-07-30 21:21:16 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 21:21:16 + resolution + Resolution + + INVALID + + + + 86 + NEW + P4 + + Components + CVS + All + issues@ofbiz + 20040312164734 + Content + jonesde + not determined + PATCH + 2004-03-12 16:45:26 + issues@ofbiz + + + + All + Error Message (esp Map) Improvements from Quake Wang + + + jonesde + 2004-03-12 16:45:26 + A description from an email from Quake: + +================================ +David, + The attachment is my patch. The main changes are: + +1. Now the event and the service invoke will use the same message fields in SimpleMethod. +2. Add the errorMessageMap and successMessageMap for the message handling + + I only change the envsetup.bsh and errormsg.ftl in the ecommerce component, please use the +ecommerce to review the backward compatiblity. + +Regards +Quake +============================= + + + jonesde + 2004-03-12 16:47:34 + Created an attachment (id=39) +Error Message patch from Quake Wang + + + + text/plain + 39 + 2004-03-12 16:47:34 + Error Message patch from Quake Wang + 1 + quake.errormessages.patch + 3 + jonesde + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/39/quake.errormessages.patch + + + jonesde + 2004-03-12 16:47:34 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=39) +Error Message patch from Quake Wang + + + + + 87 + NEW + P3 + + Base + CVS + All + issues@ofbiz + 20040312165745 + Base + doogie + not determined + DEFECT + 2004-03-12 16:56:52 + issues@ofbiz + + + + All + bsf.jar in base is old + + + doogie + 2004-03-12 16:56:52 + bsf is no longer part of IBM. Instead, it has moved to jakarta. + +Attached patch changes imports, etc. It can't change the bsf.jar in +base/lib/scripting/, however. + + + doogie + 2004-03-12 16:57:45 + Created an attachment (id=40) +The patch. + + + + text/plain + 40 + 2004-03-12 16:57:45 + The patch. + 1 + IBM-Jakarta-BSF.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/40/IBM-Jakarta-BSF.patch + + + doogie + 2004-03-12 16:57:45 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=40) +The patch. + + + + + 88 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040312165737 + Order + jonesde + not determined + DEFECT + 2004-03-12 16:57:37 + issues@ofbiz + + + + All + Promotion/other adjustments not as expected when cancelling order items + + + jonesde + 2004-03-12 16:57:37 + When order items are cancelled some order level adjustments are not changed, like order level +promotion adjustments. Because of this order totals can easily become negative. The question is what +to do about it? + +Andy wrote this at one point in an email: + +============================ +I was aware of this; the only order level adjustments which are currently re-calculated are shipping and +tax, order level promotions are not done at this time so we will need to add this in. In order to do this +promotion evaluation will need to be able to be done without a shopping cart. +============================ + +I'm not sure I totally agree with this, I think short of that it would still be good to at least pro-rate these +order adjustments like we do with tax and shipping. + +Or would it be better on any order change to just cancel the order and create a new one with full re- +calculations, including promotions, tax, shipping, etc, etc? If that is done should we apply promotions, +etc as if it was the original order date, or using today's date? (could be a big difference based on +promotions that come and go over time) + + + + 89 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040312171315 + Product + jonesde + not determined + PATCH + 2004-03-12 17:10:18 + issues@ofbiz + + + + All + In product detail show variant prices (from Brian Johnson) + + + jonesde + 2004-03-12 17:10:18 + Here is a description from an email from Brian Johnson: + +=================================== +I've changed productdetail to better handle variants with different prices. When you first bring-up the +page it says "make selections", then when you select the features from the drop-downs it'll show the +price for the product with those features. +-- +Brian Johnson +=================================== + + + jonesde + 2004-03-12 17:13:15 + Created an attachment (id=41) +Show prices for variants along with drop down, patch from Brian Johnson + + + + text/plain + 41 + 2004-03-12 17:13:15 + Show prices for variants along with drop down, patch from Brian Johnson + 1 + productdetail-variantprices.patch + 3 + jonesde + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/41/productdetail-variantprices.patch + + + jonesde + 2004-03-12 17:11:11 + issue_type + Issue Type + DEFECT + PATCH + + + jonesde + 2004-03-12 17:13:15 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=41) +Show prices for variants along with drop down, patch from Brian Johnson + + + + + 90 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040312172159 + E-Commerce + jonesde + not determined + FEATURE + 2004-03-12 17:21:59 + issues@ofbiz + + + + All + Web/order/etc marketing reports like Core Metrics + + + jonesde + 2004-03-12 17:21:59 + The feature here is to create a standard set of reports commonly used to keep tabs on a web content +and/or ecommerce site. These reports would be similar to what a company like Core Metrics offers. + +Would include reports for a given time period such as for things like hits, visits/sessions, orders, +tracking codes, percent of customers that order, orders per customer, pages/products/etc viewed, +searches done, referring sites & search strings, etc, etc, etc. + + + + 91 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040315011245 + Product + jacopo + not determined + DEFECT + 2004-03-15 01:12:45 + issues@ofbiz + + + + All + Shipment: potential problem when issuing negative reservations (quantityNotAvailable could be lost) + + + jacopo + 2004-03-15 01:12:45 + This is a potential problem when you issue negative reservation to a shipment. +Here is the scenario: + +1) inventory item 9000 for product WG-1111 with atp/qoh = 10/10 +2) two orders are received for WG-1111: the first for 8 items, the second +for 5 items +3) two reservations are made: the first for 8 items and the second for 5 +items but with quantityNotAvailable = 3 +4) the inventory item 9000 is now: atp/qoh = -3/10 +5) only the second order is issued to shipment: the reservation record is +deleted and the qoh is decremented +6) the inventory item 9000 is now: atp/qoh = -3/5 but the reservation for +the first order (for quantity = 8) has quantityNotAvailable = 0 (ERROR: it +should be 3) + +A possible patch: if we issue a negative reservation we should try to assign +the quantityNotAvailable to another reservation in the same inventory item. + +In order to do this, David Jones has proposed to do a re-reservation whenever a +reservation is issued to a shipment, considering that (like in this scenario) +shipments may occur in a different order than reservations. + +In fact, when new inventory is received a re-reservation is already done for +all OIIR that are associated to inventory items (of the same product) that have +negative ATP. +In a similar way, when we issue a OIIR, we could do a re-reservation for all +the OIIR associated to the inventory item. + + + + 92 + RESOLVED + P3 + FIXED + Components + CVS + All + jonesde + 20040416115022 + E-Commerce + holivier + not determined + PATCH + 2004-03-16 06:35:41 + issues@ofbiz + + + + All + Simple Update for localization + + + holivier + 2004-03-16 06:35:41 + In the ecommerce component +2 UiLabels change (the # is now in the label) +and some french UiLabel correction + + + holivier + 2004-03-16 06:38:00 + Created an attachment (id=42) +the Ecommerce UiLabel patch + + + + jonesde + 2004-04-16 11:50:22 + Patch is in CVS. Thanks for doing these Olivier. + + + text/plain + 42 + 2004-03-16 06:38:00 + the Ecommerce UiLabel patch + 1 + EcommerceUiLabel.update.patch + 165 + holivier + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/42/EcommerceUiLabel.update.patch + + + holivier + 2004-03-16 06:38:00 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=42) +the Ecommerce UiLabel patch + + + + ajzeneski + 2004-03-18 12:04:15 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-04-16 11:50:22 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-16 11:50:22 + resolution + Resolution + + FIXED + + + + 93 + RESOLVED + P3 + FIXED + Components + CVS + All + jonesde + 20040416115029 + Order + holivier + not determined + PATCH + 2004-03-16 08:00:55 + issues@ofbiz + + + + All + Simple Update for localization + + + holivier + 2004-03-16 08:00:55 + Order component, some french UiLabels correction + + + holivier + 2004-03-16 08:02:07 + Created an attachment (id=43) +The OrderUilabel properties patch file + + + + jonesde + 2004-04-16 11:50:29 + Patch is in CVS. Thanks for doing these Olivier. + + + text/plain + 43 + 2004-03-16 08:02:07 + The OrderUilabel properties patch file + 1 + OrderUilabelCorrection.patch + 165 + holivier + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/43/OrderUilabelCorrection.patch + + + holivier + 2004-03-16 08:02:07 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=43) +The OrderUilabel properties patch file + + + + ajzeneski + 2004-03-18 12:04:26 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-04-16 11:50:29 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-16 11:50:29 + resolution + Resolution + + FIXED + + + + 94 + RESOLVED + P3 + FIXED + Components + CVS + All + jonesde + 20040416115037 + Party + holivier + not determined + PATCH + 2004-03-16 09:28:27 + issues@ofbiz + + + + All + Simple Update for localization + + + holivier + 2004-03-16 09:28:27 + simple french correction & translation in the Party and workeffort components + + + holivier + 2004-03-16 09:29:26 + Created an attachment (id=44) +the PartyUiLabel correction patch file + + + + holivier + 2004-03-16 09:30:03 + Created an attachment (id=45) +the workeffortUilabel correction patch file + + + + jonesde + 2004-04-16 11:50:37 + Patch is in CVS. Thanks for doing these Olivier. + + + text/plain + 44 + 2004-03-16 09:29:26 + the PartyUiLabel correction patch file + 1 + PartyUiLabelCorrection040316.patch + 165 + holivier + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/44/PartyUiLabelCorrection040316.patch + + + text/plain + 45 + 2004-03-16 09:30:03 + the workeffortUilabel correction patch file + 1 + WorkeffortUiLabelCorrection040316.patch + 165 + holivier + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/45/WorkeffortUiLabelCorrection040316.patch + + + holivier + 2004-03-16 09:29:26 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=44) +the PartyUiLabel correction patch file + + + + holivier + 2004-03-16 09:30:03 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=45) +the workeffortUilabel correction patch file + + + + ajzeneski + 2004-03-18 12:04:35 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-04-16 11:50:37 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-16 11:50:37 + resolution + Resolution + + FIXED + + + + 95 + RESOLVED + P3 + FIXED + Components + CVS + All + jonesde + 20040416115047 + Product + holivier + not determined + PATCH + 2004-03-16 09:32:59 + issues@ofbiz + + + + All + Simple Update for localization + + + holivier + 2004-03-16 09:32:59 + Product components internationalization and the UiLabel files associated + + + holivier + 2004-03-16 09:36:08 + Created an attachment (id=46) +the patch file for produt bsh, xml, ftl and properties + + + + jonesde + 2004-04-16 11:50:47 + Patch is in CVS. Thanks for doing these Olivier. + + + text/plain + 46 + 2004-03-16 09:36:08 + the patch file for produt bsh, xml, ftl and properties + 1 + ProductUiLabelMigration040316.patch + 165 + holivier + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/46/ProductUiLabelMigration040316.patch + + + holivier + 2004-03-16 09:36:08 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=46) +the patch file for produt bsh, xml, ftl and properties + + + + ajzeneski + 2004-03-18 12:04:46 + version + Version + Pre3.0.0 + CVS + + + jonesde + 2004-04-16 11:50:47 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-16 11:50:47 + resolution + Resolution + + FIXED + + + + 96 + RESOLVED + P3 + FIXED + Components + CVS + All + jonesde + 20040730204543 + Security Extensions + holivier + not determined + PATCH + 2004-03-16 13:30:49 + issues@ofbiz + + + + All + Typo error correction in emailPassword (bcc in place of cc) + + + holivier + 2004-03-16 13:30:49 + just a simple typo correction.In the emailPassword method when reading and +populated the service fields they was an error. + serviceContext.put("sendBcc", productStoreEmail.get("ccAddress")); +I have change cc to bcc + + + holivier + 2004-03-16 13:31:26 + Created an attachment (id=47) +the patch file + + + + ajzeneski + 2004-07-30 20:45:43 + this has already been fixed in cvs. + + + text/plain + 47 + 2004-03-16 13:31:26 + the patch file + 1 + EmailPassword040316.patch + 165 + holivier + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/47/EmailPassword040316.patch + + + holivier + 2004-03-16 13:31:26 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=47) +the patch file + + + + ajzeneski + 2004-03-18 12:04:54 + version + Version + Pre3.0.0 + CVS + + + ajzeneski + 2004-07-30 20:45:43 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 20:45:43 + resolution + Resolution + + FIXED + + + + 97 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040527234819 + Accounting + jacopo + not determined + DEFECT + 2004-03-18 06:59:56 + issues@ofbiz + + + + All + Error when creating an invoice with billing account payment type. + + + jacopo + 2004-03-18 06:59:56 + The following error is generated when you try to create an invoice for an order +with payment type == billing account: + +---------------------------------------- +803495[ InvoiceServices.java:583:ERROR] Problems storing invoice items +org.ofbiz.entity.GenericEntityException: Exception occurred in storeAll (while i +nserting: [GenericEntity:InvoiceContactMech][createdTxStamp,2004-03-18 15:29:46. +156(java.sql.Timestamp)][invoiceId,10010(java.lang.String)][contactMechPurposeTy +peId,BILLING_LOCATION(java.lang.String)][lastUpdatedTxStamp,2004-03-18 15:29:46. +156(java.sql.Timestamp)][contactMechId,null()][createdStamp,2004-03-18 15:29:46. +977(java.sql.Timestamp)][lastUpdatedStamp,2004-03-18 15:29:46.977(java.sql.Times +tamp)] (SQL Exception while executing the following:INSERT INTO INVOICE_CONTACT_ +MECH (INVOICE_ID, CONTACT_MECH_PURPOSE_TYPE_ID, CONTACT_MECH_ID, LAST_UPDATED_ST +AMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, + ?, ?, ?) ([-5005] (at 83): Missing non-NULL value))) +---------------------------------------- + +I think I've tracked down the source of this problem: +the field contactMechId for the billing account entry in BillingAccount entity +is empty. + + + jacopo + 2004-05-26 10:12:53 + The error happens when no Billing Contact Mechanism is specified in the billing +account. +In order to fix this issue the input field "Billing Contact Mech" in the +EditBillingAccount page should be marked as mandatory. + + + + jonesde + 2004-05-27 23:48:19 + Fixed by changing the code to not try to create that record when the BillingAccount.contactMechId is +empty. + + + jonesde + 2004-05-27 23:48:18 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-27 23:48:18 + resolution + Resolution + + FIXED + + + + 98 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040322173551 + Product + jacopo + not determined + FEATURE + 2004-03-19 07:41:21 + issues@ofbiz + + + + All + New Shipment Plan feature for the shipment process. + + + jacopo + 2004-03-19 07:41:21 + New Shipment Plan feature for the shipment process. + +In order to support some of the tasks in the manufacturing industry there was +the need of some simple shipment planning functionality: we need to assign a +group of customer order items to a scheduled shipment (but without actually +picking and issuing the items from warehouse). + +The patches in the attached zip file add this functionality to the shipment ui. +This is the list of changes: + +NEW FILES (new page, within the shipment ui, for ShipmentPlan management) + +product/webapp/facility/shipment/EditShipmentPlan.ftl +product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.bsh +product/webapp/facility/WEB-INF/pagedefs/shipment/EditShipmentPlan.xml + +PATCHES +product/webapp/facility/shipment/ShipmentTabBar.ftl (added new link to +EditShipmentPlan page) + +product/webapp/facility/shipment/ShipmentForms.xml (some new forms for the +EditShipmentPlan page) + +product/webapp/facility/WEB-INF/controller.xml (controller definitions for the +EditShipmentPlan page) + +product/webapp/facility/shipment/AddItemsFromOrder.ftl (added some info, also +fixed issues #47 and #55) +product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromOrder.bsh (added +code to get reservations also from shipment plan) + +product/servicedef/services_shipment.xml (definitions for two new services to +add/delete entries in the Shipment Plan) +product/scripts/org/ofbiz/shipment/shipment/ShipmentSerices.xml (implementation +of the two new services) + +product/entitydef/entitygroup.xml (declaration of the new entity ShipmentPlan) +product/entitydef/entitymodel_shipment.xml (definition of the new entity +ShipmentPlan) + +product/config/ProductUiLabels.properties (some new labels) +product/config/ProductUiLabels_fr.properties (some new labels in ENGLISH) + + + jacopo + 2004-03-19 07:42:41 + Created an attachment (id=48) +The patches and new files + + + + jonesde + 2004-03-22 17:35:51 + This patch is now in place. Thanks for sending it in Jacopo. BTW, for future patches a consolidated +patch file is nice. + + + application/x-compressed + 48 + 2004-03-19 07:42:41 + The patches and new files + + ShipmentPlan.zip + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/48/ShipmentPlan.zip + + + jacopo + 2004-03-19 07:42:41 + attachments.thedata + Attachment Data + + Created an attachment (id=48) +The patches and new files + + + + jonesde + 2004-03-22 17:35:51 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-03-22 17:35:51 + resolution + Resolution + + FIXED + + + + 99 + RESOLVED + P4 + FIXED + Components + CVS + All + issues@ofbiz + 20040806160304 + Product + jacopo + not determined + PATCH + 2004-03-28 01:13:10 + issues@ofbiz + + + + All + New html report that shows inventory availability by product + + + jacopo + 2004-03-28 01:13:10 + This is a new html report (patches are in the attached zip file) for the +Facility Manager Application that shows info about stock levels and +reservations from a product point of view (instead of inventory item). +The action code is very simple (the bsh action calls a service to +compute atp and qoh per product); the report is formatted by the form widget +stuff. +It is not internationalized. +In my local setup I've added a link to it from the Inventory Item page but fell +free to modify it and put it where you want. + + + jacopo + 2004-03-28 01:14:46 + Created an attachment (id=49) +Files and patches for the new report. + + + + jonesde + 2004-08-06 16:03:04 + Okay, this is in CVS, and I added a link to it from the facility inventory items page. Thanks for sending +this over. + + + application/x-compressed + 49 + 2004-03-28 01:14:46 + Files and patches for the new report. + + inventory_report.zip + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/49/inventory_report.zip + + + jacopo + 2004-03-28 01:14:46 + attachments.thedata + Attachment Data + + Created an attachment (id=49) +Files and patches for the new report. + + + + jonesde + 2004-08-06 16:03:04 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-08-06 16:03:04 + resolution + Resolution + + FIXED + + + + 100 + RESOLVED + P3 + FIXED + Components + REL 3.0.0 + All + issues@ofbiz + 20040403232241 + E-Commerce + dlouzado + not determined + DEFECT + 2004-03-28 13:50:10 + issues@ofbiz + + + + All + crash on Shipping Information page + + + dlouzado + 2004-03-28 13:50:10 + I was logged as "admin" user and buying something on the test store on ofbiz +instance running on a standalone machine (no connection with the internet). + +I was filling the shipping information and when I clicked 'continue' the +following exception was thrown: + + +"org.ofbiz.base.util.GeneralException: JPublish execution error (BeanShell +script error: Sourced file: +C:\jtools\ofbiz\components\ecommerce\webapp\ecommerce\WEB-INF\actions\order\optionsettings.bsh +: Error in method invocation: Attempt to pass void argument (position 0) to +method: getContactMechByType : at Line: 65 : in file: +C:\jtools\ofbiz\components\ecommerce\webapp\ecommerce\WEB-INF\actions\order\optionsettings.bsh +: ContactHelper .getContactMechByType ( party , "EMAIL_ADDRESS" , false ) +BSF info: +C:\jtools\ofbiz\components\ecommerce\webapp\ecommerce\WEB-INF\actions\order\optionsettings.bsh +at line: 0 column: 0)" + + + jonesde + 2004-04-03 23:22:41 + Fixed so that "party" would exist where it is referenced there. + + + jonesde + 2004-04-03 23:22:41 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-03 23:22:41 + resolution + Resolution + + FIXED + + + + 101 + RESOLVED + P5 + FIXED + Components + CVS + All + ajzeneski + 20040730152858 + Content + eckardjf + not determined + DEFECT + 2004-04-02 09:44:46 + issues@ofbiz + + + + All + https Website Settings Ignored + + + eckardjf + 2004-04-02 09:44:46 + org.ofbiz.content.webapp.control.RequestHandler.doRequest() checks to see if a request should be +secure, but is not - and will redirect to a secure url if necessary. However, when rewriting the url to +make it secure, it does not check the website settings for the enableHttps, httpsHost and httpsPort. It +uses the global defaults from url.properties instead, which means the website settings have no effect. + + + ajzeneski + 2004-07-30 15:28:58 + this has now been corrected in CVS. + + + ajzeneski + 2004-06-30 19:43:50 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-07-30 15:28:58 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 15:28:58 + resolution + Resolution + + FIXED + + + + 102 + NEW + P4 + + Components + REL 3.0.0 + All + issues@ofbiz + 20040403233556 + Entity Extensions + jonesde + not determined + ENHANCEMENT + 2004-04-03 23:35:56 + issues@ofbiz + + + + All + Easy way to disabling Entity Sync oriented information + + + jonesde + 2004-04-03 23:35:56 + Need an easy way to disable the saving of Entity Sync oriented information such as the entity remove +information. May not want to disable the auto tx and individual timestamps because they are used in +other code that takes advantage of the fact that they are always present (though we still need to get rid +of the last updated and created timestamps that were added to various entities). + + + + 103 + RESOLVED + P1 + FIXED + Components + CVS + All + ajzeneski + 20040405070601 + Accounting + bryce_nz + not determined + DEFECT + 2004-04-05 00:05:28 + issues@ofbiz + + + + All + Nasty little error in PaymentGatewayServices + + + bryce_nz + 2004-04-05 00:05:28 + In PaymentGatewayServices.refundPayment there is a section of code for creating +the payment for the refund, then at line 1255 there is the following: + + Map result = ServiceUtil.returnSuccess(); + result.put("paymentId", "10000"); + return result; + +Obviously the payment id being returned shouldn't be hardcoded in, should read: + + Map result = ServiceUtil.returnSuccess(); + result.put("paymentId", paymentId); + return result; + + + ajzeneski + 2004-04-05 07:06:01 + This has been corrected in CVS, thank you. + + + ajzeneski + 2004-04-05 07:05:36 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-04-05 07:06:01 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 07:06:01 + resolution + Resolution + + FIXED + + + + 104 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405134511 + Workflow + elfring + not determined + FEATURE + 2004-04-05 13:22:20 + issues@ofbiz + + + + All + Job Definition + + + elfring + 2004-04-05 13:22:20 + This request might fit to the section "Service Engine Tools" on the page +"http://ofbiz.org/feature-list.html". + +Would you like to support the JDF +standard? +http://en.wikipedia.org/wiki/Job_Definition_Format + + + ajzeneski + 2004-04-05 13:45:11 + Not sure what this is supposed to be requesting. This issue contains no specific feature request. + + + ajzeneski + 2004-04-05 13:45:11 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 13:45:11 + resolution + Resolution + + INVALID + + + + 105 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405134741 + Service + elfring + not determined + FEATURE + 2004-04-05 13:28:41 + issues@ofbiz + + + + All + Support for dynamic Service Configuration + + + elfring + 2004-04-05 13:28:41 + Would you like to use a service configurator for your server? +- +http://www.cs.wustl.edu/~schmidt/ACE-papers.html +- +http://java.sun.com/j2se/1.5.0/docs/guide/jmx/tutorial/tutorialTOC.html + +Can this +request solved with JMX? +http://en.wikipedia.org/wiki/Java_Management_eXtensions + + + ajzeneski + 2004-04-05 13:47:41 + This issue contains no specific feature request. Not sure what you are requesting, so there is no way to +determine if JMX will solve the problem. + + + ajzeneski + 2004-04-05 13:47:41 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 13:47:41 + resolution + Resolution + + INVALID + + + + 106 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405134845 + WebTools + elfring + not determined + FEATURE + 2004-04-05 13:42:12 + issues@ofbiz + + + + All + Portlet Interface + + + elfring + 2004-04-05 13:42:12 + Would you like to integrate components with web portals? + +- +http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-portlet2.html +- +http://www.javaworld.net/javaworld/jw-11-2003/jw-1114-jsfredux.html +- +http://en.wikipedia.org/wiki/Portlet + + + ajzeneski + 2004-04-05 13:48:45 + Sure we would love to integrate with web portals, however this issue contains no specific feature +request. + + + ajzeneski + 2004-04-05 13:48:45 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 13:48:45 + resolution + Resolution + + INVALID + + + + 107 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405135106 + WebTools + elfring + not determined + FEATURE + 2004-04-05 13:47:12 + issues@ofbiz + + + + All + Vector graphics and XForms + + + elfring + 2004-04-05 13:47:12 + Will the application support .svgz or .x3dz files that contain XForms? + +- +http://en.wikipedia.org/wiki/Scalable_Vector_Graphics +- +http://en.wikipedia.org/wiki/X3D +- http://en.wikipedia.org/wiki/XForms +- +http://xml.apache.org/batik/ + +See also the request "XForms" in the discussion forum by +Britton LaRoche from "August 28, 2003 12:38:36 AM +GMT". +https://ofbiz.dev.java.net/servlets/ProjectForumMessageView?forumID=282&messageID=1065 + + + ajzeneski + 2004-04-05 13:51:06 + This issue contains no specific feature request. No information was provided regarding how support for +these file types is desired and where the desired functionality is needed. + + + ajzeneski + 2004-04-05 13:51:06 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 13:51:06 + resolution + Resolution + + INVALID + + + + 108 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405140048 + Rules + elfring + not determined + FEATURE + 2004-04-05 13:51:31 + issues@ofbiz + + + + All + Integration with Knowledge Representation + + + elfring + 2004-04-05 13:51:31 + What is the current state of your support for this technology? +- +http://en.wikipedia.org/wiki/Knowledge_representation +- +http://en.wikipedia.org/wiki/Expert_system + + + ajzeneski + 2004-04-05 14:00:48 + This issue is not a valid feature request, questions of this sort should be discussed on the mailing lists. +In addition, do expect readers to follow links and read articles to get your point across it is highly +unlikely that people will spent the time to research something for you. Your best bet is to read the +articles and post a question asking something specific, then your chances of getting an intelligent +response is greater. + + + ajzeneski + 2004-04-05 14:00:48 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 14:00:48 + resolution + Resolution + + INVALID + + + + 109 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405140138 + Service + elfring + not determined + FEATURE + 2004-04-05 13:52:57 + issues@ofbiz + + + + All + Open Services Gateway + + + elfring + 2004-04-05 13:52:57 + Would you like to cooperate with these service APIs so that your software can be used over these +interfaces? +http://www.osgi.org/about/faqs.asp +http://en.wikipedia.org/wiki/OSGi + + + ajzeneski + 2004-04-05 14:01:37 + This issue contains no specific feature request. + + + ajzeneski + 2004-04-05 14:01:37 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 14:01:37 + resolution + Resolution + + INVALID + + + + 110 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405140228 + Entity + elfring + not determined + FEATURE + 2004-04-05 13:56:20 + issues@ofbiz + + + + All + Content Storage API + + + elfring + 2004-04-05 13:56:20 + Would you like to support the programming interface "Content +Repository"? +http://jcp.org/en/jsr/detail?id=170 + +This topic can be perhaps combined +with requests for CVS and Subversion integration. + + + ajzeneski + 2004-04-05 14:02:28 + This issue contains no specific feature request; please see issue #108 for more suggestions. + + + ajzeneski + 2004-04-05 14:02:28 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 14:02:28 + resolution + Resolution + + INVALID + + + + 111 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405140305 + Workflow + elfring + not determined + ENHANCEMENT + 2004-04-05 14:02:16 + issues@ofbiz + + + + All + Workflow Management + + + elfring + 2004-04-05 14:02:17 + How do you think about workflow modelling patterns? +Which of them are supported by your +software? (Is cooperation with other standards like BPML besides WfMC XPDL +possible?) +http://tmitwww.tm.tue.nl/research/patterns/ + + + ajzeneski + 2004-04-05 14:03:05 + see issue #108 + + + ajzeneski + 2004-04-05 14:03:05 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 14:03:05 + resolution + Resolution + + INVALID + + + + 112 + RESOLVED + P3 + INVALID + Components + CVS + All + issues@ofbiz + 20040405141257 + Entity Extensions + elfring + not determined + ENHANCEMENT + 2004-04-05 14:07:40 + issues@ofbiz + + + + All + relationships and object mapping + + + elfring + 2004-04-05 14:07:40 + I've got the impression from the discussion about the topic "entity-engine: thoughts on extends +(IS A) pattern and relationships" that there might be something useful from other information +sources. + +1. CORBA: Relationship Service +Specification +http://www.omg.org/technology/documents/formal/relationship_service.htm + +2. +ObJectRelationalBridge +http://db.apache.org/ojb/ + +3. alternative open source +implementation for JDO +http://speedo.objectweb.org/ + +4. Citations from +CiteSeer +http://citeseer.ist.psu.edu/cis?q=object+and+relational+and+mapping+and+database + +5. +a detailed Wiki +http://en.wikipedia.org/wiki/Object_database + +Would you like to reuse +anything from those implementations and experiences? + +How does your use of the Java Open +Transaction Manager (http://jotm.objectweb.org/) fit into this picture? + + + ajzeneski + 2004-04-05 14:12:57 + No specific enhancement requested. + + + ajzeneski + 2004-04-05 14:12:57 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-04-05 14:12:57 + resolution + Resolution + + INVALID + + + + 113 + RESOLVED + P3 + WORKSFORME + Components + CVS + All + issues@ofbiz + 20040406101817 + WebTools + ajzeneski + not determined + DEFECT + 2004-04-06 07:00:29 + issues@ofbiz + + + + All + EditEntity.jsp displays wrong field length + + + ajzeneski + 2004-04-06 07:00:29 + Reported by prozelit@yahoo.com: + +On EditEntity.jsp, there is a fields table. It is +supposed to display the length of each field, but it +looks like it displays the length of the field name +instead. It seems to me there is a bug at line 347. + + + jonesde + 2004-04-06 10:18:17 + +This is the expected behavior. The length in parenthesis there is meant to show you the length of the +column name so that you can tell if it is within the required length of the database, we generally +recommend (and always use) equal or less than 30 characters. + + + jonesde + 2004-04-06 10:18:17 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-06 10:18:17 + resolution + Resolution + + WORKSFORME + + + + 114 + NEW + P3 + + Components + CVS + PC + issues@ofbiz + 20040406100126 + WorkEffort + vivalinux + not determined + PATCH + 2004-04-06 10:01:26 + issues@ofbiz + + http://<ofbiz_URL>/workeffort/control/month?start=1083297600000 + + All + Daylight savings and the calendar + + + vivalinux + 2004-04-06 10:01:26 + On the months when daylight savings takes place, or stops taking place +(April/September in the US), the way the start of the period is computed in the +WorkEffortServices.getWorkEffortsByPeriod yields one extra hour after dayligh +savings kicks in. +The reason for this is that the absolute time is interpreted differently once +daylight savings is in place. +So I suggest using the attached patch which relies on UtilDateTime.getDayStart +to get the period start/end. + + + + 115 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040730150719 + Product + lykins + not determined + FEATURE + 2004-04-06 13:56:51 + issues@ofbiz + + + + All + Product to Order Lookup Link + + + lykins + 2004-04-06 13:56:51 + Something that should bring great benefit is the ability to link the product to +the orders from the product maintenance screen. It would be very beneficial to +know what purchase order the product came from. I noticed that there are links +to almost all other relations besides this. + +Thanks, +Patrick + + + ajzeneski + 2004-07-30 15:07:19 + good idea; now in CVS + + + ajzeneski + 2004-07-30 15:07:19 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 15:07:19 + resolution + Resolution + + FIXED + + + + 116 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040417174533 + Product + jacopo + not determined + PATCH + 2004-04-17 00:19:59 + issues@ofbiz + + + + All + Implementation of getProductVariant service. + + + jacopo + 2004-04-17 00:19:59 + Implementation of getProductVariant service. + + + jacopo + 2004-04-17 00:20:48 + Created an attachment (id=50) +Patch for the java implementation + + + + jacopo + 2004-04-17 00:21:21 + Created an attachment (id=51) +Patch for the service definition. + + + + jonesde + 2004-04-17 17:45:33 + It's in. Thanks Jacopo. + + + text/plain + 50 + 2004-04-17 00:20:48 + Patch for the java implementation + 1 + ProductServices.java.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/50/ProductServices.java.patch + + + text/plain + 51 + 2004-04-17 00:21:21 + Patch for the service definition. + 1 + services.xml.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/51/services.xml.patch + + + jacopo + 2004-04-17 00:20:48 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=50) +Patch for the java implementation + + + + jacopo + 2004-04-17 00:21:21 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=51) +Patch for the service definition. + + + + jonesde + 2004-04-17 17:45:33 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-17 17:45:33 + resolution + Resolution + + FIXED + + + + 117 + RESOLVED + P1 + FIXED + Components + CVS + All + issues@ofbiz + 20040422201817 + Accounting + colt_nz + not determined + DEFECT + 2004-04-20 14:45:56 + issues@ofbiz + + + + All + editPayment has wrongly named fields + + + colt_nz + 2004-04-20 14:45:56 + /accounting/webapp/accounting/payment/editPayment.ftl + +Input fields partyIdTo and partyIdFrom are round the wrong way. ie switch 'em. + + + jonesde + 2004-04-22 20:18:17 + +Thanks for reporting this, the fix is in CVS. Looks like it was perhaps an issue with the i18n... + + + jonesde + 2004-04-22 20:18:17 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-22 20:18:17 + resolution + Resolution + + FIXED + + + + 118 + RESOLVED + P4 + FIXED + Components + CVS + All + issues@ofbiz + 20040819001212 + Product + jonesde + not determined + FEATURE + 2004-04-23 21:32:35 + issues@ofbiz + + + + All + Make QuickAddVariants Easier to Use + + + jonesde + 2004-04-23 21:32:35 + Make QuickAddVariants Easier to Use: + +1. Change to multi-form +2. Allow enter pattern to use to pre-populate the various IDs + + + jacopo + 2004-08-19 00:12:11 + Some time ago I did this and you put all the stuff in CVS, so now it's done. + + + jacopo + 2004-08-19 00:12:10 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-08-19 00:12:10 + resolution + Resolution + + FIXED + + + + 119 + RESOLVED + P2 + FIXED + Components + CVS + All + jacopo + 20040717041328 + Manufacturing + jacopo + not determined + ENHANCEMENT + 2004-04-24 00:15:36 + issues@ofbiz + + + + All + Refactoring of the BOMEvent class that manages all the related to bill of materials editing. + + + jacopo + 2004-04-24 00:15:36 + Refactoring of the BOMEvent class that manages all the related to bill of +materials editing. + +Three new (simple) services should be created (create, update, delete). +An sECA rule should be added to the create and update services to update the +low level code. + + + jacopo + 2004-07-17 04:13:28 + Ok, the BOMEvent class has gone away; I have implemented some simple services +to add/update/remove/copy boms (performing all the needed checks for loops and +updating the product's llc). + + + + jacopo + 2004-07-17 04:13:28 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-07-17 04:13:28 + resolution + Resolution + + FIXED + + + + 120 + NEW + P3 + + Components + CVS + All + jacopo + 20040424001903 + Manufacturing + jacopo + not determined + ENHANCEMENT + 2004-04-24 00:19:03 + issues@ofbiz + + + + All + searchDuplicateAncenstor service should resolve also virtual to variant products to search for loops. + + + jacopo + 2004-04-24 00:19:03 + searchDuplicateAncenstor service should resolve also virtual to variant +products to search for loops. + + + + 121 + RESOLVED + P3 + FIXED + Components + CVS + All + jacopo + 20040717041557 + Manufacturing + jacopo + not determined + ENHANCEMENT + 2004-04-24 00:24:11 + issues@ofbiz + + + + All + Refactoring of the Bill of Material editor's ui: migration to the forms widget. + + + jacopo + 2004-04-24 00:24:11 + Refactoring of the Bill of Material editor's ui: migration to the forms widget. + +This will also include: +- i18n and l10n issues +- management of all the relavant fields that are missing +- lookup fields +- fields validation + + + jacopo + 2004-07-17 04:15:57 + I have not used the form widget (maybe in the future, together with some more +clean ups) here, but most of these points has been fixed. + + + jacopo + 2004-07-17 04:15:57 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-07-17 04:15:57 + resolution + Resolution + + FIXED + + + + 122 + NEW + P3 + + Components + CVS + All + jacopo + 20040424002537 + Manufacturing + jacopo + not determined + ENHANCEMENT + 2004-04-24 00:25:37 + issues@ofbiz + + + + All + updateLowLevelCode service - it should also update the low level code for variant products + + + jacopo + 2004-04-24 00:25:37 + updateLowLevelCode service - it should also update the low level code for +variant products + + + + 123 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501062848 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:05:20 + issues@ofbiz + + + + All + Add methods to check against classes, instead of only objects. + + + doogie + 2004-04-29 16:05:20 + This patch adds new versions of interfaceOf, isOrSubOf, and instanceOf, that +check against a class, instead of an Object. + + + doogie + 2004-04-29 16:06:57 + Created an attachment (id=52) +The patch. + + + + doogie + 2004-04-29 19:57:52 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 06:28:48 + This is now in CVS, thanks Adam! + + + text/plain + 52 + 2004-04-29 16:06:57 + The patch. + 1 + ObjectType-check-against-class.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/52/ObjectType-check-against-class.patch + + + doogie + 2004-04-29 16:06:57 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=52) +The patch. + + + + doogie + 2004-04-29 16:15:14 + issue_type + Issue Type + DEFECT + ENHANCEMENT + + + doogie + 2004-04-29 19:57:52 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 06:28:48 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 06:28:48 + resolution + Resolution + + FIXED + + + + 124 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501062855 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:08:48 + issues@ofbiz + + + + All + Handle is-* operators when value1 is null + + + doogie + 2004-04-29 16:08:48 + See $summary. + + + doogie + 2004-04-29 16:09:11 + Created an attachment (id=53) +The patch + + + + doogie + 2004-04-29 19:57:53 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 06:28:55 + This is now in CVS, thanks Adam! + + + text/plain + 53 + 2004-04-29 16:09:11 + The patch + 1 + ObjectType-is-compare-value1-null.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/53/ObjectType-is-compare-value1-null.patch + + + doogie + 2004-04-29 16:09:11 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=53) +The patch + + + + doogie + 2004-04-29 16:15:14 + issue_type + Issue Type + DEFECT + ENHANCEMENT + + + doogie + 2004-04-29 19:57:53 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 06:28:55 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 06:28:55 + resolution + Resolution + + FIXED + + + + 125 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501062903 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:10:04 + issues@ofbiz + + + + All + Convert classnames to full names. + + + doogie + 2004-04-29 16:10:04 + See $summary. + + + doogie + 2004-04-29 16:10:21 + Created an attachment (id=54) +The patch. + + + + doogie + 2004-04-29 19:57:48 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 06:29:03 + This is now in CVS, thanks Adam! + + + text/plain + 54 + 2004-04-29 16:10:21 + The patch. + 1 + ObjectType-convert-classname-to-full.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/54/ObjectType-convert-classname-to-full.patch + + + doogie + 2004-04-29 16:10:21 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=54) +The patch. + + + + doogie + 2004-04-29 16:15:13 + issue_type + Issue Type + DEFECT + ENHANCEMENT + + + doogie + 2004-04-29 19:57:48 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 06:29:03 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 06:29:03 + resolution + Resolution + + FIXED + + + + 126 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501062243 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:13:25 + issues@ofbiz + + + + All + Add some helper methods for objects implementing their own equals, compareTo, and hashCode + + + doogie + 2004-04-29 16:13:25 + Name: UtilObject.patch +Prune: 1 +Description: Add some helper methods for objects implementing their own equals, +compareTo, and hashCode. +DiffStat: + base/src/base/org/ofbiz/base/util/UtilObject.java | 35 ++++++++++++++++++++++ + 1 files changed, 35 insertions(+) + + + doogie + 2004-04-29 16:13:45 + Created an attachment (id=55) +The patch. + + + + doogie + 2004-04-29 19:57:49 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 06:22:43 + This is now in CVS, thanks Adam! + + + text/plain + 55 + 2004-04-29 16:13:45 + The patch. + 1 + UtilObject.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/55/UtilObject.patch + + + doogie + 2004-04-29 16:13:45 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=55) +The patch. + + + + doogie + 2004-04-29 16:15:13 + issue_type + Issue Type + DEFECT + ENHANCEMENT + + + doogie + 2004-04-29 19:57:49 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 06:22:43 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 06:22:43 + resolution + Resolution + + FIXED + + + + 127 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501055554 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:18:14 + issues@ofbiz + + + + All + Simplify the top-level build.xml + + + doogie + 2004-04-29 16:18:14 + Name: simpler-build.xml.patch +Prune: 1 +Description: Simplifies the top-level build.xml + This patch makes use of ant 1.6 features, to automate calling of sub + build.xmls. It also adds a 'test' target; note, however, that the + listed sub build.xmls don't actually have that test target yet. +DiffStat: + build.xml | 494 ++++---------------------------------------------------------- + 1 files changed, 32 insertions(+), 462 deletions(-) + + + doogie + 2004-04-29 16:18:43 + Created an attachment (id=56) +The patch. + + + + doogie + 2004-04-29 19:57:50 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 05:55:54 + This is now in, thanks Adam! + + + text/plain + 56 + 2004-04-29 16:18:43 + The patch. + 1 + simpler-build.xml.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/56/simpler-build.xml.patch + + + doogie + 2004-04-29 16:18:43 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=56) +The patch. + + + + doogie + 2004-04-29 16:19:44 + issue_type + Issue Type + DEFECT + ENHANCEMENT + + + doogie + 2004-04-29 19:57:50 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 05:55:54 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 05:55:54 + resolution + Resolution + + FIXED + + + + 128 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501051820 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:20:39 + issues@ofbiz + + + + All + Add support for formatting time intervals with human words + + + doogie + 2004-04-29 16:20:39 + Name: UtilDateTime-time-interval.patch +Prune: 1 +Description: Add support for formatting time intervals with human words +DiffStat: + base/config/DateTimeLabels.properties | 10 ++ + base/src/base/org/ofbiz/base/util/UtilDateTime.java | 90 ++++++++++++++++++++ + 2 files changed, 100 insertions(+) + + + doogie + 2004-04-29 16:20:57 + Created an attachment (id=57) +The patch. + + + + doogie + 2004-04-29 19:57:51 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 05:18:20 + These are now in CVS, thanks Adam! + + + text/plain + 57 + 2004-04-29 16:20:57 + The patch. + 1 + UtilDateTime-time-interval.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/57/UtilDateTime-time-interval.patch + + + doogie + 2004-04-29 16:20:58 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=57) +The patch. + + + + doogie + 2004-04-29 19:57:51 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 05:18:20 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 05:18:20 + resolution + Resolution + + FIXED + + + + 129 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040429172414 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:22:10 + issues@ofbiz + + + + All + Add more childElementList and firstChildElement variants. + + + doogie + 2004-04-29 16:22:10 + Name: UtilXml-childElementList-firstChildElement.patch +Prune: 1 +Depends: UtilXml-writeElement.patch +Description: Add more childElementList and firstChildElement variants. +DiffStat: + base/src/base/org/ofbiz/base/component/ComponentLoaderConfig.java + | 2 + base/src/base/org/ofbiz/base/util/UtilXml.java + | 80 ++++++++++ + components/content/src/org/ofbiz/content/widget/form/ModelFormField.java + | 4 + components/entity/src/org/ofbiz/entity/model/ModelViewEntity.java + | 2 + components/minilang/src/org/ofbiz/minilang/SimpleMethod.java + | 2 + components/minilang/src/org/ofbiz/minilang/method/callops/CallClassMethod.java + | 2 + components/minilang/src/org/ofbiz/minilang/method/callops/CallObjectMethod.java + | 2 + components/minilang/src/org/ofbiz/minilang/method/callops/CreateObject.java + | 2 + components/minilang/src/org/ofbiz/minilang/method/conditional/CombinedCondition.java +| 2 + components/minilang/src/org/ofbiz/minilang/method/conditional/MasterIf.java + | 2 + components/minilang/src/org/ofbiz/minilang/method/otherops/Calculate.java + | 4 + components/minilang/src/org/ofbiz/minilang/method/otherops/Log.java + | 2 + components/minilang/src/org/ofbiz/minilang/operation/MakeInString.java + | 2 + components/minilang/src/org/ofbiz/minilang/operation/SimpleMapProcess.java + | 2 + 14 files changed, 95 insertions(+), 15 deletions(-) + + + doogie + 2004-04-29 16:22:50 + Created an attachment (id=58) +The patch. + + + + doogie + 2004-04-29 16:57:47 + Changing priority to P2, as I need these applied before I can commit my entity +cache work. + + + jonesde + 2004-04-29 17:24:14 + Now in CVS, thanks Adam. + + + text/plain + 58 + 2004-04-29 16:22:50 + The patch. + 1 + UtilXml-childElementList-firstChildElement.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/58/UtilXml-childElementList-firstChildElement.patch + + + doogie + 2004-04-29 16:22:50 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=58) +The patch. + + + + doogie + 2004-04-29 16:57:47 + priority + Priority + P3 + P2 + + + jonesde + 2004-04-29 17:24:14 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-29 17:24:14 + resolution + Resolution + + FIXED + + + + 130 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040429174623 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:24:36 + issues@ofbiz + + + + All + put now returns the previous value of the object, if it exists + + + doogie + 2004-04-29 16:24:36 + Name: UtilCache-put-returns-object.patch +Prune: 1 +Depends: UtilCache-listeners.patch +Description: put now returns the previous value of the object, if it exists +DiffStat: + base/src/base/org/ofbiz/base/util/UtilCache.java | 16 ++++++++++------ + 1 files changed, 10 insertions(+), 6 deletions(-) + + + doogie + 2004-04-29 16:24:58 + Created an attachment (id=59) +The patch. + + + + doogie + 2004-04-29 16:57:48 + Changing priority to P2, as I need these applied before I can commit my entity +cache work. + + + jonesde + 2004-04-29 17:46:23 + Now in CVS, thanks Adam. + + + text/plain + 59 + 2004-04-29 16:24:58 + The patch. + 1 + UtilCache-put-returns-object.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/59/UtilCache-put-returns-object.patch + + + doogie + 2004-04-29 16:24:58 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=59) +The patch. + + + + doogie + 2004-04-29 16:57:48 + priority + Priority + P3 + P2 + + + jonesde + 2004-04-29 17:46:23 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-29 17:46:23 + resolution + Resolution + + FIXED + + + + 131 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040429174619 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 16:55:31 + issues@ofbiz + + + + All + Add getCacheLineKeys method. + + + doogie + 2004-04-29 16:55:31 + Name: UtilCache-getCacheLineKeys.patch +Prune: 1 +Depends: UtilCache-put-returns-object.patch +Description: Add getCacheLineKeys method. +DiffStat: + base/src/base/org/ofbiz/base/util/UtilCache.java | 4 ++++ + 1 files changed, 4 insertions(+) + + + doogie + 2004-04-29 16:55:56 + Created an attachment (id=60) +The patch. + + + + doogie + 2004-04-29 16:57:48 + Changing priority to P2, as I need these applied before I can commit my entity +cache work. + + + jonesde + 2004-04-29 17:46:19 + Now in CVS, thanks Adam. + + + text/plain + 60 + 2004-04-29 16:55:56 + The patch. + 1 + UtilCache-getCacheLineKeys.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/60/UtilCache-getCacheLineKeys.patch + + + doogie + 2004-04-29 16:55:56 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=60) +The patch. + + + + doogie + 2004-04-29 16:57:48 + priority + Priority + P3 + P2 + + + jonesde + 2004-04-29 17:46:19 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-04-29 17:46:19 + resolution + Resolution + + FIXED + + + + 132 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501051751 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 19:39:13 + issues@ofbiz + + + + All + Add entrySet(), which functions like Map.entrySet(). + + + doogie + 2004-04-29 19:39:13 + Name: UtilCache-entrySet.patch +Prune: 1 +Description: Add entrySet(), which functions like Map.entrySet(). +DiffStat: + base/src/base/org/ofbiz/base/util/UtilCache.java | 4 ++++ + 1 files changed, 4 insertions(+) + + + doogie + 2004-04-29 19:41:28 + Created an attachment (id=61) +The patch. + + + + doogie + 2004-04-29 19:57:53 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 05:17:51 + These are now in CVS, thanks Adam! + + + text/plain + 61 + 2004-04-29 19:41:27 + The patch. + 1 + UtilCache-entrySet.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/61/UtilCache-entrySet.patch + + + doogie + 2004-04-29 19:41:28 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=61) +The patch. + + + + doogie + 2004-04-29 19:57:53 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 05:17:51 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 05:17:51 + resolution + Resolution + + FIXED + + + + 133 + RESOLVED + P1 + FIXED + Base + CVS + All + issues@ofbiz + 20040501042628 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 19:42:19 + issues@ofbiz + + + + All + Add a new constructor. + + + doogie + 2004-04-29 19:42:19 + Name: UtilCache-new-constructor.patch +Prune: 1 +Depends: UtilCache-entrySet.patch +Description: Add a new constructor. +DiffStat: + base/src/base/org/ofbiz/base/util/UtilCache.java | 13 +++++++++++++ + 1 files changed, 13 insertions(+) + + + doogie + 2004-04-29 19:42:45 + Created an attachment (id=62) +The patch. + + + + doogie + 2004-04-29 19:57:48 + Changing priority, so that someone else can see the ones I want applied next. + + + doogie + 2004-04-30 10:42:15 + Changing these issuses, as they are needed by EntityCache.patch. + + + jonesde + 2004-05-01 04:26:28 + These are now in CVS, thanks Adam! + + + text/plain + 62 + 2004-04-29 19:42:45 + The patch. + 1 + UtilCache-new-constructor.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/62/UtilCache-new-constructor.patch + + + doogie + 2004-04-29 19:42:45 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=62) +The patch. + + + + doogie + 2004-04-29 19:57:48 + priority + Priority + P3 + P2 + + + doogie + 2004-04-30 10:42:15 + priority + Priority + P2 + P1 + + + jonesde + 2004-05-01 04:26:28 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 04:26:28 + resolution + Resolution + + FIXED + + + + 134 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501062248 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 19:43:49 + issues@ofbiz + + + + All + Change utilCacheTable to a WeakHashMap. + + + doogie + 2004-04-29 19:43:49 + Name: UtilCache-WeakHashMap.patch +Prune: 1 +Depends: UtilCache-new-constructor.patch +Description: Change utilCacheTable to a WeakHashMap. +DiffStat: + base/src/base/org/ofbiz/base/util/UtilCache.java | 3 ++- + 1 files changed, 2 insertions(+), 1 deletion(-) + + + doogie + 2004-04-29 19:44:39 + Created an attachment (id=63) +The patch. + + + + doogie + 2004-04-29 19:57:49 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 06:22:48 + This is now in CVS, thanks Adam! + + + text/plain + 63 + 2004-04-29 19:44:39 + The patch. + 1 + UtilCache-WeakHashMap.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/63/UtilCache-WeakHashMap.patch + + + doogie + 2004-04-29 19:44:39 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=63) +The patch. + + + + doogie + 2004-04-29 19:57:49 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 06:22:48 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 06:22:48 + resolution + Resolution + + FIXED + + + + 135 + RESOLVED + P1 + FIXED + Base + CVS + All + issues@ofbiz + 20040501042633 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 19:45:22 + issues@ofbiz + + + + All + Methods that clear a cache by name or pattern. + + + doogie + 2004-04-29 19:45:22 + Name: UtilCache-clearCache-helpers.patch +Prune: 1 +Depends: UtilCache-WeakHashMap.patch +Description: Methods that clear a cache by name or pattern. +DiffStat: + base/src/base/org/ofbiz/base/util/UtilCache.java | 22 ++++++++++++++++++++++ + 1 files changed, 22 insertions(+) + + + doogie + 2004-04-29 19:45:43 + Created an attachment (id=64) +The patch. + + + + doogie + 2004-04-29 19:57:49 + Changing priority, so that someone else can see the ones I want applied next. + + + doogie + 2004-04-30 10:42:16 + Changing these issuses, as they are needed by EntityCache.patch. + + + jonesde + 2004-05-01 04:26:33 + These are now in CVS, thanks Adam! + + + text/plain + 64 + 2004-04-29 19:45:43 + The patch. + 1 + UtilCache-clearCache-helpers.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/64/UtilCache-clearCache-helpers.patch + + + doogie + 2004-04-29 19:45:43 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=64) +The patch. + + + + doogie + 2004-04-29 19:57:49 + priority + Priority + P3 + P2 + + + doogie + 2004-04-30 10:42:16 + priority + Priority + P2 + P1 + + + jonesde + 2004-05-01 04:26:33 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 04:26:33 + resolution + Resolution + + FIXED + + + + 136 + RESOLVED + P2 + FIXED + Base + CVS + All + issues@ofbiz + 20040501064335 + Base + doogie + not determined + ENHANCEMENT + 2004-04-29 19:46:54 + issues@ofbiz + + + + All + Place the loaded document object in a UtilCache instance. + + + doogie + 2004-04-29 19:46:54 + Name: ResourceLoader-document-in-cache.patch +Prune: 1 +Depends: UtilCache-clearCache-helpers.patch +Description: Place the loaded document object in a UtilCache instance. +DiffStat: + base/src/base/org/ofbiz/base/config/ResourceLoader.java | 11 ++++------- + 1 files changed, 4 insertions(+), 7 deletions(-) + + + doogie + 2004-04-29 19:47:17 + Created an attachment (id=65) +The patch. + + + + doogie + 2004-04-29 19:57:50 + Changing priority, so that someone else can see the ones I want applied next. + + + jonesde + 2004-05-01 06:43:35 + This is now in CVS, thanks Adam! + + + text/plain + 65 + 2004-04-29 19:47:17 + The patch. + 1 + ResourceLoader-document-in-cache.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/65/ResourceLoader-document-in-cache.patch + + + doogie + 2004-04-29 19:47:17 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=65) +The patch. + + + + doogie + 2004-04-29 19:57:50 + priority + Priority + P3 + P2 + + + jonesde + 2004-05-01 06:43:35 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-01 06:43:35 + resolution + Resolution + + FIXED + + + + 137 + RESOLVED + P3 + FIXED + Components + CVS + All + ajzeneski + 20040527233355 + Accounting + sichen + not determined + DEFECT + 2004-05-03 14:48:41 + issues@ofbiz + + + + All + createInvoiceForOrder not get correct fields for terms + + + 141 + jacopo + 2004-05-26 10:48:21 + + + sichen + 2004-05-03 14:48:41 + InvoiceServices.createInvoiceForOrder is not getting correct fields for terms. +It is not automatically generating a key for InvoiceTerm entity and is also +looking for "termType" from BillingAccount when the field is actually "termTypeId." + + + sichen + 2004-05-03 14:50:09 + Created an attachment (id=66) +Patch fixes defect and allows invoices to be created correctly + + + + jacopo + 2004-05-04 00:50:17 + See also issue #97 + + + jacopo + 2004-05-26 10:48:20 + *** Issue 141 has been marked as a duplicate of this issue. *** + + + jonesde + 2004-05-27 23:33:55 + It's now in CVS, thanks to both Si Chen and Jacopo Cappellato for reporting/fixing this. + + + text/plain + 66 + 2004-05-03 14:50:09 + Patch fixes defect and allows invoices to be created correctly + 1 + InvoiceServices.java.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/66/InvoiceServices.java.patch + + + sichen + 2004-05-03 14:50:09 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=66) +Patch fixes defect and allows invoices to be created correctly + + + + jonesde + 2004-05-03 23:03:12 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + jonesde + 2004-05-27 23:33:55 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-05-27 23:33:55 + resolution + Resolution + + FIXED + + + + 138 + RESOLVED + P3 + WORKSFORME + Components + CVS + All + issues@ofbiz + 20040713022331 + Manufacturing + sichen + not determined + DEFECT + 2004-05-04 17:45:50 + issues@ofbiz + + + + Windows XP + Null delegator in FindProductRun + + + sichen + 2004-05-04 17:45:50 + I am getting a +4269781[ VisitHandler.java:130:ERROR] Could not find delegator with +delegatorName [null] in session, not creating Visit entity + +Is this a Windows problem or a bug? + +Thanks, + +Si Chen + + + sichen + 2004-05-04 17:46:33 + Created an attachment (id=67) +error log from running FindProductRun in Manufacturing + + + + jacopo + 2004-07-13 02:23:31 + I couldn't recreate this error. +However, from the log it seems something related to the Visit stuff. + + + text/plain + 67 + 2004-05-04 17:46:33 + error log from running FindProductRun in Manufacturing + + findproductrun.log + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/67/findproductrun.log + + + sichen + 2004-05-04 17:46:33 + attachments.thedata + Attachment Data + + Created an attachment (id=67) +error log from running FindProductRun in Manufacturing + + + + jacopo + 2004-07-13 02:23:31 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-07-13 02:23:31 + resolution + Resolution + + WORKSFORME + + + + 139 + NEW + P3 + + Components + CVS + All + david + 20040509064322 + E-Commerce + arukala + not determined + FEATURE + 2004-05-09 06:43:22 + issues@ofbiz + + + + All + Reading UiLable Properties in Email templates + + + arukala + 2004-05-09 06:43:22 + Hallo David, + +We are looking for your suggestions. on how should i call the UiLabel +Properties in eCommerce Email Templates. we are eager to see this feature in +email Confirmation after placing an order for customers?. suggest us how to? + + + + 140 + RESOLVED + P3 + FIXED + Components + CVS + All + jacopo + 20040518040000 + Manufacturing + jacopo + not determined + ENHANCEMENT + 2004-05-11 08:26:52 + issues@ofbiz + + + + All + Remove all the checks against the isVariant field. + + + jacopo + 2004-05-11 08:26:52 + Remove all the checks against the isVariant field: the best way to see if a +product is variant is to check the ProductAssoc entity. + + + jacopo + 2004-05-18 04:00:00 + Committed with the last changes a few days ago. + + + jacopo + 2004-05-18 04:00:00 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-05-18 04:00:00 + resolution + Resolution + + FIXED + + + + 141 + RESOLVED + P3 + DUPLICATE + Components + CVS + All + issues@ofbiz + 20040526104821 + Accounting + jacopo + not determined + PATCH + 2004-05-26 09:01:42 + issues@ofbiz + + + + All + Patch for bug in invoice creation when terms are specified for a billing account. + + + 137 + jacopo + 2004-05-26 10:48:21 + + + jacopo + 2004-05-26 09:01:42 + Patch for bug in invoice creation when terms are specified for billing account: +A wrong field name was used. +Also a non-null field was not set. + + + jacopo + 2004-05-26 09:02:49 + Created an attachment (id=68) +The patch file in UOF + + + + jacopo + 2004-05-26 10:48:21 + Ok, Si Chen had already fixed this!!! + +*** This issue has been marked as a duplicate of 137 *** + + + text/plain + 68 + 2004-05-26 09:02:49 + The patch file in UOF + 1 + InvoiceServices.java.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/68/InvoiceServices.java.patch + + + jacopo + 2004-05-26 09:02:49 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=68) +The patch file in UOF + + + + jacopo + 2004-05-26 10:48:21 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-05-26 10:48:21 + resolution + Resolution + + DUPLICATE + + + + 142 + RESOLVED + P3 + FIXED + Components + CVS + PC + ajzeneski + 20040630194530 + Party + jackhung + not determined + DEFECT + 2004-06-15 03:33:20 + issues@ofbiz + + + + Linux + Party Profile [New Communication] throws exception + + + jackhung + 2004-06-15 03:33:20 + Error: The application script threw an exception: Sourced file: +/mnt/hda6/jackwork/ofbiz3/workspace/ofbiz/components/party/webapp/partymgr/WEB-INF/actions/communication/editCommunication.bsh +: null : at Line: 47 : in file: +/mnt/hda6/jackwork/ofbiz3/workspace/ofbiz/components/party/webapp/partymgr/WEB-INF/actions/communication/editCommunication.bsh +: party .getRelatedOne ( "Person" ) Target exception: +java.lang.NullPointerException: Null Pointer in Method Invocation BSF info: +/mnt/hda6/jackwork/ofbiz3/workspace/ofbiz/components/party/webapp/partymgr/WEB-INF/actions/communication/editCommunication.bsh +at line: 0 column: 0 + + +URL: https://jhpc:18443/partymgr/control/viewCommunicationEvent?partyIdFrom=ltdadmin + +partyId = request.getParameter("party_id"); +... +party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); +context.put("party", party); +context.put("lookupPerson", party.getRelatedOne("Person")); <--- + + + ajzeneski + 2004-06-30 19:45:30 + This has been fixed in CVS + + + jonesde + 2004-06-15 03:39:27 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-06-30 19:45:30 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-06-30 19:45:30 + resolution + Resolution + + FIXED + + + + 143 + NEW + P3 + + Components + CVS + All + ajzeneski + 20040630194322 + Order + sichen + not determined + FEATURE + 2004-06-17 10:51:48 + issues@ofbiz + + + + All + Allows orders to have shipBeforeDate and shipAfterDate + + + sichen + 2004-06-17 10:51:48 + Changed ShoppingCart.java and CheckoutHelper.java to allow ship before and +after dates to be set using the OrderShipmentPreference entity. +OrderServices.java is modified as well to allow these dates to go on the order +confirmation email. + + + sichen + 2004-06-17 10:53:16 + Created an attachment (id=69) +Patches ShoppingCart.java, CheckoutHelper.java, OrderServices.java, + + + + text/plain + 69 + 2004-06-17 10:53:16 + Patches ShoppingCart.java, CheckoutHelper.java, OrderServices.java, + 1 + order_dating_patch.txt + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/69/order_dating_patch.txt + + + sichen + 2004-06-17 10:53:16 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=69) +Patches ShoppingCart.java, CheckoutHelper.java, OrderServices.java, + + + + ajzeneski + 2004-06-30 19:43:22 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + ajzeneski + 2004-06-30 19:43:22 + short_desc + Summary + Allows orders to have shipBeforeDate and shipAfterDate + Allows orders to have shipBeforeDate and shipAfterDate + + + + 144 + RESOLVED + P3 + WORKSFORME + Base + CVS + PC + issues@ofbiz + 20040630194017 + Base + jackhung + not determined + DEFECT + 2004-06-18 02:57:10 + issues@ofbiz + + + + Linux + https connection broke Mozilla 1.3 and 1.4 + + + jackhung + 2004-06-18 02:57:10 + I'm getting a strange problem lately (2 days). I'm at the ecommerce's main page +and try to [Login] (url +https://www.myhost.net:8443/ecommerce/control/checkLogin/main). The +certification stuff comes up and I accepted it. On one of my system using +Mozilla 1.3, the browser popup a dialog saying: + "www.myhost.net has received an incorrect or unexpected message. Error Code: +-12229" +For all subsequent attempt, the browser popup a dialog saying: + "The Document contains no data" +It appears that the browser is not sending any request to the server on +subsequent attempt. + +On another system using Mozilla 1.4, i did not get the "unexpected message", but +still got the "no data" one. + +I have an Crozilla 1.3a browser around (from the Mozilla SVG project). I tried +it and it works!! + +As a matter of fact, i'm having the same problem with any of the secure +components (webtools, partymgr, ...) + + + ajzeneski + 2004-06-30 19:40:17 + I cannot duplicate this issue with FireFox. It could be a bug in that version of mozilla. Is this still an +issue w/ the 1.5-1.7? + + + ajzeneski + 2004-06-30 19:40:17 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-06-30 19:40:17 + resolution + Resolution + + WORKSFORME + + + + 145 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040619093839 + Party + sichen + not determined + PATCH + 2004-06-18 09:57:41 + issues@ofbiz + + + + All + Fixes duplicated PartyContactMechPurposes when using updatePartyContactMech + + + sichen + 2004-06-18 09:57:41 + Fixes duplicated PartyContactMechPurposes when using updatePartyContactMech to +move a party's contact information from an old contactMechId to a +newContactMechId by checking to make sure the PartyContactMechPurpose does not +already exist. + + + sichen + 2004-06-18 09:58:34 + Created an attachment (id=70) +Patches PartyContactMechServices.xml + + + + jonesde + 2004-06-19 09:38:39 + It's in CVS now. Thanks Si. + + + text/plain + 70 + 2004-06-18 09:58:34 + Patches PartyContactMechServices.xml + 1 + PartyContactMechServices.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/70/PartyContactMechServices.patch + + + sichen + 2004-06-18 09:58:34 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=70) +Patches PartyContactMechServices.xml + + + + jonesde + 2004-06-19 09:38:39 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-06-19 09:38:39 + resolution + Resolution + + FIXED + + + + 146 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040622094557 + Party + sichen + not determined + PATCH + 2004-06-21 17:56:29 + issues@ofbiz + + + + All + Passes partyId into updatePostalAddress from updatepartyPostalAddress + + + sichen + 2004-06-21 17:56:29 + Passes partyId into updatePostalAddress from updatePartyPostalAddress, to +preserve it for updateCreditCard later. + + + sichen + 2004-06-21 17:57:02 + Created an attachment (id=71) +Passes partyId from updatePartyPostalAddress to updatePostalAddress + + + + jonesde + 2004-06-22 09:45:57 + It's in. Thanks Si Chen. + + + text/plain + 71 + 2004-06-21 17:57:02 + Passes partyId from updatePartyPostalAddress to updatePostalAddress + 1 + PartyContactMechServices.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/71/PartyContactMechServices.patch + + + sichen + 2004-06-21 17:57:02 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=71) +Passes partyId from updatePartyPostalAddress to updatePostalAddress + + + + jonesde + 2004-06-22 09:45:57 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-06-22 09:45:57 + resolution + Resolution + + FIXED + + + + 147 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040623161518 + Product + sichen + not determined + ENHANCEMENT + 2004-06-22 15:58:48 + issues@ofbiz + + + + All + Minor additions to calculateProductPrice + + + sichen + 2004-06-22 15:58:48 + Implements a "Percent of Default Price" price action for price rules and checks +both default and list prices when there is a "Promotional Price Override" price +action. + + + sichen + 2004-06-22 15:59:22 + Created an attachment (id=72) +minor additions to calculateProductPrice + + + + jonesde + 2004-06-23 16:15:18 + Okay, this patch is in. Thanks for working on this and sending it over Si. + + + text/plain + 72 + 2004-06-22 15:59:22 + minor additions to calculateProductPrice + 1 + calculateProductPrice.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/72/calculateProductPrice.patch + + + sichen + 2004-06-22 15:59:22 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=72) +minor additions to calculateProductPrice + + + + jonesde + 2004-06-23 16:15:18 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-06-23 16:15:18 + resolution + Resolution + + FIXED + + + + 148 + RESOLVED + P2 + WORKSFORME + Components + CVS + All + ajzeneski + 20040730233418 + Accounting + jacopo + not determined + DEFECT + 2004-06-23 05:42:27 + issues@ofbiz + + + + All + Duplicate invoices for the same order under some cicumstances. + + + jacopo + 2004-06-23 05:42:27 + With "Offline Payments", from the order detail page it is possible to +receive payments: when the payments cover the order's grand total an invoice +is generated; also when the shipment to which the order is issued changes +its status to PACKED an invoice is created: this can cause the creation +of two different invoices for the same order. + + + ajzeneski + 2004-07-30 21:11:52 + I cannot duplicate this problem; I attempted an offline order, received the payment - no invoice was +created; issued a quick ship a single invoice was created. Please provide more details. + + + jacopo + 2004-07-30 23:34:18 + I cannot believe... I have tried again and the problem is gone away. +However I'm totally sure (99%) that this was an issue... + + + + jonesde + 2004-06-23 16:16:30 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + jacopo + 2004-07-30 23:34:18 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-07-30 23:34:18 + resolution + Resolution + + WORKSFORME + + + + 149 + RESOLVED + P3 + FIXED + Components + CVS + All + ajzeneski + 20040818085225 + Order + jacopo + not determined + PATCH + 2004-06-26 01:51:16 + issues@ofbiz + + + + All + Patch for bug that happens when you try to cancel an order item. + + + jacopo + 2004-06-26 01:51:16 + In revision 1.30 of the services.xml file for the order component, the require- +new-transaction="true" was added to the resetGrandTotal service: this causes +problems when you cancel an order item because the resetGrandTotal is one of +the services that are triggered and it seems to hang up the process waiting for +a transaction (at least this happens with SAP-DB). + +The attached patch removes the require-new-transaction="true" parameter and +this solves the problem; however I don't know if this could cause other +problems in different parts of the system. + + + jacopo + 2004-06-26 01:51:58 + Created an attachment (id=73) +Patch in UOF + + + + jacopo + 2004-08-18 08:52:25 + The patch has been applied. + + + text/plain + 73 + 2004-06-26 01:51:58 + Patch in UOF + 1 + services.xml.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/73/services.xml.patch + + + jacopo + 2004-06-26 01:51:58 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=73) +Patch in UOF + + + + jacopo + 2004-08-18 08:52:25 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-08-18 08:52:25 + resolution + Resolution + + FIXED + + + + 150 + RESOLVED + P3 + FIXED + Components + CVS + All + ajzeneski + 20040630190556 + Order + jacopo + not determined + PATCH + 2004-06-26 01:56:29 + issues@ofbiz + + + + All + When you receive a purchase order the order lines are declared completed (also multiple times) even if it's not true. + + + jacopo + 2004-06-26 01:56:29 + The attached patch fixes two bugs that caused the problem. + + + jacopo + 2004-06-26 01:56:53 + Created an attachment (id=74) +Tha patch in UOF + + + + ajzeneski + 2004-06-30 19:05:56 + patch applied to CVS + + + text/plain + 74 + 2004-06-26 01:56:53 + Tha patch in UOF + 1 + OrderSimpleMethods.xml.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/74/OrderSimpleMethods.xml.patch + + + jacopo + 2004-06-26 01:56:53 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=74) +Tha patch in UOF + + + + ajzeneski + 2004-06-30 19:05:56 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-06-30 19:05:56 + resolution + Resolution + + FIXED + + + + 151 + RESOLVED + P3 + FIXED + Components + CVS + All + ajzeneski + 20040630224402 + Order + jacopo + not determined + PATCH + 2004-06-26 02:01:14 + issues@ofbiz + + + + All + In order entry, if no party is selected, during the checkout process some errors are generated: this patch fix the problem by disabling the checkout link if the party is missing. + + + jacopo + 2004-06-26 02:01:14 + In order entry, if no party is selected, during the checkout process some +errors are generated: this patch fix the problem by disabling the checkout link +if the party is missing. + + + jacopo + 2004-06-26 02:01:41 + Created an attachment (id=75) +Patch in UOF + + + + ajzeneski + 2004-06-30 19:19:39 + I cannot duplicate this issue; is it still a problem? + + + jacopo + 2004-06-30 22:44:02 + Hmmm, now it seems to work for me, too. +I'm wondering if something is changed during the last 10 days... I was quite +sure about this problem. +By the way, I'm going to declare resolved this issue, thanks. + + + + text/plain + 75 + 2004-06-26 02:01:41 + Patch in UOF + 1 + noparty.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/75/noparty.patch + + + jacopo + 2004-06-26 02:01:41 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=75) +Patch in UOF + + + + jacopo + 2004-06-30 22:44:02 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-06-30 22:44:02 + resolution + Resolution + + FIXED + + + + 152 + RESOLVED + P4 + LATER + Components + CVS + All + ajzeneski + 20040630192805 + Order + jacopo + not determined + PATCH + 2004-06-26 02:13:57 + issues@ofbiz + + + + All + Shipping location is missing in purchase orders: this causes problems when you try to cancel an order item. + + + jacopo + 2004-06-26 02:13:57 + In purchase order the shipping location address is not set and this causes +problems when you try to cancel order items (the shipping location is used is +some service that are triggered in this situation, such as the calcTax service +etc...). +In my opinion the best solution is to add a shipping location address to the +purchase order. +The address could be that of the facility that will receive the po. + +I have also attached a patch (not a good one, so probably you shouldn't apply +it) that fix this problem by allowing, during order entry, to select one of the +addresses of the facility that is linked to the productStore for which the +purchase order is taken: so in the checkinits page the store selection should +be enabled for purchase orders too. + + + jacopo + 2004-06-26 02:14:21 + Created an attachment (id=76) +Patch in UOF + + + + ajzeneski + 2004-06-30 19:28:05 + Sounds like there are more issues here. First off most likely tax should not be calculated for purchase +orders; nor should the same shipping charges which apply to sales orders should not apply to purchase +orders. + +I will see what I can do when working on some additional PO enhancements. + + + text/plain + 76 + 2004-06-26 02:14:20 + Patch in UOF + 1 + shipping_address.patch + 194 + jacopo + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/76/shipping_address.patch + + + jacopo + 2004-06-26 02:14:22 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=76) +Patch in UOF + + + + ajzeneski + 2004-06-30 19:28:05 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-06-30 19:28:05 + resolution + Resolution + + LATER + + + + 153 + NEW + P5 + + Components + CVS + All + ajzeneski + 20040707011403 + Service + eckardjf + not determined + DEFECT + 2004-07-05 12:19:00 + issues@ofbiz + + + + All + purgeOldJobs service leaves artifacts + + + eckardjf + 2004-07-05 12:19:00 + The purgeOldJobs service will remove qualifying JobSandbox entities, but will not remove the related +RuntimeData, RecurrenceInfo and RecurrenceRule entities (even if they are not referenced by an +existing WorkEffort). + + + jonesde + 2004-07-07 01:14:03 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + + 154 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040707150844 + Content + doogie + not determined + DEFECT + 2004-07-06 12:49:26 + issues@ofbiz + + + + All + Unknown import + + + doogie + 2004-07-06 12:49:26 + Region.java imports com.sun.rsasign.r. When compiling with jikes, this class is +not available. Removing the import, and the class compiles fine, so it's +obviously not needed. + + + doogie + 2004-07-06 12:49:58 + Created an attachment (id=77) +Remove the bad import + + + + jonesde + 2004-07-07 15:08:44 + This import has now been removed, not even sure why it was there in the first place... Thanks Adam. + + + text/plain + 77 + 2004-07-06 12:49:58 + Remove the bad import + 1 + Region.java.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/77/Region.java.patch + + + doogie + 2004-07-06 12:49:58 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=77) +Remove the bad import + + + + jonesde + 2004-07-07 15:08:44 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-07 15:08:44 + resolution + Resolution + + FIXED + + + + 155 + RESOLVED + P3 + FIXED + Base + CVS + All + issues@ofbiz + 20040707011249 + Base + doogie + not determined + DEFECT + 2004-07-06 14:27:26 + issues@ofbiz + + + + All + UtilCache does not allow for null keys + + + doogie + 2004-07-06 14:27:26 + UtilCache doesn't allow null keys to be stored. This is sub-optimal, and +actually causes problems with my enhanced entity cache code. Attached patch fixes. + + + doogie + 2004-07-06 14:28:17 + Created an attachment (id=78) +Allow for null keys + + + + jonesde + 2004-07-07 01:12:49 + This is now in CVS, thanks Adam! + + + text/plain + 78 + 2004-07-06 14:28:17 + Allow for null keys + 1 + UtilCache-null-key.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/78/UtilCache-null-key.patch + + + doogie + 2004-07-06 14:28:17 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=78) +Allow for null keys + + + + jonesde + 2004-07-07 01:12:49 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-07 01:12:49 + resolution + Resolution + + FIXED + + + + 156 + RESOLVED + P3 + FIXED + Base + CVS + All + issues@ofbiz + 20040707011312 + Base + doogie + not determined + ENHANCEMENT + 2004-07-06 14:30:09 + issues@ofbiz + + + + All + Allow specifying the expire time on put in UtilCache + + + doogie + 2004-07-06 14:30:09 + Add a new put method, that takes an expireTime parameter. + + + doogie + 2004-07-06 14:30:31 + Created an attachment (id=79) +The patch. + + + + jonesde + 2004-07-07 01:13:12 + This is now in CVS, thanks Adam! + + + text/plain + 79 + 2004-07-06 14:30:31 + The patch. + 1 + UtilCache-put-takes-expireTime.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/79/UtilCache-put-takes-expireTime.patch + + + doogie + 2004-07-06 14:30:31 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=79) +The patch. + + + + jonesde + 2004-07-07 01:13:12 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-07 01:13:12 + resolution + Resolution + + FIXED + + + + 157 + RESOLVED + P3 + FIXED + Base + CVS + All + issues@ofbiz + 20040707011225 + Base + doogie + not determined + ENHANCEMENT + 2004-07-06 14:35:33 + issues@ofbiz + + + + All + In UtilCache, allow for a list of property bases to be specified + + + doogie + 2004-07-06 14:35:33 + When a UtilCache instance is created, it currently will only look for a single +matching property value, by name. This patch allows for a list of base property +names to be specified, and the first one found will be used. + +I make use of this in my entity cache code. For instance: +== +Cache.entity-list.${delegator-name}.${entity-name}.expireTime=1800000 +Cache.entity-list.${delegator-name}.${entity-name}.maxSize=500 + +# high count, low access +# 5 minute cache time +Cache.entity-list.${delegator-name}.PartyAttribute=300000 +== + + + doogie + 2004-07-06 14:35:48 + Created an attachment (id=80) +The patch + + + + jonesde + 2004-07-07 01:12:25 + This is now in CVS, thanks Adam! + + + text/plain + 80 + 2004-07-06 14:35:48 + The patch + 1 + UtilCache-wildcard-config.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/80/UtilCache-wildcard-config.patch + + + doogie + 2004-07-06 14:35:48 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=80) +The patch + + + + jonesde + 2004-07-07 01:12:25 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-07 01:12:25 + resolution + Resolution + + FIXED + + + + 158 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040707011838 + Product + sichen + not determined + DEFECT + 2004-07-06 17:08:44 + issues@ofbiz + + + + All + distinct attribute for getProductFeatures is not working + + + sichen + 2004-07-06 17:08:44 + distinct attribute for getProductFeatures service does not work because it is +trying to use ProductFeatureType rather than ProductFeatureTypeId in +ProductServices.prodGetFeatures + + + sichen + 2004-07-06 17:16:51 + Created an attachment (id=81) +Corrects productFeatureType to productFeatureTypeId + + + + jonesde + 2004-07-07 01:18:38 + It's in CVS now, thanks Si! + + + text/plain + 81 + 2004-07-06 17:16:51 + Corrects productFeatureType to productFeatureTypeId + 1 + ProductServices_1.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/81/ProductServices_1.patch + + + sichen + 2004-07-06 17:16:51 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=81) +Corrects productFeatureType to productFeatureTypeId + + + + jonesde + 2004-07-07 01:18:38 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-07 01:18:38 + resolution + Resolution + + FIXED + + + + 159 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040707012137 + Product + sichen + not determined + ENHANCEMENT + 2004-07-06 17:26:05 + issues@ofbiz + + + + All + Adds productFeatureApplTypeId field to getProductFeatureSet service + + + sichen + 2004-07-06 17:26:05 + Adds productFeatureApplTypeId as optional field to getProductFeatureSet service. + If none is specified, it will still search for "SELECTABLE_FEATURE"s (to be +compatible with existing code), but if one is specified, it will use that +productFeatureApplTypeId, so the same service can now be used to search for +STANDARD, DISTINGUISHING, OPTIONAL features. + + + sichen + 2004-07-06 17:27:49 + Created an attachment (id=82) +Extends getProductFeatures with optional productFeatureApplTypeId field + + + + jonesde + 2004-07-07 01:21:37 + It's in CVS now, thanks Si! + + + text/plain + 82 + 2004-07-06 17:27:49 + Extends getProductFeatures with optional productFeatureApplTypeId field + 1 + ProductServices_2.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/82/ProductServices_2.patch + + + sichen + 2004-07-06 17:27:49 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=82) +Extends getProductFeatures with optional productFeatureApplTypeId field + + + + jonesde + 2004-07-07 01:21:37 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-07 01:21:37 + resolution + Resolution + + FIXED + + + + 160 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040707144701 + Entity Extensions + doogie + not determined + ENHANCEMENT + 2004-07-07 07:27:45 + issues@ofbiz + + + + All + implement condition versions of functions in entityext + + + doogie + 2004-07-07 07:27:45 + I had sent an earlier version of this patch to the mailing list. I'm now adding +it as an issue, as I have for all the other patches. + + + doogie + 2004-07-07 07:28:22 + Created an attachment (id=83) +The patch + + + + jonesde + 2004-07-07 14:47:01 + This is now in CVS. Thanks Adam! + + + text/plain + 83 + 2004-07-07 07:28:22 + The patch + 1 + cache-entityext.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/83/cache-entityext.patch + + + doogie + 2004-07-07 07:28:22 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=83) +The patch + + + + jonesde + 2004-07-07 14:47:01 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-07 14:47:01 + resolution + Resolution + + FIXED + + + + 161 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040708153407 + WebTools + doogie + not determined + DEFECT + 2004-07-08 11:51:01 + issues@ofbiz + + + + All + NPE in FindUtilCacheElements.jsp + + + doogie + 2004-07-08 11:51:01 + Missed one NPE when key is null(calls key.toString()). + + + doogie + 2004-07-08 11:51:22 + Created an attachment (id=84) +The patch + + + + jonesde + 2004-07-08 15:34:07 + Thanks Adam, it is now in CVS. + + + text/plain + 84 + 2004-07-08 11:51:22 + The patch + 1 + FindUtilCacheElements.jsp.patch + 270 + doogie + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/84/FindUtilCacheElements.jsp.patch + + + doogie + 2004-07-08 11:51:22 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=84) +The patch + + + + jonesde + 2004-07-08 15:34:07 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-08 15:34:07 + resolution + Resolution + + FIXED + + + + 162 + RESOLVED + P3 + WORKSFORME + Components + CVS + All + issues@ofbiz + 20040713170819 + Workflow + ktippetts + not determined + DEFECT + 2004-07-12 09:32:42 + issues@ofbiz + + + + Linux + NoSuchMethodError in Entity Data Maintenance + + + ktippetts + 2004-07-12 09:32:42 + Getting this error when trying to view entity data in Webtools | Entity Data +Maintenance: + +<snip> +Exception: java.lang.NoSuchMethodError +Message: +org.ofbiz.entity.condition.EntityFieldMap.<init>(Ljava/util/Map;Lorg/ofbiz/entity/condition/EntityOperator;)V +----- stack trace ---------------------------------------- +java.lang.NoSuchMethodError: +org.ofbiz.entity.condition.EntityFieldMap.<init>(Ljava/util/Map;Lorg/ofbiz/entity/condition/EntityOperator;)V +org.apache.jsp.entity.FindGeneric_jsp._jspService(FindGeneric_jsp.java:159) +<snip> + +To duplicate Using CVS code as of 09Jul2004: +* Webtools > Entity Data Maintenance +* Click 'All' on any entity. + +Possible Solution: +* in FindGeneric.jsp (line 94) change 2nd parameter to EntityJoinOperator.AND + + + jonesde + 2004-07-12 20:41:10 + This works fine from a clean compile, but if have partial old code and partial new code in a build it may +have problems. Try an "ant clean" and then an "ant". + + + doogie + 2004-07-13 17:08:19 + The signature of the constructor changed. It used to take an EntityOperator. +However, the code only accepted an EntityJoinOperator. Passing in an +EntityComparisonOperator would have caused it to fail. + +Also, running ant clean will *not* fix the problem. The parsed/compiled jsp +pages need to be cleaned out. + + + jonesde + 2004-07-12 20:41:10 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-07-12 20:41:10 + resolution + Resolution + + WORKSFORME + + + + 163 + RESOLVED + P3 + INVALID + Documentation + CVS + All + issues@ofbiz + 20040730150851 + website + michaelrempel + not determined + TASK + 2004-07-13 11:11:43 + issues@ofbiz + + + + All + cant get csv instructions + + + michaelrempel + 2004-07-13 11:11:43 + When I pull up csv instructions for either the wincsv or command line, I get a +logon request screen, even though I am logged on. + +Thx + +Michael Rempel + + + ajzeneski + 2004-07-30 15:08:51 + This is a java.net related issue not OFBiz; please contact the Java.Net team for help. + + + ajzeneski + 2004-07-30 15:08:51 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 15:08:51 + resolution + Resolution + + INVALID + + + + 164 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040730204811 + Security + adrianc + not determined + DEFECT + 2004-07-14 12:24:23 + issues@ofbiz + + + + All + SecurityData.xml File + + + adrianc + 2004-07-14 12:24:23 + From mailing list: + +On Jul 14, 2004, at 12:03 PM, Adrian Crum wrote: + +> I was just wondering... +> +> Why is the security data for ALL components in the SecurityData.xml file? This +file looks monolithic. Shouldn't each component load its own security data? +> +> -Adrian + + +Adrian, + +Yes, good point, monolithic is a good word for this. Ideally it should be split +up, I think that's a good idea. + +If anyone wants to work on this please do... In the mean time it might be a good +idea to create an issue for it. + +-David + + + ajzeneski + 2004-07-30 20:48:11 + applied patch file(s); now in CVS + + + ajzeneski + 2004-07-30 20:48:11 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 20:48:11 + resolution + Resolution + + FIXED + + + + 165 + RESOLVED + P4 + FIXED + Components + CVS + All + ajzeneski + 20040730065021 + Order + pgoron + not determined + PATCH + 2004-07-15 06:34:37 + issues@ofbiz + + + + All + Allow user to specify default value for desired delivery date and comment fields in order entry GUI + + + pgoron + 2004-07-15 06:34:37 + This patch allows user to define default desired delivery date and default +comment during quickaddform filling in OrderEntry page. Thus, users are not +obliged any more to reinput these informations for each order item. + + + pgoron + 2004-07-15 06:35:35 + Created an attachment (id=85) +The patch + + + + jacopo + 2004-07-30 06:50:21 + The patch is in CVS. + + + text/plain + 85 + 2004-07-15 06:35:35 + The patch + 1 + order20040707.patch + 392 + pgoron + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/85/order20040707.patch + + + pgoron + 2004-07-15 06:35:35 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=85) +The patch + + + + jonesde + 2004-07-15 16:16:54 + assigned_to + Assigned To + issues@ofbiz + ajzeneski + + + jonesde + 2004-07-15 16:16:54 + issue_type + Issue Type + ENHANCEMENT + PATCH + + + jacopo + 2004-07-30 06:50:21 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-07-30 06:50:21 + resolution + Resolution + + FIXED + + + + 166 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040730115233 + Order + pgoron + not determined + PATCH + 2004-07-21 02:46:56 + issues@ofbiz + + + + All + Allow user to associate parties to an order in OrderEntry website + + + pgoron + 2004-07-21 02:46:56 + Hi, + +Currently, I did not found any way to associate additional parties to an order. +That's why I've written this enhancement patch. + + +This patch adds a new step during order entry in which user can associate +additional party&role to order. Then, these informations are stored in OrderRole +entity. + + +List of modifications : +- I've written a new view in which user can select a party and party's role to +associate to order ++ webapp/ordermgr/entry/SetAdditionalParty.ftl ++ webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.bsh ++ webapp/ordermgr/WEB-INF/pagedefs/entry/SetAdditionalParty.xml ++ webapp/ordermgr/entry/AdditionalPartyListing.ftl ++ webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.bsh ++ webapp/ordermgr/entry/PartySettingsForm.xml +M webapp/ordermgr/WEB-INF/controller.xml + +- I've included list of additional parties associated to order in confimorder view +M webapp/ordermgr/entry/confirmorder.ftl +M webapp/ordermgr/WEB-INF/pagedefs/entry/confirmorder.xml + +- I've modified these files so that my view is shown before order confirmation +M src/org/ofbiz/order/shoppingcart/CheckOutEvents.java +M webapp/ordermgr/entry/showcart.ftl + +- I've modified storeOrder service and ShoppingCart to take in account +additional parties. +M servicedef/services.xml +M src/org/ofbiz/order/order/OrderServices.java +M src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java +M src/org/ofbiz/order/shoppingcart/ShoppingCart.java + +- I've copied some files from content module to be able to use GenericLookup. ++ src/org/ofbiz/order/lookupParams.java ++ webapp/ordermgr/lookup/FieldLookupForms.xml ++ webapp/ordermgr/lookup/GenericLookup.ftl ++ webapp/ordermgr/templates/lookup.ftl ++ webapp/ordermgr/templates/lookup.xml ++ webapp/ordermgr/WEB-INF/actions/includes/findprepLk.bsh ++ webapp/ordermgr/WEB-INF/actions/includes/formprep.bsh ++ webapp/ordermgr/WEB-INF/actions/includes/pagelistprepLk.bsh ++ webapp/ordermgr/WEB-INF/pagedefs/lookup/GenericLookup.xml + + + pgoron + 2004-07-21 02:47:42 + Created an attachment (id=86) +The patch + + + + pgoron + 2004-07-22 00:38:39 + I've found some minor mistakes. I am correcting them and I will send a new patch +as soon as possible. + + + pgoron + 2004-07-22 01:29:07 + Created an attachment (id=87) +The corrected patch + + + + jacopo + 2004-07-30 11:52:33 + The patches are in CVS. + + + text/plain + 86 + 2004-07-21 02:47:42 + The patch + 1 + order20040721.patch + 392 + pgoron + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/86/order20040721.patch + + + text/plain + 87 + 2004-07-22 01:29:07 + The corrected patch + 1 + order20040722.patch + 392 + pgoron + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/87/order20040722.patch + + + pgoron + 2004-07-21 02:47:42 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=86) +The patch + + + + pgoron + 2004-07-22 01:29:07 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=87) +The corrected patch + + + + jacopo + 2004-07-30 11:52:33 + issue_status + Status + NEW + RESOLVED + + + jacopo + 2004-07-30 11:52:33 + resolution + Resolution + + FIXED + + + + 167 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040730145814 + Accounting + sichen + not determined + PATCH + 2004-07-28 17:15:09 + issues@ofbiz + + + + All + Fixes a couple of other getNextSeqId methods + + + sichen + 2004-07-28 17:15:09 + getNextSeqId now returns a string(), so .toString() is no longer needed and will +cause runtime exceptions. + + + sichen + 2004-07-28 17:19:29 + Created an attachment (id=88) +Changes getNextSeqId usage to PaymentGatewayServices and GenericAsyncEngine + + + + ajzeneski + 2004-07-30 14:58:14 + patch applied + + + text/plain + 88 + 2004-07-28 17:19:29 + Changes getNextSeqId usage to PaymentGatewayServices and GenericAsyncEngine + 1 + changes.txt + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/88/changes.txt + + + sichen + 2004-07-28 17:19:29 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=88) +Changes getNextSeqId usage to PaymentGatewayServices and GenericAsyncEngine + + + + ajzeneski + 2004-07-30 14:58:14 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 14:58:14 + resolution + Resolution + + FIXED + + + + 168 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040730144804 + Content + pgoron + not determined + PATCH + 2004-07-29 02:43:55 + issues@ofbiz + + + + All + FreeMarker localization issues + + + pgoron + 2004-07-29 02:43:55 + Hi, + +This patch resolves some localization issues. Currently, FreeMarker formats +number according to the machine's locale. My patch forces FreeMarker to use the +user session's locale. + +It must be applied in ofbiz/components/content/src/org/ofbiz/content/webapp/ftl +folder. + + + pgoron + 2004-07-29 02:45:19 + Created an attachment (id=89) +The patch + + + + ajzeneski + 2004-07-30 14:48:04 + This has been fixed in CVS + + + text/plain + 89 + 2004-07-29 02:45:19 + The patch + 1 + locale-freemaker-200040727.patch + 392 + pgoron + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/89/locale-freemaker-200040727.patch + + + pgoron + 2004-07-29 02:45:19 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=89) +The patch + + + + ajzeneski + 2004-07-30 14:48:04 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 14:48:04 + resolution + Resolution + + FIXED + + + + 169 + RESOLVED + P3 + FIXED + Components + CVS + PC + issues@ofbiz + 20040730220642 + E-Commerce + amheiss + not determined + DEFECT + 2004-07-30 09:53:11 + issues@ofbiz + + https://localhost:8443/ecommerce/control/finalizeOrder + + Linux + Party/Userlogin issues + + + amheiss + 2004-07-30 09:53:11 + Application will not allow run of createPartyPostalAddress (due to null user +login?). Sequence of events from july 30th, 11am build: goto ecommerce, +login, then logout. attempt to use anonymous checkout after this, and shipping +address feilds prepopulated with previous logins settings. After adjusting and +trying to save, get error 'User authorization is required for this service: +createPartyPostalAddress ' . + +Debug output from shipsettings.bsh: +Debug.log("party ID : " + partyId); ---> output admin ( i logged in as admin, +then logged out) +Debug.log("ul: " + session.getAttribute("userLogin")); ---> (null) + + + ajzeneski + 2004-07-30 22:06:42 + Yes, if there is an autoUserLogin attribute available that will break anonymous checkout. In theory, the +anonymous checkout links should not be displayed if there is an auto-userlogin. However, I have added +some code to clear this when entering the anonymous checkout process. + + + ajzeneski + 2004-07-30 22:06:42 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-07-30 22:06:42 + resolution + Resolution + + FIXED + + + + 170 + RESOLVED + P3 + FIXED + Components + CVS + All + issues@ofbiz + 20040804093020 + Product + sichen + not determined + ENHANCEMENT + 2004-08-03 17:02:41 + issues@ofbiz + + + + All + Optionally duplicates ProductContent when duplicating a Product + + + sichen + 2004-08-03 17:02:41 + Will now optionally duplicate ProductContent entries when duplicating a Product + + + sichen + 2004-08-03 17:03:19 + Created an attachment (id=90) +Patches services.xml, EditProduct.ftl, and ProductServices.xml + + + + jonesde + 2004-08-04 09:30:20 + Thanks Si. This is now in CVS. I also did a content remove option, and fixed an issue I noticed with the +product IDs (GoodIdentification). BTW, this is from a slightly earlier version of OFBiz than the current +CVS as this form has been moved to the file EditProductDupForm.ftl. + + + text/plain + 90 + 2004-08-03 17:03:19 + Patches services.xml, EditProduct.ftl, and ProductServices.xml + 1 + duplicateProduct.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/90/duplicateProduct.patch + + + sichen + 2004-08-03 17:03:19 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=90) +Patches services.xml, EditProduct.ftl, and ProductServices.xml + + + + jonesde + 2004-08-04 09:30:20 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-08-04 09:30:20 + resolution + Resolution + + FIXED + + + + 171 + RESOLVED + P2 + FIXED + Components + CVS + All + issues@ofbiz + 20040804091929 + Product + pgoron + not determined + PATCH + 2004-08-04 00:59:53 + issues@ofbiz + + + + All + Comparaison bug in InventoryServices.xml minilang script + + + pgoron + 2004-08-04 00:59:53 + Some if-compare element forget to declare type used to compare fields. By +default, string comparison is used whereas Double is required. + + +Applying patch : +cd /ofbiz/components/product/script/org/ofbiz/product/inventory +patch -p0 < InventoryServices.xml.patch + + + pgoron + 2004-08-04 01:01:13 + Created an attachment (id=91) +The patch + + + + jonesde + 2004-08-04 09:19:29 + Thanks, it's now in CVS. + + + text/plain + 91 + 2004-08-04 01:01:13 + The patch + 1 + InventoryServices.xml.patch + 392 + pgoron + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/91/InventoryServices.xml.patch + + + pgoron + 2004-08-04 01:01:13 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=91) +The patch + + + + jonesde + 2004-08-04 09:19:29 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-08-04 09:19:29 + resolution + Resolution + + FIXED + + + + 172 + NEW + P2 + + Components + CVS + All + issues@ofbiz + 20040819033400 + Order + pgoron + not determined + PATCH + 2004-08-05 07:09:49 + issues@ofbiz + + + + All + Bug in shippableWeight calculation from OrderReadHelper.getShippableWeight method + + + pgoron + 2004-08-05 07:09:49 + Hi, + +The purpose of this patch is to solve a bug in +OrderReadHelper.getShippableWeight method. The algorithm of shippable weight +calculation don't care of order item's quantity. So there is an inconsistency +with ShoppingCart.getShippableWeight method when order is modified after his +creation (for example, by RecalcShippingTotal service). + +Applying patch: +cd ofbiz/components/order/src/org/ofbiz/order/order +patch -p0 < OrderReadHelper-20040805.patch + +Peter Goron + + + pgoron + 2004-08-05 07:10:36 + Created an attachment (id=92) +The patch + + + + pgoron + 2004-08-19 03:34:00 + Created an attachment (id=96) +An up to date patch + + + + text/plain + 92 + 2004-08-05 07:10:36 + The patch + 1 + OrderReadHelper-20040805.patch + 392 + pgoron + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/92/OrderReadHelper-20040805.patch + + + text/plain + 96 + 2004-08-19 03:34:00 + An up to date patch + 1 + OrderReadHelper-200408019.patch + 392 + pgoron + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/96/OrderReadHelper-200408019.patch + + + pgoron + 2004-08-05 07:10:36 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=92) +The patch + + + + pgoron + 2004-08-19 03:34:00 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=96) +An up to date patch + + + + + 173 + RESOLVED + P3 + INVALID + Base + CVS + PC + issues@ofbiz + 20040809165336 + Startup + mn + not determined + PATCH + 2004-08-09 13:38:08 + issues@ofbiz + + + + Linux + typo in base/config/debug.properties + + + mn + 2004-08-09 13:38:08 + Index: base/config/debug.properties +=================================================================== +RCS file: /cvs/ofbiz/base/config/debug.properties,v +retrieving revision 1.10 +diff -u -r1.10 debug.properties +--- base/config/debug.properties 9 Jun 2004 18:12:59 -0000 1.10 ++++ base/config/debug.properties 9 Aug 2004 19:32:33 -0000 +@@ -7,7 +7,7 @@ + pack.exception=true + + # These top level switches are used before calling Log4J, or if Log4J is not used +-print.verbose=ftrue ++print.verbose=true + print.timing=true + print.info=true + print.important=true + + + mn + 2004-08-09 13:40:09 + Created an attachment (id=93) +corerct typo for print.verbose property + + + + jonesde + 2004-08-09 16:25:29 + In this case "ftrue" is not a misspelling of "true", we add the "f" before "true" so that it is easier to switch +between true and false than it would be to type out "true" and "false". In other words, anything but +"true" is false. + + + mn + 2004-08-09 16:53:36 + What about placing comment into debug.properties about this decision? + + + text/plain + 93 + 2004-08-09 13:40:09 + corerct typo for print.verbose property + 1 + debug.properties.patch + 377 + mn + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/93/debug.properties.patch + + + mn + 2004-08-09 13:40:09 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=93) +corerct typo for print.verbose property + + + + jonesde + 2004-08-09 16:25:29 + issue_status + Status + NEW + RESOLVED + + + jonesde + 2004-08-09 16:25:29 + resolution + Resolution + + INVALID + + + + 174 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040810161004 + Accounting + amheiss + not determined + PATCH + 2004-08-10 16:08:36 + issues@ofbiz + + + + All + retry failed auths fix + + + amheiss + 2004-08-10 16:08:36 + retryFailedAuths service was creating superfluous retryFailedOrderAuth +services. I'll see if i can attach the patch to check on order status before +dispatching retryFailedOrderAuth service. If not, patch will be to dev list +soon enough. + + + amheiss + 2004-08-10 16:10:04 + Created an attachment (id=94) +Patch for retryFailedAuth fix + + + + text/plain + 94 + 2004-08-10 16:10:04 + Patch for retryFailedAuth fix + 1 + retryAuth.patch + 336 + amheiss + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/94/retryAuth.patch + + + amheiss + 2004-08-10 16:10:04 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=94) +Patch for retryFailedAuth fix + + + + + 175 + RESOLVED + P3 + FIXED + foo + unspecified + All + ajzeneski + 20040817213241 + bar + ajzeneski + milestone 1 + DEFECT + 2004-08-17 21:31:38 + ajzeneski + + + + All + bar + + + ajzeneski + 2004-08-17 21:31:38 + foo + + + ajzeneski + 2004-08-17 21:32:41 + . + + + ajzeneski + 2004-08-17 21:32:41 + issue_status + Status + NEW + RESOLVED + + + ajzeneski + 2004-08-17 21:32:41 + resolution + Resolution + + FIXED + + + + 176 + NEW + P3 + + Components + CVS + All + issues@ofbiz + 20040818174622 + Content + sichen + not determined + DEFECT + 2004-08-18 17:45:44 + issues@ofbiz + + + + All + Possible bug in renderContentAsText + + + sichen + 2004-08-18 17:45:44 + It seems that renderContentAsText is still trying to do a findByAnd on +SubContentDataResourceView with a fromDate as the orderBy, whereas +renderContentAsTextCache no longer does (it passes a null.) We got an +exception from this in ProductContentWrapper and made this change to fix it. +Is this a defect? + + + sichen + 2004-08-18 17:46:22 + Created an attachment (id=95) +Changes findByAnd of SubContentDataResourceView + + + + text/plain + 95 + 2004-08-18 17:46:22 + Changes findByAnd of SubContentDataResourceView + 1 + ContentWorker.patch + 178 + sichen + + https://ofbiz.dev.java.net/nonav/issues/showattachment.cgi/95/ContentWorker.patch + + + sichen + 2004-08-18 17:46:22 + attachments.ispatch + Attachment is Patch + + Created an attachment (id=95) +Changes findByAnd of SubContentDataResourceView + + + + + 177 + NEW + P3 + + Base + CVS + Other + issues@ofbiz + 20040910075014 + Base + lrawley + not determined + TASK + 2004-09-10 07:50:14 + issues@ofbiz + + + + Windows XP + HTTP Header needs Expires + + + lrawley + 2004-09-10 07:50:14 + Using Internet Explorer 6.0 with settings for automatically obtaining newer +versions of page. + +Images are cached and if changed are not refreshed on visits to the same page. +Pages get cached with login page because the first time a user requested they +were prompted to login first and then redirected to the page. + +This behavior is resolved if set to obtain newer versions on every visit, +however, this causes performance issues. So, automatically is the desired +browser setting. + +I would like to be able to set the EXPIRE in the HTTP header. I'm not sure +where this change needs to occur. Can you assist? Is this available in 3.0? +I am using 2.1.1. + +Please contact me at lrawley@tla.com. + +Lisa Rawley + + + diff --git a/jni/ruby/test/rexml/data/pi.xml b/jni/ruby/test/rexml/data/pi.xml new file mode 100644 index 0000000..980bbf9 --- /dev/null +++ b/jni/ruby/test/rexml/data/pi.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/jni/ruby/test/rexml/data/pi2.xml b/jni/ruby/test/rexml/data/pi2.xml new file mode 100644 index 0000000..46bce45 --- /dev/null +++ b/jni/ruby/test/rexml/data/pi2.xml @@ -0,0 +1,6 @@ + + + foo + + bar + diff --git a/jni/ruby/test/rexml/data/project.xml b/jni/ruby/test/rexml/data/project.xml new file mode 100644 index 0000000..a02582f --- /dev/null +++ b/jni/ruby/test/rexml/data/project.xml @@ -0,0 +1 @@ +tool testing diff --git a/jni/ruby/test/rexml/data/simple.xml b/jni/ruby/test/rexml/data/simple.xml new file mode 100644 index 0000000..3cff71a --- /dev/null +++ b/jni/ruby/test/rexml/data/simple.xml @@ -0,0 +1,2 @@ + +abd diff --git a/jni/ruby/test/rexml/data/stream_accents.xml b/jni/ruby/test/rexml/data/stream_accents.xml new file mode 100644 index 0000000..6def54e --- /dev/null +++ b/jni/ruby/test/rexml/data/stream_accents.xml @@ -0,0 +1,4 @@ + + + + diff --git a/jni/ruby/test/rexml/data/t63-1.xml b/jni/ruby/test/rexml/data/t63-1.xml new file mode 100644 index 0000000..f8d0c54 Binary files /dev/null and b/jni/ruby/test/rexml/data/t63-1.xml differ diff --git a/jni/ruby/test/rexml/data/t63-2.svg b/jni/ruby/test/rexml/data/t63-2.svg new file mode 100644 index 0000000..706c0e9 --- /dev/null +++ b/jni/ruby/test/rexml/data/t63-2.svg @@ -0,0 +1,2828 @@ + + + + + + + + + + + + + + + + + + + + + + + + + SYMBOL 640 + + OFF + + + + SYMBOL 642 + + NORMAL + + + + SYMBOL 643 + + ARMED + + + + SYMBOL 644 + + ALARM + + + + SYMBOL 646 + + FAILED + + + + SYMBOL 652 + + ON + + + + SYMBOL 660 + + AUTO + + + + SYMBOL 675 + + MARGINAL + + + + SYMBOL 835 + + TRIPPED + + + + SYMBOL 922 + + MANUAL + + + + Select + + S + + + + Unack + + U + + + + Alarm + + A + + + + Deact + + D + + + + Alinh + + I + + + + Telem + + E + + + + Manual + + M + + + + TagInfo + + I + + + + + + + + TagCtl + + + + + + N + + + + TagCls + + + + + + H + + + + TagOpn + + O + + + + + + + + RDV + + R + + + + Gmerr + + G + + + + Limovr + + O + + + + Limit1 + + 1 + + + + Kimit2 + + 2 + + + + Limit3 + + 3 + + + + + + + + + + + + + 03/16/06 ADDED DFK 6 -- K. POPE + + + + + 01/05/05 FIXED DFK'S -- K. POPE + + + + + 10/14/04 CHANGED ACRONYM FOR REG CONTROL TO MANUAL / AUTO -- O. WAHLSTROM + + + + + 12/24/03 DISPLAY BUILT AND DATA ADDED -- K. POPE + + + + + 01/06/04 DISPLAY CORRECTED PER R. MCCORMICK -- N. FISHER + + + + + 03/18/04 DISPLAY UPDATED/DFK'S FIXED/APPENDED SYMBOLS MOVED -- T. TURNER + + + + + 03/29/04 REVIEWED -- O. WAHLSTROM + + + + + 05/11/04 RTU BOX FIXED AND DISPLAY UPDATED -- K. POPE + + + + + 10/18/05 REMOVED BUS VOLT MAXIMUM ALARM -- K. POPE + + + + + + + 118TH SOUTH (118TH-SO) + + + + + + + + + + + Salt Lake County, Utah + + + + + + + + + + + REG 1 AUTOMATIC (C) + + + + + To control regulator, right click on the tap position + + + + + indication and select the regulation option. + + + + + XFMR 1 TEMPERATURE + + + + + XFMR 1 NITROGEN CYL LOW + + + + + XFMR 1 LOW OIL LEVEL + + + + + XFMR 1 NITROGEN PRESSURE + + + + + XFMR 1 PRESSURE FAULT + + + + + XFMR 1 LTC CONTROL LOSS + + + + + RELAY LOSS OF AC + + + + + STATION SERVICE + + + + + XFMR 1 LTC FAIL + + + + + XFMR 1 WINDING TEMP TRIP + + + + + XFMR 1 LOCKOUT + + + + + CONTROL SYSTEM FAIL + + + + + UNDER FREQ TRIP RELAY + + + + + CB LOW SPRING CHARGE + + + + + RELAY FAILURE + + + + + CAP 1 VOLT CONTROL (C) + + + + + HMI PLC STALLED + + + + + XFMR 1 LTC FILTER + + + + + CONTROL SYSTEM NON CRITICAL + + + + + Station Alarms + + + + + Regulator 1 Control and Tap Position + + + + + REG 1 TAP POSITION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 1234.6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 1234.6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 1234.6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 16 + + + 12 + + + 8 + + + 4 + + + 0 + + + -4 + + + -8 + + + -12 + + + -16 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + REG 1 12KV BUS VOLTS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RTU STATUS: + + + + + + + + + + + + + + + RTU COMMUNICATIONS: + + + + + ENTRY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RTU - 481 + + + + diff --git a/jni/ruby/test/rexml/data/t75.xml b/jni/ruby/test/rexml/data/t75.xml new file mode 100644 index 0000000..0911fb1 --- /dev/null +++ b/jni/ruby/test/rexml/data/t75.xml @@ -0,0 +1,31 @@ + + + + + + + ]> + + +Next_Actions + @class + @agenda + this is something I'd like to do + + @dorm + clean room + + @computer + Write general makefile for cs projects + Set up bash podder + + @errands + Purchase geo lab book + + @dublin + +projects + diff --git a/jni/ruby/test/rexml/data/test/tests.xml b/jni/ruby/test/rexml/data/test/tests.xml new file mode 100644 index 0000000..cf03b42 --- /dev/null +++ b/jni/ruby/test/rexml/data/test/tests.xml @@ -0,0 +1,683 @@ + + + + + + + span + + + + + + + + + + + + + + abd + + + abd + + + a + + + d + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + 1 + 2 + + + + + + + true + true + + + + + + true + true + true + true + true + true + + + + + + + true + true + true + true + + + 0 + + 1 + + 3 + + false + + false + + false + + false + + true + + true + + + + + + + + + + + + order-by="x" + foo + order-by="x" + + + + + + foobar + + + + + + + + + + + + + + + + + + + + + + + + is tasty + + + + + + + + + + + + + + + + + + + + + true + true + false + true + true + false + + + + + + + + + + + + + + + + + + + + + + a.2 + a.1 + + + + a.4 + a.5 + + + + + + + + + snoop + snoop + file + file + + + + snoop + snoop + + + + + + + + + + + + + + + + + + + + web-app + + + + + + web-app + + + web-app + + + web-app + + + web-app + + + web-app + + + + + + + + + + + + + web-app + web-app + web-app + web-app + web-app + web-app + web-app + web-app + web-app + + + + + + + + + + + web-app + web-app + web-app + web-app + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://c.moreover.com/click/here.pl?x13563273 + + + http://c.moreover.com/click/here.pl?x13563273 + + + http://c.moreover.com/click/here.pl?x13563273 + + + http://c.moreover.com/click/here.pl?x13563273 + + + http://c.moreover.com/click/here.pl?x13563273 + + + http://c.moreover.com/click/here.pl?x13563273 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 196417 + 325 + 1 + 75025 + 46368 + + + + + + + + + + + + + + + + + + + + 2 + + 2 + + + + + + + + + + + + + + Much Ado about Nothing + 4 + 21 + 5 + 35 + 75 + + + + + + + 646 + 142 + 2 + 1 + 3 + 1 + 6 + + + + 5 + + + + + + + + + + + + + + + + + + snoop + snoop + + snoop + + + + 3foo3 + 3snoop3 + + + + + + Pruefgebiete + Pruefgebiete + + + + + + + + ab + ba + ba + db + + + + + + abcd + abcd + abcd + dcba + ab + cd + xy + abcd + abcd + + + + 234 + 12 + + + 12345 + + 345 + 12345 + + + + + + abc + a b c + a b c + + + + + + + + + + + + + SNOOPSERVLET + snoopservlet + SNOOPSERVLET + SNOOPSERVLET + SNOOPSERVLET + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hello + Hey + Hey3 + Hey3 + Hey3 + + + + + + + + + + + + + + + + + + baz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jni/ruby/test/rexml/data/test/tests.xsl b/jni/ruby/test/rexml/data/test/tests.xsl new file mode 100644 index 0000000..3ecd648 --- /dev/null +++ b/jni/ruby/test/rexml/data/test/tests.xsl @@ -0,0 +1,369 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/jni/ruby/test/rexml/data/testNamespaces.xml b/jni/ruby/test/rexml/data/testNamespaces.xml new file mode 100644 index 0000000..50f7c93 --- /dev/null +++ b/jni/ruby/test/rexml/data/testNamespaces.xml @@ -0,0 +1,22 @@ + diff --git a/jni/ruby/test/rexml/data/testsrc.xml b/jni/ruby/test/rexml/data/testsrc.xml new file mode 100644 index 0000000..9c7a782 --- /dev/null +++ b/jni/ruby/test/rexml/data/testsrc.xml @@ -0,0 +1,64 @@ + + + + + xmlhack + http://www.xmlhack.com + Developer news from the XML community + en-us + Copyright 1999-2001, xmlhack team. + editor@xmlhack.com + webmaster@xmlhack.com + + xmlhack + http://www.xmlhack.com/images/mynetscape88.gif + http://www.xmlhack.com + 88 + 31 + News, opinions, tips and issues concerning XML development + + +Experimental non-XML syntax for RELAX NG +http://www.xmlhack.com/read.php?item=1343 + + James Clark has announced the release of an experimental non-XML syntax for RELAX + NG and a Java translator implementation that converts + instances of the syntax into RELAX NG's XML syntax. + +Schemas + + +Long-awaited entity-resolver Java classes finally released +http://www.xmlhack.com/read.php?item=1342 +Norman Walsh has + announced the release of SAX entityResolver() and JAXP + URIResolver() Java + classes he wrote to implement the OASIS XML Catalogs + Committee Specification (in addition to the TR9401 and + Apache XCatalogs specifications). + +SGML/XML +Java + + + +Beepcore-C framework released +http://www.xmlhack.com/read.php?item=1341 +Invisible Worlds have announced the publication of Beepcore-C, an implementation of the BEEP framework written in C. +Protocols +C++ + + +SVG and XSL-FO by example +http://www.xmlhack.com/read.php?item=1340 +Jirka Jirat has announced the +addition of an XSL-FO and SVG examples repository to the Zvon developer +reference site. +SVG +XSL-FO + + + + + diff --git a/jni/ruby/test/rexml/data/text.xml b/jni/ruby/test/rexml/data/text.xml new file mode 100644 index 0000000..e1865c7 --- /dev/null +++ b/jni/ruby/test/rexml/data/text.xml @@ -0,0 +1,10 @@ + + + + baz + + baz + + baz + + diff --git a/jni/ruby/test/rexml/data/ticket_61.xml b/jni/ruby/test/rexml/data/ticket_61.xml new file mode 100644 index 0000000..4df1cc9 --- /dev/null +++ b/jni/ruby/test/rexml/data/ticket_61.xml @@ -0,0 +1,4 @@ + + +



ListMatters

Open | Closed | All
Open Matters











+ diff --git a/jni/ruby/test/rexml/data/ticket_68.xml b/jni/ruby/test/rexml/data/ticket_68.xml new file mode 100644 index 0000000..7ab34b0 --- /dev/null +++ b/jni/ruby/test/rexml/data/ticket_68.xml @@ -0,0 +1,590 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + +1000000 + + + + + + + +&n; +repetition mark in katakana +Wiederholungszeichen f端r Katakana +normalerweise nur in vertikaler Schreibweise verwendet +marque de la r辿p辿tition dans katakana +(JF2) + + + +1000010 + + + + + + + +&n; +voiced repetition mark in katakana +stimmhaftes Wiederholungszeichen f端r Katakana +normalerweise nur in vertikaler Schreibweise verwendet +marque de la r辿p辿tition sonore dans katakana +(JF2) + + + +1000020 + + + + + + + +&n; +repetition mark in hiragana +Wiederholungszeichen f端r Hiragana +normalerweise nur in vertikaler Schreibweise verwendet +marque de la r辿p辿tition dans hiragana +(JF2) + + + +1000030 + + + + + + + +&n; +voiced repetition mark in hiragana +stimmhaftes Wiederholungszeichen f端r Hiragana +normalerweise nur in vertikaler Schreibweise verwendet +marque de la r辿p辿tition sonore dans hiragana +(JF2) + + + +1000040 + + + + + + + +&n; +ditto mark +亰仆舒从 "仂 亢亠 舒仄仂亠" +Wiederholungszeichen in Tabellen +idem marque +(JF2) + + + +1000050 + + + + + + + +&n; +"as above" mark +Abk端rzung f端r "siehe oben" +comme au-dessus +(JF2) + + + +1000060 + + + + + + + +&n; +repetition of kanji (sometimes voiced) +Wiederholungszeichen f端r Kanji +(Laut wird durch Wiederholung manchmal stimmhaft) +r辿p辿tition de kanji(quelquefois a exprim辿) +(JF2) + + + +1000070 + + + + + + + +&n; +end or closure mark +Zeichen als eine Art Versiegelung 端ber der zugeklebten Lasche auf der R端ckseite eines Briefumschlages +fin ou marque de la fermeture +(JF2) + + + +1000080 + + + + + +&iK; + + + + + +&n; +羲∽医 + +"kanji" zero +Kanji-Ziffer f端r Null +kanji +(JF2) + + + +1000090 + + + + + +&iK; + + + + + +&n; +circle (sometimes used for zero) +从亞 +仆仂仍 +Kreis +Markierung f端r "richtig" +Maru +(ein japan. Schriftfont hat mindestens drei verschiedene Codierungen und Darstellungen f端r "maru") +entourez +mettez z辿ro +(JF2) + + + +1000100 + +鐚¥滋鐚i + + +若若激若 + + + + + +&n; +alphabetical order +alphabetische Ordnung +alphabetische Reihenfolge +ordre alphab辿tique +(JF2) + + + +1000110 + +鐚o爾若ゃ + + +激若c若若ゃ + + +&n; +CD player +CD 仗仍亠亠 +仗仂亳亞于舒亠仍 从仂仄仗舒从-亟亳从仂于 + + + +1000120 + + + + + + + + + + +&n; +pornographic film +salacious film + + + +1000130 + + + + + + + +&n; +&abbr; +NHK Symphony Orchestra +NHK Symphonie Orchestre(abbr) +(JF2) + + + +1000140 + + + + +&n; +O-back +skirt with peek-a-boo hole in rump +O En arri竪re +contournez avec coucou trou dans croupe +(JF2) + + + +1000150 + +鐚駕竺鐚鐚鐚宴若 + + +&n; +rs232 cable +les rs232 c但blent +(JF2) + + + diff --git a/jni/ruby/test/rexml/data/tutorial.xml b/jni/ruby/test/rexml/data/tutorial.xml new file mode 100644 index 0000000..bf5783d --- /dev/null +++ b/jni/ruby/test/rexml/data/tutorial.xml @@ -0,0 +1,678 @@ + + + + + + + REXML Tutorial + + $Revision: 1.1.2.1 $ + + *2001-296+594 + + http://www.germane-software.com/~ser/software/rexml + + + + ruby + + Sean Russell + + + + +

This is a tutorial for using REXML, + a pure Ruby XML processor.

+
+ + +

REXML was inspired by the Electric XML library for Java, which + features an easy-to-use API, small size, and speed. Hopefully, REXML, + designed with the same philosophy, has these same features. I've tried + to keep the API as intuitive as possible, and have followed the Ruby + methodology for method naming and code flow, rather than mirroring the + Java API.

+ +

REXML supports both tree and stream document parsing. Stream parsing + is faster (about 1.5 times as fast). However, with stream parsing, you + don't get access to features such as XPath.

+ +

The API documentation also + contains code snippits to help you learn how to use various methods. + This tutorial serves as a starting point and quick guide to using + REXML.

+ + +

We'll start with parsing an XML document

+ + require "rexml/document" +file = File.new( "mydoc.xml" ) +doc = REXML::Document.new file + +

Line 3 creates a new document and parses the supplied file. You can + also do the following

+ + require "rexml/document" +include REXML # so that we don't have to prefix everything with REXML::... +string = <<EOF + <mydoc> + <someelement attribute="nanoo">Text, text, text</someelement> + </mydoc> +EOF +doc = Document.new string + +

So parsing a string is just as easy as parsing a file. For future + examples, I'm going to omit both the require and + include lines.

+ +

Once you have a document, you can access elements in that document + in a number of ways:

+ + + The Element class itself has + each_element_with_attribute, a common way of accessing + elements. + + The attribute Element.elements is an + Elements class instance which has the each + and [] methods for accessing elements. Both methods can + be supplied with an XPath for filtering, which makes them very + powerful. + + Since Element is a subclass of Parent, you can + also access the element's children directly through the Array-like + methods Element[], Element.each, Element.find, + Element.delete. This is the fastest way of accessing + children, but note that, being a true array, XPath searches are not + supported, and that all of the element children are contained in + this array, not just the Element children. + + +

Here are a few examples using these methods. First is the source + document used in the examples. Save this as mydoc.xml before running + any of the examples that require it:

+ + <inventory title="OmniCorp Store #45x10^3"> + <section name="health"> + <item upc="123456789" stock="12"> + <name>Invisibility Cream</name> + <price>14.50</price> + <description>Makes you invisible</description> + </item> + <item upc="445322344" stock="18"> + <name>Levitation Salve</name> + <price>23.99</price> + <description>Levitate yourself for up to 3 hours per application</description> + </item> + </section> + <section name="food"> + <item upc="485672034" stock="653"> + <name>Blork and Freen Instameal</name> + <price>4.95</price> + <description>A tasty meal in a tablet; just add water</description> + </item> + <item upc="132957764" stock="44"> + <name>Grob winglets</name> + <price>3.56</price> + <description>Tender winglets of Grob. Just add water</description> + </item> + </section> +</inventory> + + doc = Document.new File.new("mydoc.xml") +doc.elements.each("inventory/section") { |element| puts element.attributes["name"] } +# -> health +# -> food +doc.elements.each("*/section/item") { |element| puts element.attributes["upc"] } +# -> 123456789 +# -> 445322344 +# -> 485672034 +# -> 132957764 +root = doc.root +puts root.attributes["title"] +# -> OmniCorp Store #45x10^3 +puts root.elements["section/item[@stock='44']"].attributes["upc"] +# -> 132957764 +puts root.elements["section"].attributes["name"] +# -> health (returns the first encountered matching element) +puts root.elements[1].attributes["name"] +# -> health (returns the FIRST child element) +root.detect {|node| node.kind_of? Element and node.attributes["name"] == "food" } + +

Notice the second-to-last line of code. Element children in REXML + are indexed starting at 1, not 0. This is because XPath itself counts + elements from 1, and REXML maintains this relationship; IE, + root.elements['*[1]'] == root.elements[1]. The last line + finds the first child element with the name of "food". As you can see + in this example, accessing attributes is also straightforward.

+ +

You can also access xpaths directly via the XPath class.

+ + # The invisibility cream is the first <item> +invisibility = XPath.first( doc, "//item" ) +# Prints out all of the prices +XPath.each( doc, "//price") { |element| puts element.text } +# Gets an array of all of the "name" elements in the document. +names = XPath.match( doc, "//name" ) + +

Another way of getting an array of matching nodes is through + Element.elements.to_a(). Although this is a method on elements, if + passed an XPath it can return an array of arbitrary objects. This is + due to the fact that XPath itself can return arbitrary nodes + (Attribute nodes, Text nodes, and Element nodes).

+ + all_elements = doc.elements.to_a +all_children = doc.to_a +all_upc_strings = doc.elements.to_a( "//item/attribute::upc" ) +all_name_elements = doc.elements.to_a( "//name" ) +
+ + +

REXML attempts to make the common case simple, but this means that + the uncommon case can be complicated. This is especially true with + Text nodes.

+ +

Text nodes have a lot of behavior, and in the case of internal + entities, what you get may be different from what you expect. When + REXML reads an XML document, in parses the DTD and creates an internal + table of entities. If it finds any of these entities in the document, + it replaces them with their values:

+ + doc = Document.new '<!DOCTYPE foo [ +<!ENTITY ent "replace"> +]><a>&ent;</a>' +doc.root.text #-> "replace" + + +

When you write the document back out, REXML replaces the values + with the entity reference:

+ + doc.to_s +# Generates: +# <!DOCTYPE foo [ +# <!ENTITY ent "replace"> +# ]><a>&ent;</a> + +

But there's a problem. What happens if only some of the words are + also entity reference values?

+ + doc = Document.new '<!DOCTYPE foo [ +<!ENTITY ent "replace"> +]><a>replace &ent;</a>' +doc.root.text #-> "replace replace" + + +

Well, REXML does the only thing it can:

+ + doc.to_s +# Generates: +# <!DOCTYPE foo [ +# <!ENTITY ent "replace"> +# ]><a>&ent; &ent;</a> + +

This is probably not what you expect. However, when designing + REXML, I had a choice between this behavior, and using immutable text + nodes. The problem is that, if you can change the text in a node, + REXML can never tell which tokens you want to have replaced with + entities. There is a wrinkle: REXML will write what it gets in as long + as you don't access the text. This is because REXML does lazy + evaluation of entities. Therefore,

+ + doc = Document.new( '<!DOCTYPE foo + [ <!ENTITY ent "replace"> ]><a>replace + &ent;</a>' ) doc.to_s # Generates: # <!DOCTYPE foo [ # + <!ENTITY ent "replace"> # ]><a>replace + &ent;</a> doc.root.text #-> Now accessed, + entities have been resolved doc.to_s # Generates: # <!DOCTYPE foo [ + # <!ENTITY ent "replace"> # ]><a>&ent; + &ent;</a> + +

There is a programmatic solution: :raw. If you set the + :raw flag on any Text or Element node, the entities + within that node will not be processed. This means that you'll have to + deal with entities yourself:

+ + doc = Document.new('<!DOCTYPE + foo [ <!ENTITY ent "replace"> ]><a>replace + &ent;</a>',{:raw=>:all}) + doc.root.text #-> "replace &ent;" doc.to_s # Generates: # + <!DOCTYPE foo [ # <!ENTITY ent "replace"> # + ]><a>replace &ent;</a> +
+ + +

Again, there are a couple of mechanisms for creating XML documents + in REXML. Adding elements by hand is faster than the convenience + method, but which you use will probably be a matter of aesthetics.

+ + el = someelement.add_element "myel" +# creates an element named "myel", adds it to "someelement", and returns it +el2 = el.add_element "another", {"id"=>"10"} +# does the same, but also sets attribute "id" of el2 to "10" +el3 = Element.new "blah" +el1.elements << el3 +el3.attributes["myid"] = "sean" +# creates el3 "blah", adds it to el1, then sets attribute "myid" to "sean" + +

If you want to add text to an element, you can do it by either + creating Text objects and adding them to the element, or by using the + convenience method text=

+ + el1 = Element.new "myelement" +el1.text = "Hello world!" +# -> <myelement>Hello world!</myelement> +el1.add_text "Hello dolly" +# -> <myelement>Hello world!Hello dolly</element> +el1.add Text.new("Goodbye") +# -> <myelement>Hello world!Hello dollyGoodbye</element> +el1 << Text.new(" cruel world") +# -> <myelement>Hello world!Hello dollyGoodbye cruel world</element> + +

But note that each of these text objects are still stored as + separate objects; el1.text will return "Hello world!"; + el1[2] will return a Text object with the contents + "Goodbye".

+ +

Please be aware that all text nodes in REXML are UTF-8 encoded, and + all of your code must reflect this. You may input and output other + encodings (UTF-8, UTF-16, ISO-8859-1, and UNILE are all supported, + input and output), but within your program, you must pass REXML UTF-8 + strings.

+ +

I can't emphasize this enough, because people do have problems with + this. REXML can't possibly alway guess correctly how your text is + encoded, so it always assumes the text is UTF-8. It also does not warn + you when you try to add text which isn't properly encoded, for the + same reason. You must make sure that you are adding UTF-8 text. +  If you're adding standard 7-bit ASCII, which is most common, you + don't have to worry.  If you're using ISO-8859-1 text (characters + above 0x80), you must convert it to UTF-8 before adding it to an + element.  You can do this with the shard: + text.unpack("C*").pack("U*"). If you ignore this warning + and add 8-bit ASCII characters to your documents, your code may + work... or it may not.  In either case, REXML is not at fault. + You have been warned.

+ +

One last thing: alternate encoding output support only works from + Document.write() and Document.to_s(). If you want to write out other + nodes with a particular encoding, you must wrap your output object + with Output:

+ + e = Element.new "<a/>" +e.text = "f\xfcr" # ISO-8859-1 '端' +o = '' +e.write( Output.new( o, "ISO-8859-1" ) ) + + +

You can pass Output any of the supported encodings.

+ +

If you want to insert an element between two elements, you can use + either the standard Ruby array notation, or + Parent.insert_before and + Parent.insert_after.

+ + doc = Document.new "<a><one/><three/></a>" +doc.root[1,0] = Element.new "two" +# -> <a><one/><two/><three/></a> +three = doc.elements["a/three"] +doc.root.insert_after three, Element.new "four" +# -> <a><one/><two/><three/><four/></a> +# A convenience method allows you to insert before/after an XPath: +doc.root.insert_after( "//one", Element.new("one-five") ) +# -> <a><one/><one-five/><two/><three/><four/></a> +# Another convenience method allows you to insert after/before an element: +four = doc.elements["//four"] +four.previous_sibling = Element.new("three-five") +# -> <a><one/><one-five/><two/><three/><three-five/><four/></a> + +

The raw flag in the Text constructor can + be used to tell REXML to leave strings which have entities defined for + them alone.

+ + doc = Document.new( "<?xml version='1.0?> +<!DOCTYPE foo SYSTEM 'foo.dtd' [ +<!ENTITY % s "Sean"> +]> +<a/>" +t = Text.new( "Sean", false, nil, false ) +doc.root.text = t +t.to_s # -> &s; +t = Text.new( "Sean", false, nil, true ) +doc.root.text = t +t.to_s # -> Sean + +

Note that, in all cases, the value() method returns + the text with entities expanded, so the raw flag only + affects the to_s() method. If the raw is set + for a text node, then to_s() will not entities will not + normalize (turn into entities) entity values. You can not create raw + text nodes that contain illegal XML, so the following will generate a + parse error:

+ + t = Text.new( "&", false, nil, true ) + +

You can also tell REXML to set the Text children of given elements + to raw automatically, on parsing or creating:

+ + doc = REXML::Document.new( source, { :raw => %w{ tag1 tag2 tag3 } } + +

In this example, all tags named "tag1", "tag2", or "tag3" will have + any Text children set to raw text. If you want to have all of the text + processed as raw text, pass in the :all tag:

+ + doc = REXML::Document.new( source, { :raw => :all }) +
+ + +

There aren't many things that are more simple than writing a REXML + tree. Simply pass an object that supports <<( String + ) to the write method of any object. In Ruby, both + IO instances (File) and String instances support <<.

+ + doc.write $stdout +output = "" +doc.write output + +

If you want REXML to pretty-print output, pass write() + an indent value greater than -1:

+ + doc.write( $stdout, 0 ) + +

REXML will not, by default, write out the XML declaration unless + you specifically ask for them. If a document is read that contains an + XML declaration, that declaration will be written + faithfully. The other way you can tell REXML to write the declaration + is to specifically add the declaration:

+ + doc = Document.new +doc.add_element 'foo' +doc.to_s #-> <foo/> +doc << XMLDecl.new +doc.to_s #-> <?xml version='1.0'?><foo/> +
+ + +

There are four main methods of iterating over children. + Element.each, which iterates over all the children; + Element.elements.each, which iterates over just the child + Elements; Element.next_element and + Element.previous_element, which can be used to fetch the + next Element siblings; and Element.next_sibling and + Eleemnt.previous_sibling, which fetches the next and + previous siblings, regardless of type.

+
+ + +

REXML stream parsing requires you to supply a Listener class. When + REXML encounters events in a document (tag start, text, etc.) it + notifies your listener class of the event. You can supply any subset + of the methods, but make sure you implement method_missing if you + don't implement them all. A StreamListener module has been supplied as + a template for you to use.

+ + list = MyListener.new +source = File.new "mydoc.xml" +REXML::Document.parse_stream(source, list) + +

Stream parsing in REXML is much like SAX, where events are + generated when the parser encounters them in the process of parsing + the document. When a tag is encountered, the stream listener's + tag_start() method is called. When the tag end is + encountered, tag_end() is called. When text is + encountered, text() is called, and so on, until the end + of the stream is reached. One other note: the method + entity() is called when an &entity; is + encountered in text, and only then.

+ +

Please look at the StreamListener + API for more information.You must generate the API + documentation with rdoc or download the API documentation from the + REXML website for this documentation.

+
+ + +

By default, REXML respects whitespace in your document. In many + applications, you want the parser to compress whitespace in your + document. In these cases, you have to tell the parser which elements + you want to respect whitespace in by passing a context to the + parser:

+ + doc = REXML::Document.new( source, { :compress_whitespace => %w{ tag1 tag2 tag3 } } + +

Whitespace for tags "tag1", "tag2", and "tag3" will be compressed; + all other tags will have their whitespace respected. Like :raw, you + can set :compress_whitespace to :all, and have all elements have their + whitespace compressed.

+ +

You may also use the tag :respect_whitespace, which + flip-flops the behavior. If you use :respect_whitespace + for one or more tags, only those elements will have their whitespace + respected; all other tags will have their whitespace compressed.

+
+ + +

REXML does some automatic processing of entities for your + convenience. The processed entities are &, <, >, ", and '. + If REXML finds any of these characters in Text or Attribute values, it + automatically turns them into entity references when it writes them + out. Additionally, when REXML finds any of these entity references in + a document source, it converts them to their character equivalents. + All other entity references are left unprocessed. If REXML finds an + &, <, or > in the document source, it will generate a + parsing error.

+ + bad_source = "<a>Cats & dogs</a>" +good_source = "<a>Cats &amp; &#100;ogs</a>" +doc = REXML::Document.new bad_source +# Generates a parse error +doc = REXML::Document.new good_source +puts doc.root.text +# -> "Cats & &#100;ogs" +doc.root.write $stdout +# -> "<a>Cats &amp; &#100;ogs</a>" +doc.root.attributes["m"] = "x'y\"z" +puts doc.root.attributes["m"] +# -> "x'y\"z" +doc.root.write $stdout +# -> "<a m='x&apos;y&quot;z'>Cats &amp; &#100;ogs</a>" +
+ + +

Namespaces are fully supported in REXML and within the XPath + parser. There are a few caveats when using XPath, however:

+ + + If you don't supply a namespace mapping, the default namespace + mapping of the context element is used. This has its limitations, + but is convenient for most purposes. + + If you need to supply a namespace mapping, you must use the + XPath methods each, first, and + match and pass them the mapping. + + + source = "<a xmlns:x='foo' xmlns:y='bar'><x:b id='1'/><y:b id='2'/></a>" +doc = Document.new source +doc.elements["/a/x:b"].attributes["id"] # -> '1' +XPath.first(doc, "/a/m:b", {"m"=>"bar"}).attributes["id"] # -> '2' +doc.elements["//x:b"].prefix # -> 'x' +doc.elements["//x:b"].namespace # -> 'foo' +XPath.first(doc, "//m:b", {"m"=>"bar"}).prefix # -> 'y' +
+ + +

The pull parser API is not yet stable. When it settles down, I'll + fill in this section. For now, you'll have to bite the bullet and read + the PullParser + API docs. Ignore the PullListener class; it is a private helper + class.

+
+ + +

The original REXML stream parsing API is very minimal. This also + means that it is fairly fast. For a more complex, more "standard" API, + REXML also includes a streaming parser with a SAX2+ API. This API + differs from SAX2 in a couple of ways, such as having more filters and + multiple notification mechanisms, but the core API is SAX2.

+ +

The two classes in the SAX2 API are SAX2Parser + and SAX2Listener. + You can use the parser in one of five ways, depending on your needs. + Three of the ways are useful if you are filtering for a small number + of events in the document, such as just printing out the names of all + of the elements in a document, or getting all of the text in a + document. The other two ways are for more complex processing, where + you want to be notified of multiple events. The first three involve + Procs, and the last two involve listeners. The listener mechanisms are + very similar to the original REXML streaming API, with the addition of + filtering options, and are faster than the proc mechanisms.

+ +

An example is worth a thousand words, so we'll just take a look at + a small example of each of the mechanisms. The first example involves + printing out only the text content of a document.

+ + require 'rexml/sax2parser' +parser = REXML::SAX2Parser.new( File.new( 'documentation.xml' ) ) +parser.listen( :characters ) {|text| puts text } +parser.parse + +

In this example, we tell the parser to call our block for every + characters event. "characters" is what SAX2 calls Text + nodes. The event is identified by the symbol :characters. + There are a number of these events, including + :element_start, :end_prefix_mapping, and so + on; the events are named after the methods in the + SAX2Listener API, so refer to that document for a + complete list.

+ +

You can additionally filter for particular elements by passing an + array of tag names to the listen method. In further + examples, we will not include the require or parser + construction lines, as they are the same for all of these + examples.

+ + parser.listen( :characters, %w{ changelog todo } ) {|text| puts text } +parser.parse + +

In this example, only the text content of changelog and todo + elements will be printed. The array of tag names can also contain + regular expressions which the element names will be matched + against.

+ +

Finally, as a shortcut, if you do not pass a symbol to the listen + method, it will default to :element_start

+ + parser.listen( %w{ item }) do |uri,localname,qname,attributes| + puts attributes['version'] +end +parser.parse + +

This example prints the "version" attribute of all "item" elements + in the document. Notice that the number of arguments passed to the + block is larger than for :text; again, check the + SAX2Listener API for a list of what arguments are passed the blocks + for a given event.

+ +

The last two mechanisms for parsing use the SAX2Listener API. Like + StreamListener, SAX2Listener is a module, so you can + include it in your class to give you an adapter. To use + the listener model, create a class that implements some of the + SAX2Listener methods, or all of them if you don't include the + SAX2Listener model. Add them to a parser as you would blocks, and when + the parser is run, the methods will be called when events occur. + Listeners do not use event symbols, but they can filter on element + names.

+ + listener1 = MySAX2Listener.new +listener2 = MySAX2Listener.new +parser.listen( listener1 ) +parser.listen( %{ changelog, todo, credits }, listener2 ) +parser.parse + +

In the previous example, listener1 will be notified of + all events that occur, and listener2 will only be + notified of events that occur in changelog, + todo, and credits elements. We also see that + multiple listeners can be added to the same parser; multiple blocks + can also be added, and listeners and blocks can be mixed together.

+ +

There is, as yet, no mechanism for recursion. Two upcoming features + of the SAX2 API will be the ability to filter based on an XPath, and + the ability to specify filtering on an elemnt and all of its + descendants.

+ +

WARNING: The SAX2 API for dealing with doctype (DTD) + events almost certainly will change.

+
+ + +

Michael Neumann contributed some convenience functions for nodes, + and they are general enough that I've included. Michael's use-case + examples follow: # + Starting with +root_node+, we recursively look for a node with the + given # +tag+, the given +attributes+ (a Hash) and whoose text equals + or matches the # +text+ string or regular expression. # # To find the + following node: # # <td class='abc'>text</td> # # We use: + # # find_node(root, 'td', {'class' => 'abc'}, "text") # # Returns + +nil+ if no matching node was found. def find_node(root_node, tag, + attributes, text) root_node.find_first_recursive {|node| node.name == + tag and attributes.all? {|attr, val| node.attributes[attr] == val} and + text === node.text } end # # Extract specific columns (specified by + the position of it's corresponding # header column) from a table. # # + Given the following table: # # <table> # <tr> # + <td>A</td> # <td>B</td> # + <td>C</td> # </tr> # <tr> # + <td>A.1</td> # <td>B.1</td> # + <td>C.1</td> # </tr> # <tr> # + <td>A.2</td> # <td>B.2</td> # + <td>C.2</td> # </tr> # </table> # # To extract + the first (A) and last (C) column: # # extract_from_table(root_node, + ["A", "C"]) # # And you get this as result: # # [ # ["A.1", "C.1"], # + ["A.2", "C.2"] # ] # def extract_from_table(root_node, headers) # + extract and collect all header nodes header_nodes = headers.collect { + |header| find_node(root_node, 'td', {}, header) } raise "some headers + not found" if header_nodes.compact.size < headers.size # assert + that all headers have the same parent 'header_row', which is the row # + in which the header_nodes are contained. 'table' is the surrounding + table tag. header_row = header_nodes.first.parent table = + header_row.parent raise "different parents" unless header_nodes.all? + {|n| n.parent == header_row} # we now iterate over all rows in the + table that follows the header_row. # for each row we collect the + elements at the same positions as the header_nodes. # this is what we + finally return from the method. (header_row.index_in_parent+1 .. + table.elements.size).collect do |inx| row = table.elements[inx] + header_nodes.collect { |n| row.elements[ n.index_in_parent ].text } + end end

+
+ + +

This isn't everything there is to REXML, but it should be enough to + get started. Check the API + documentationYou must generate the API documentation + with rdoc or download the API documentation from the REXML website for + this documentation. for particulars and more examples. + There are plenty of unit tests in the test/ directory, + and these are great sources of working examples.

+
+
+
+ + +

Among the people who've contributed to this document are:

+ + + Eichert, Diana (bug + fix) + +
+
\ No newline at end of file diff --git a/jni/ruby/test/rexml/data/underscore.xml b/jni/ruby/test/rexml/data/underscore.xml new file mode 100644 index 0000000..111446f --- /dev/null +++ b/jni/ruby/test/rexml/data/underscore.xml @@ -0,0 +1,6 @@ + + + 1 + <_b>2 + + diff --git a/jni/ruby/test/rexml/data/utf16.xml b/jni/ruby/test/rexml/data/utf16.xml new file mode 100644 index 0000000..f7e5e90 Binary files /dev/null and b/jni/ruby/test/rexml/data/utf16.xml differ diff --git a/jni/ruby/test/rexml/data/web.xml b/jni/ruby/test/rexml/data/web.xml new file mode 100644 index 0000000..972cf5d --- /dev/null +++ b/jni/ruby/test/rexml/data/web.xml @@ -0,0 +1,42 @@ + + + + snoop + SnoopServlet + + + file + ViewFile + + initial + + 1000 + + + The initial value for the counter + + + + + + mv + + + *.wm + + + + + + + + manager + + + director + + + president + + + diff --git a/jni/ruby/test/rexml/data/web2.xml b/jni/ruby/test/rexml/data/web2.xml new file mode 100644 index 0000000..7d479d3 --- /dev/null +++ b/jni/ruby/test/rexml/data/web2.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/jni/ruby/test/rexml/data/working.rss b/jni/ruby/test/rexml/data/working.rss new file mode 100644 index 0000000..b38c45f --- /dev/null +++ b/jni/ruby/test/rexml/data/working.rss @@ -0,0 +1,202 @@ + + + + + Paul Duncan + http://www.paulduncan.org/ + Paul Duncan's personal blog. + + + + Fun With Tense + + Wed Sep 3 19:37:18 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=23 + +<pre> +&lt;richlowe&gt; blah. +&lt;richlowe&gt; that's what I say. +&lt;pabs&gt; if i say it too then what happens? +&lt;richlowe&gt; then "that's what we say" +&lt;richlowe&gt; duh. +&lt;pabs&gt; what if i say it, then retract it? +&lt;richlowe&gt; Did they teach you nothing in school! +&lt;richlowe&gt; "that's what I say, and he said" +&lt;pabs&gt; :( +&lt;pabs&gt; okay what if i say it, retract it, but then plan on saying it + again at some point in the indeterminite future? +&lt;richlowe&gt; "that's what I say, and he has said, and will possibly say + again"? +&lt;pabs&gt; see now that's not concise at all +</pre> + + + + + + We'll Miss You, Michael + + Mon Aug 25 09:52:41 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=22 + +<p> +Perhaps <a href='http://www.dash-dash.org/pix/death.jpg'>the image</a> +on <a href='http://www.dash-dash.org/'>his site</a> was a bit more +fitting than we realized. I'm frustrated that nothing and noone around +him could help ease the pain that he was going through. We can take +comfort in knowing that he felt the decision he made was best for him. +We'll miss you, Michael. +</p> + + + + + + Horis, Isis, Osiris, Oh My! + + Fri Aug 22 22:39:23 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=21 + +<p> +I started reading one of the several mythology books I checked out +earlier this week (as part of a personal research project, the results +of which will be available here eventually). I've only made it through +about 60 pages of Egyptian mythology so far, but it's interesting stuff. +One thing that's impressive to me is how the sexes appear to be on much +more equal footing (as compared to the Judeo/Christian mythology we've +been innundated with for most of our lives). For example, Isis revives +her husband Osiris by collecting his body parts, which are scattered +throughout Egypt. She also saves her son Horus from death and nurtures +him until he can fend for himself. Really interesting stuff. Anyway, +I'll have more about the project as I get farther along. +</p> + + + + + + Nature Sucks + + Fri Aug 22 08:33:41 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=20 + +<p> +<a href='http://www.linuxbrit.co.uk/'>Tom</a> has been having a rough +couple of weeks. Apparently he's got <a +href='http://www.ninds.nih.gov/health_and_medical/disorders/bells_doc.htm'>Bell's +Palsy</a> (link from ljlane), which, while treatable and rarely +permanent, still leaves his face partially paralyzed. If you have a few +minutes, you might consider sending him an <abbr title='Electronic +Card'>E-Card</abbr> or an <a +href='mailto:dr_spock@linuxbrit.co.uk'>email</a>. +</p> + + + + + + Or Maybe He Does + + Thu Aug 21 23:45:40 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=19 + +<p> +Okay, apparently Ed <em>does</em> read this page. :-D +</p> + + + + + + Ed Got Married!! + + Thu Aug 21 15:52:34 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=18 + +<p> +Ed got married in the Bahamas! Here's a picture from the honeymoon: +</p> + +<img src='/files/ed_dolphin.jpg' width='252' height='288' + title='Ed on his honeymoon!' alt='Ed on his honeymoon!' /> + +<p> +(Fortunately he doesn't read this site). +</p> + +<p> +One other thing. I weigh 186<abbr title='Pounds'>lbs</abbr> now. +The <a href='http://www.pablotron.org/weight/'>weight page</a> has been +updated. +</p> + + + + + + Gratuitous Douglas Adams Reference, #32427! + + Tue Aug 19 08:25:42 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=17 + +<p> +Just saw this <acronym title='Uniform Resource Locator'>URL</acronym> +on <a href='http://www.diveintomark.org/'>Dive Into +Mark</a>: +</p> + +<p> +<a +href='http://www.google.com/search?q=answer+to+life+the+universe+and+everything'>http://www.google.com/search?q=answer+to+life+the+universe+and+everything</a> +</p> + +<p> +<a href='http://www.bbc.co.uk/h2g2/guide/'><acronym title='Hitchhikers +Guide to the Galaxy'>H2G2</acronym></a> references never get old for me. +</p> + + + + + + Weekend Update, sans Norm McDonald + + Tue Aug 19 08:18:32 2003 + paul@paulduncan.org + http://www.paulduncan.org/?id=16 + +<p> +What a nutty weekend. A friend of mine went to the <acronym +title='Emergency Room'>ER</acronym> on Friday night, so I spent 4 hours +down there. It's really frustrating to see that many sick and injured +people in once place, and not really be able to do anything about it. +Also, for that much chaos, both the atmosphere and the staff are +disturbingly calm. +</p> + +<p> +I finally got <a href='http://www.raggle.org/'>Raggle</a> to a point +worthy of a new release. I'm not going to blather on about the new +stuff; if you're interested you can <a +href='http://www.raggle.org/'>check it out</a> on your own. +</p> + +<p> +<a href='http://www.pablotron.org/weight/'>The war against obesity</a> +continues! I'm down to 188 pounds now, a total of 75 pounds lost since +the beginning of March. I've been having trouble losing these last 10 +pounds, so this week is officially "Go to the Gym Every Night or Else" +week. 2 days down, 5 to go. +</p> + + + + + diff --git a/jni/ruby/test/rexml/data/xmlfile-bug.xml b/jni/ruby/test/rexml/data/xmlfile-bug.xml new file mode 100644 index 0000000..d439668 --- /dev/null +++ b/jni/ruby/test/rexml/data/xmlfile-bug.xml @@ -0,0 +1,15 @@ + + +Technik + +Technik +Die Technik ist das Rckgrat der meisten Geschftsprozesse bei Home of the Brave. Deshalb sollen hier alle relevanten technischen Ablufe, Daten und Einrichtungen beschrieben werden, damit jeder im Bedarfsfall die ntigen Informationen, Anweisungen und Verhaltensempfehlungen nachlesen und/oder abrufen kann. + + + Flash + Ntzliches von Flashern fr Flasher. + CVS-FAQ + FAQ zur Benutzung von CVS bei HOB + + + diff --git a/jni/ruby/test/rexml/data/xp.tst b/jni/ruby/test/rexml/data/xp.tst new file mode 100644 index 0000000..6551372 --- /dev/null +++ b/jni/ruby/test/rexml/data/xp.tst @@ -0,0 +1,27 @@ +/ +/rss +//rss +/rss/channel +//link +//image/* +//link[2] +//link[last()] +rss/channel/link[last()] +rss/channel/item/link[last()] +rss/channel/item/link[1] +rss/channel/item[@x='1'] +rss/channel/item[@x] +//item[@x] +//item[normalize-space(@name)='x'] +//*[count(title)=1] +//*[name()='link'] +//*[starts-with(name(),'li')] +//*[contains(name(),'y')] +//*[string-length(name()) = 4] +//copyright | //title +/child::rss +/descendant::* +//language/parent::* +/rss/channel/ancestor::* +//item[position() mod 2 = 0 ] +//item/ancestor::* \ No newline at end of file diff --git a/jni/ruby/test/rexml/data/yahoo.xml b/jni/ruby/test/rexml/data/yahoo.xml new file mode 100644 index 0000000..b63a944 --- /dev/null +++ b/jni/ruby/test/rexml/data/yahoo.xml @@ -0,0 +1,80 @@ + + + +<![CDATA[Yahoo! News Search Results for market]]> +http://news.search.yahoo.com/search/news?p=market&ei=UTF-8 + +en-us +Copyright (c) 2004 Yahoo! Inc. All rights reserved. +Sun, 03 Sep 2006 16:34:54 GMT +5 + +Yahoo! News +142 +18 +http://news.search.yahoo.com/news +http://us.i1.yimg.com/us.yimg.com/i/us/nws/th/main_142.gif + +false +<![CDATA[Toyota increases share in US auto market (Manila Bulletin)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=13ck33lrk/*http%3A//www.mb.com.ph/archive_pages.php?url=http://www.mb.com.ph/issues/2006/09/04/BSNS2006090473427.html +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=13ck33lrk/*http%3A//www.mb.com.ph/archive_pages.php?url=http://www.mb.com.ph/issues/2006/09/04/BSNS2006090473427.html +Sun, 03 Sep 2006 16:21:30 GMT + + +<![CDATA[ANALYSIS - North Korea finds market for missiles shrinking (Reuters via Yahoo! Asia News)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=11ibfq78e/*http%3A//asia.news.yahoo.com/060903/3/2pd1j.html +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=11ibfq78e/*http%3A//asia.news.yahoo.com/060903/3/2pd1j.html +Sun, 03 Sep 2006 08:37:33 GMT + + +<![CDATA[Broward labor market's a solid performer (Miami Herald)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=13671c2t8/*http%3A//www.miami.com/mld/miamiherald/business/15427113.htm?source=rss&channel=miamiherald_business +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=13671c2t8/*http%3A//www.miami.com/mld/miamiherald/business/15427113.htm?source=rss&channel=miamiherald_business +Sun, 03 Sep 2006 07:39:53 GMT + + +<![CDATA[NID to help Jharkhand e-market crafts (Yahoo! India News)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=11hg1j19f/*http%3A//in.news.yahoo.com/060903/43/6780a.html +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=11hg1j19f/*http%3A//in.news.yahoo.com/060903/43/6780a.html +Sun, 03 Sep 2006 10:02:54 GMT + + +<![CDATA[Reinsurance market goes high-tech to predict disasters (The Herald-Tribune)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12j43rdgp/*http%3A//www.heraldtribune.com/apps/pbcs.dll/article?AID=/20060903/NEWS/609030458 +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12j43rdgp/*http%3A//www.heraldtribune.com/apps/pbcs.dll/article?AID=/20060903/NEWS/609030458 +Sun, 03 Sep 2006 10:34:36 GMT + + +<![CDATA[Government warned against going into property market (Sunday Business Post)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12pru5k6v/*http%3A//www.sbpost.ie/breakingnews/breaking_story.asp?j=4126020&p=4yz6x35&n=4126112&x= +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12pru5k6v/*http%3A//www.sbpost.ie/breakingnews/breaking_story.asp?j=4126020&p=4yz6x35&n=4126112&x= +Sun, 03 Sep 2006 09:31:34 GMT + + +<![CDATA[Farmers Market gets shoulder-to-shoulder crowds on Saturdays (Great Falls Tribune)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12pfls0n1/*http%3A//www.greatfallstribune.com/apps/pbcs.dll/article?AID=/20060903/NEWS01/609030306 +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12pfls0n1/*http%3A//www.greatfallstribune.com/apps/pbcs.dll/article?AID=/20060903/NEWS01/609030306 +Sun, 03 Sep 2006 11:12:36 GMT + + +<![CDATA[City Hall takes Plan B for SF market rehab (Sun Star)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=138rfnhvi/*http%3A//www.sunstar.com.ph/static/pam/2006/09/03/news/city.hall.takes.plan.b.for.sf.market.rehab.html +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=138rfnhvi/*http%3A//www.sunstar.com.ph/static/pam/2006/09/03/news/city.hall.takes.plan.b.for.sf.market.rehab.html +Sun, 03 Sep 2006 08:18:46 GMT + + +<![CDATA[Market watch (AG Weekly)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12ahobgi6/*http%3A//www.agweekly.com/articles/2006/09/02/news/markets/markets01.txt +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=12ahobgi6/*http%3A//www.agweekly.com/articles/2006/09/02/news/markets/markets01.txt +Sun, 03 Sep 2006 04:20:37 GMT + + +<![CDATA[Catholic War Vets Ladies Club sets flea market (Times Leader)]]> +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=1383flil1/*http%3A//www.timesleader.com/mld/timesleader/living/15431391.htm?source=rss&channel=timesleader_living +http://us.rd.yahoo.com/dailynews/rss/search/market/SIG=1383flil1/*http%3A//www.timesleader.com/mld/timesleader/living/15431391.htm?source=rss&channel=timesleader_living +Sun, 03 Sep 2006 07:07:50 GMT + + + + diff --git a/jni/ruby/test/rexml/listener.rb b/jni/ruby/test/rexml/listener.rb new file mode 100644 index 0000000..81c9e88 --- /dev/null +++ b/jni/ruby/test/rexml/listener.rb @@ -0,0 +1,50 @@ +class Listener + attr_reader :ts, :te + attr_reader :normalize + def initialize + @ts = false + @te = false + end + def tag_start name, attrs + @ts = true if name=="subsection" and attrs["title"]=="Namespaces" + end + def tag_end name + @te = true if name=="documentation" + end + def text text + @normalize = text + #text.tr! "\n", ' ' + #puts "text #{text[0..10]}..." + end + def instruction name, instruction + #puts "instruction" + end + def comment comment + #puts "comment #{comment[0..10]}..." + end + def doctype name, pub_sys, long_name, uri + #puts "doctype #{name}" + end + def attlistdecl content + #puts "attlistdecl" + end + def elementdecl content + #puts "elementdecl" + end + def entitydecl content + #puts "entitydecl" + end + def notationdecl content + #puts "notationdecl" + end + def entity content + #puts "entity" + end + def cdata content + #puts "cdata" + end + def xmldecl version, encoding, standalone + #puts "xmldecl #{version}" + end +end + diff --git a/jni/ruby/test/rexml/parse/test_document_type_declaration.rb b/jni/ruby/test/rexml/parse/test_document_type_declaration.rb new file mode 100644 index 0000000..59fe561 --- /dev/null +++ b/jni/ruby/test/rexml/parse/test_document_type_declaration.rb @@ -0,0 +1,49 @@ +require "test/unit" +require "rexml/document" + +module REXMLTests + class TestParseDocumentTypeDeclaration < Test::Unit::TestCase + private + def xml(internal_subset) + <<-XML + + + XML + end + + def parse(internal_subset) + REXML::Document.new(xml(internal_subset)).doctype + end + + class TestMixed < self + def test_entity_element + doctype = parse(<<-INTERNAL_SUBSET) + + + INTERNAL_SUBSET + assert_equal([REXML::Entity, REXML::ElementDecl], + doctype.children.collect(&:class)) + end + + def test_attlist_entity + doctype = parse(<<-INTERNAL_SUBSET) + + + INTERNAL_SUBSET + assert_equal([REXML::AttlistDecl, REXML::Entity], + doctype.children.collect(&:class)) + end + + def test_notation_attlist + doctype = parse(<<-INTERNAL_SUBSET) + + + INTERNAL_SUBSET + assert_equal([REXML::NotationDecl, REXML::AttlistDecl], + doctype.children.collect(&:class)) + end + end + end +end diff --git a/jni/ruby/test/rexml/parse/test_notation_declaration.rb b/jni/ruby/test/rexml/parse/test_notation_declaration.rb new file mode 100644 index 0000000..0a4e737 --- /dev/null +++ b/jni/ruby/test/rexml/parse/test_notation_declaration.rb @@ -0,0 +1,99 @@ +require 'test/unit' +require 'rexml/document' + +module REXMLTests + class TestParseNotationDeclaration < Test::Unit::TestCase + private + def xml(internal_subset) + <<-XML + + + XML + end + + def parse(internal_subset) + REXML::Document.new(xml(internal_subset)).doctype + end + + class TestCommon < self + def test_name + doctype = parse("") + assert_equal("name", doctype.notation("name").name) + end + end + + class TestExternalID < self + class TestSystem < self + def test_single_quote + doctype = parse(<<-INTERNAL_SUBSET) + + INTERNAL_SUBSET + assert_equal("system-literal", doctype.notation("name").system) + end + + def test_double_quote + doctype = parse(<<-INTERNAL_SUBSET) + + INTERNAL_SUBSET + assert_equal("system-literal", doctype.notation("name").system) + end + end + + class TestPublic < self + class TestPublicIDLiteral < self + def test_single_quote + doctype = parse(<<-INTERNAL_SUBSET) + + INTERNAL_SUBSET + assert_equal("public-id-literal", doctype.notation("name").public) + end + + def test_double_quote + doctype = parse(<<-INTERNAL_SUBSET) + + INTERNAL_SUBSET + assert_equal("public-id-literal", doctype.notation("name").public) + end + end + + class TestSystemLiteral < self + def test_single_quote + doctype = parse(<<-INTERNAL_SUBSET) + + INTERNAL_SUBSET + assert_equal("system-literal", doctype.notation("name").system) + end + + def test_double_quote + doctype = parse(<<-INTERNAL_SUBSET) + + INTERNAL_SUBSET + assert_equal("system-literal", doctype.notation("name").system) + end + end + end + + class TestMixed < self + def test_system_public + doctype = parse(<<-INTERNAL_SUBSET) + + + INTERNAL_SUBSET + assert_equal(["system-name", "public-name"], + doctype.notations.collect(&:name)) + end + + def test_public_system + doctype = parse(<<-INTERNAL_SUBSET) + + + INTERNAL_SUBSET + assert_equal(["public-name", "system-name"], + doctype.notations.collect(&:name)) + end + end + end + end +end diff --git a/jni/ruby/test/rexml/parser/test_sax2.rb b/jni/ruby/test/rexml/parser/test_sax2.rb new file mode 100644 index 0000000..dba5eab --- /dev/null +++ b/jni/ruby/test/rexml/parser/test_sax2.rb @@ -0,0 +1,202 @@ +require "test/unit" +require "rexml/parsers/sax2parser" +require "rexml/sax2listener" + +module REXMLTests +class TestSAX2Parser < Test::Unit::TestCase + class TestDocumentTypeDeclaration < self + private + def xml(internal_subset) + <<-XML + + + XML + end + + class TestEntityDeclaration < self + class Listener + include REXML::SAX2Listener + attr_reader :entity_declarations + def initialize + @entity_declarations = [] + end + + def entitydecl(declaration) + super + @entity_declarations << declaration + end + end + + private + def parse(internal_subset) + listener = Listener.new + parser = REXML::Parsers::SAX2Parser.new(xml(internal_subset)) + parser.listen(listener) + parser.parse + listener.entity_declarations + end + + class TestGeneralEntity < self + class TestValue < self + def test_double_quote + assert_equal([["name", "value"]], parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + + def test_single_quote + assert_equal([["name", "value"]], parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + end + + class TestExternlID < self + class TestSystem < self + def test_with_ndata + declaration = [ + "name", + "SYSTEM", "system-literal", + "NDATA", "ndata-name", + ] + assert_equal([declaration], + parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + + def test_without_ndata + declaration = [ + "name", + "SYSTEM", "system-literal", + ] + assert_equal([declaration], + parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + end + + class TestPublic < self + def test_with_ndata + declaration = [ + "name", + "PUBLIC", "public-literal", "system-literal", + "NDATA", "ndata-name", + ] + assert_equal([declaration], + parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + + def test_without_ndata + declaration = [ + "name", + "PUBLIC", "public-literal", "system-literal", + ] + assert_equal([declaration], parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + end + end + end + + class TestParameterEntity < self + class TestValue < self + def test_double_quote + assert_equal([["%", "name", "value"]], parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + + def test_single_quote + assert_equal([["%", "name", "value"]], parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + end + + class TestExternlID < self + def test_system + declaration = [ + "%", + "name", + "SYSTEM", "system-literal", + ] + assert_equal([declaration], + parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + + def test_public + declaration = [ + "%", + "name", + "PUBLIC", "public-literal", "system-literal", + ] + assert_equal([declaration], parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + end + end + end + + class TestNotationDeclaration < self + class Listener + include REXML::SAX2Listener + attr_reader :notation_declarations + def initialize + @notation_declarations = [] + end + + def notationdecl(*declaration) + super + @notation_declarations << declaration + end + end + + private + def parse(internal_subset) + listener = Listener.new + parser = REXML::Parsers::SAX2Parser.new(xml(internal_subset)) + parser.listen(listener) + parser.parse + listener.notation_declarations + end + + class TestExternlID < self + def test_system + declaration = ["name", "SYSTEM", nil, "system-literal"] + assert_equal([declaration], + parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + + def test_public + declaration = ["name", "PUBLIC", "public-literal", "system-literal"] + assert_equal([declaration], parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + end + + class TestPublicID < self + def test_literal + declaration = ["name", "PUBLIC", "public-literal", nil] + assert_equal([declaration], + parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + end + end + end +end +end diff --git a/jni/ruby/test/rexml/parser/test_tree.rb b/jni/ruby/test/rexml/parser/test_tree.rb new file mode 100644 index 0000000..fa010f6 --- /dev/null +++ b/jni/ruby/test/rexml/parser/test_tree.rb @@ -0,0 +1,42 @@ +require "test/unit" +require "rexml/document" +require "rexml/parsers/treeparser" + +module REXMLTests +class TestTreeParser < Test::Unit::TestCase + class TestInvalid < self + def test_unmatched_close_tag + xml = "" + exception = assert_raise(REXML::ParseException) do + parse(xml) + end + assert_equal(<<-MESSAGE, exception.to_s) +Missing end tag for 'root' (got "not-root") +Line: 1 +Position: #{xml.bytesize} +Last 80 unconsumed characters: + MESSAGE + end + + def test_no_close_tag + xml = "" + exception = assert_raise(REXML::ParseException) do + parse(xml) + end + assert_equal(<<-MESSAGE, exception.to_s) +No close tag for /root +Line: 1 +Position: #{xml.bytesize} +Last 80 unconsumed characters: + MESSAGE + end + + private + def parse(xml) + document = REXML::Document.new + parser = REXML::Parsers::TreeParser.new(xml, document) + parser.parse + end + end +end +end diff --git a/jni/ruby/test/rexml/parser/test_ultra_light.rb b/jni/ruby/test/rexml/parser/test_ultra_light.rb new file mode 100644 index 0000000..4960fc1 --- /dev/null +++ b/jni/ruby/test/rexml/parser/test_ultra_light.rb @@ -0,0 +1,69 @@ +require "test/unit" +require "rexml/parsers/ultralightparser" + +module REXMLTests +class TestUltraLightParser < Test::Unit::TestCase + class TestDocumentTypeDeclaration < self + def test_entity_declaration + assert_equal([ + [ + :start_doctype, + :parent, + "root", + "SYSTEM", + "urn:x-test", + nil, + [:entitydecl, "name", "value"] + ], + [:text, "\n"], + [:start_element, :parent, "root", {}], + [:text, "\n"], + ], + parse(<<-INTERNAL_SUBSET)) + + INTERNAL_SUBSET + end + + private + def xml(internal_subset) + <<-XML + + + XML + end + + def parse(internal_subset) + parser = REXML::Parsers::UltraLightParser.new(xml(internal_subset)) + normalize(parser.parse) + end + + def normalize(root) + root.collect do |child| + normalize_child(child) + end + end + + def normalize_child(child) + tag = child.first + case tag + when :start_doctype + normalized_parent = :parent + normalized_doctype = child.dup + normalized_doctype[1] = normalized_parent + normalized_doctype + when :start_element + tag, parent, name, attributes, *children = child + normalized_parent = :parent + normalized_children = children.collect do |sub_child| + normalize_child(sub_child) + end + [tag, normalized_parent, name, attributes, *normalized_children] + else + child + end + end + end +end +end diff --git a/jni/ruby/test/rexml/rexml_test_utils.rb b/jni/ruby/test/rexml/rexml_test_utils.rb new file mode 100644 index 0000000..57fe65c --- /dev/null +++ b/jni/ruby/test/rexml/rexml_test_utils.rb @@ -0,0 +1,6 @@ +require 'test/unit' +module REXMLTestUtils + def fixture_path(*components) + File.join(File.dirname(__FILE__), "data", *components) + end +end diff --git a/jni/ruby/test/rexml/test_attributes.rb b/jni/ruby/test/rexml/test_attributes.rb new file mode 100644 index 0000000..aea1d88 --- /dev/null +++ b/jni/ruby/test/rexml/test_attributes.rb @@ -0,0 +1,222 @@ +require 'test/unit/testcase' +require 'rexml/document' + +module REXMLTests + class AttributesTester < Test::Unit::TestCase + include REXML + def test_accessor + doc = Document.new("") + assert_equal '3', doc.root.attributes['att'] + assert_equal '2', doc.root.attributes['bar:att'] + doc.root.attributes['att'] = 5 + assert_equal '5', doc.root.attributes['att'] + end + + def test_each_attribute + doc = Document.new('') + doc.root.attributes.each_attribute {|attr| + if attr.expanded_name == 'x' + assert_equal '1', attr.value + elsif attr.expanded_name == 'y' + assert_equal '2', attr.value + else + assert_fail "No such attribute!!" + end + } + end + + def test_each + doc = Document.new('') + doc.root.attributes.each {|name, value| + if name == 'x' + assert_equal '1', value + elsif name == 'y' + assert_equal '2', value + else + assert_fail "No such attribute!!" + end + } + end + + def test_get_attribute + doc = Document.new('') + assert_equal '2', doc.root.attributes.get_attribute("foo").value + assert_equal '1', doc.root.attributes.get_attribute("x:foo").value + end + + def test_size + doc = Document.new("") + assert_equal 4, doc.root.attributes.length + end + + def test_setter + doc = Document.new("") + doc.root.attributes['y:foo'] = '2' + assert_equal '2', doc.root.attributes['y:foo'] + doc.root.attributes['foo'] = '4' + assert_equal '4', doc.root.attributes['foo'] + doc.root.attributes['x:foo'] = nil + assert_equal 3, doc.root.attributes.size + end + + def test_delete + doc = Document.new("") + doc.root.attributes.delete 'foo' + assert_equal 6, doc.root.attributes.size + assert_equal '1', doc.root.attributes['x:foo'] + + doc.root.attributes.delete 'x:foo' + assert_equal 5, doc.root.attributes.size + + attr = doc.root.attributes.get_attribute('y:foo') + doc.root.attributes.delete attr + assert_equal 4, doc.root.attributes.size + + assert_equal '4', doc.root.attributes['z:foo'] + end + + def test_prefixes + doc = Document.new("") + prefixes = doc.root.attributes.prefixes + assert_equal 2, prefixes.size + assert_equal 0, (prefixes - ['x', 'y']).size + end + + # Contributed by Mike Stok + def test_values_with_apostrophes + doc = Document.new(%q##) + s = doc.to_s + assert(s =~ /h1='1'2''/) + assert(s =~ /h2='1"2'/) + end + + # Submitted by Kou + def test_namespace_conflict + assert_raise( ParseException, + "Declaring two attributes with the same namespace should be an error" ) do + REXML::Document.new <<-XML + + + + XML + end + + REXML::Document.new("") + end + + # Submitted by Kou + def test_attribute_deletion + e = REXML::Element.new + e.add_namespace("a", "http://a/") + e.add_namespace("b", "http://b/") + e.add_attributes({"c" => "cc", "a:c" => "cC", "b:c" => "CC"}) + + e.attributes.delete("c") + assert_nil(e.attributes.get_attribute("c")) + + before_size = e.attributes.size + e.attributes.delete("c") + assert_nil(e.attributes.get_attribute("c")) + assert_equal(before_size, e.attributes.size) + + e.attributes.delete(e.attributes.get_attribute("a:c")) + assert_nil(e.attributes.get_attribute("a:c")) + + e.attributes.delete("b:c") + assert_nil(e.attributes.get_attribute("b:c")) + + before_size = e.attributes.size + e.attributes.delete(e.attributes.get_attribute("b:c")) + assert_nil(e.attributes.get_attribute("b:c")) + assert_equal(before_size, e.attributes.size) + + before_size = e.attributes.size + e.attributes.delete("c") + assert_nil(e.attributes.get_attribute("c")) + assert_equal(before_size, e.attributes.size) + + e.add_attribute("c", "cc") + + e.attributes.delete(e.attributes.get_attribute("c")) + assert_nil(e.attributes.get_attribute("c")) + end + + # Submitted by Kou + def test_element_usage + attr = Attribute.new("name", "value") + elem = Element.new("elem") + a = Attribute.new(attr, elem) + assert_equal(elem, a.element) + end + + def attr_test(attr_name,attr_value) + a1 = REXML::Attribute.new(attr_name,attr_value) + + s1 = a1.value + s2 = a1.value + + #p s1 + #p s2 + assert_equal(s1,s2) + + a2 = REXML::Attribute.new(attr_name,attr_value) + + a2.to_s # NB invocation of to_s + s1 = a2.value + s2 = a2.value + + #p s1 + #p s2 + assert_equal(s1,s2) + end + + def test_amp_attributes + attr_test('name','value with & ampersand only') + end + + def test_amp_and_lf_attributes + attr_test('name','value with LF & ampersand') + end + + def test_quoting + d = Document.new(%q{}) + assert_equal( %q{}, d.to_s ) + d.root.context[:attribute_quote] = :quote + assert_equal( %q{}, d.to_s ) + + d = Document.new(%q{}) + assert_equal( %q{}, d.to_s ) + d.root.context[:attribute_quote] = :quote + assert_equal( %q{}, d.to_s ) + end + + def test_ticket_127 + doc = Document.new + doc.add_element 'a', { 'v' => 'x & y' } + assert doc.to_s.index(';') + end + + def test_to_a_with_namespaces + document = Document.new(<<-XML) + + + +XML + child = document.root.elements["child"] + assert_equal([ + "attribute='no-ns'", + "ns1:attribute='ns1'", + "ns2:attribute='ns2'", + "other-attribute='other-value'", + ], + child.attributes.to_a.collect(&:to_string).sort) + end + end +end diff --git a/jni/ruby/test/rexml/test_attributes_mixin.rb b/jni/ruby/test/rexml/test_attributes_mixin.rb new file mode 100644 index 0000000..17cca4e --- /dev/null +++ b/jni/ruby/test/rexml/test_attributes_mixin.rb @@ -0,0 +1,31 @@ +require 'test/unit' +require 'rexml/document' + +module REXMLTests + class TestAttributes < Test::Unit::TestCase + def setup + @ns_a = "urn:x-test:a" + @ns_b = "urn:x-test:b" + element_string = <<-"XMLEND" + + XMLEND + @attributes = REXML::Document.new(element_string).root.attributes + end + + def test_get_attribute_ns + assert_equal("1", @attributes.get_attribute_ns("", "a").value) + assert_equal("2", @attributes.get_attribute_ns("", "b").value) + assert_equal("3", @attributes.get_attribute_ns(@ns_a, "c").value) + assert_equal("4", @attributes.get_attribute_ns(@ns_a, "d").value) + assert_equal("5", @attributes.get_attribute_ns(@ns_a, "e").value) + assert_equal("6", @attributes.get_attribute_ns(@ns_b, "f").value) + end + end +end diff --git a/jni/ruby/test/rexml/test_changing_encoding.rb b/jni/ruby/test/rexml/test_changing_encoding.rb new file mode 100644 index 0000000..5a085e2 --- /dev/null +++ b/jni/ruby/test/rexml/test_changing_encoding.rb @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +require 'rexml/encoding' + +module REXMLTests + class ChangingEncodings < Test::Unit::TestCase + def initialize a + @u = '鴻 祉 泣 臂' + @e = @u.encode("EUC-JP") + @f = Foo.new + super + end + + class Foo + include REXML::Encoding + end + + # Note that these tests must be executed in order for the third one to + # actually test anything. + def test_0_euc + @f.encoding = 'EUC-JP' + assert_equal( @u, @f.decode(@e) ) + # This doesn't happen anymore, for some reason + #assert_raises( Iconv::IllegalSequence, "Decoding unicode should fail" ) { + # @f.decode(@u) == @u + #} + end + + def test_1_utf + @f.encoding = 'UTF-8' + assert_not_equal( @u, @f.decode( @e ) ) + assert_equal( @u, @f.decode( @u ) ) + end + + def test_2_euc + @f.encoding = 'EUC-JP' + assert_equal( @u, @f.decode(@e) ) + # This doesn't happen anymore, for some reason + #assert_raises( Iconv::IllegalSequence, "Decoding unicode should fail" ) { + # @f.decode(@u) == @u + #} + end + end +end diff --git a/jni/ruby/test/rexml/test_comment.rb b/jni/ruby/test/rexml/test_comment.rb new file mode 100644 index 0000000..d5e78a5 --- /dev/null +++ b/jni/ruby/test/rexml/test_comment.rb @@ -0,0 +1,25 @@ +require "test/unit/testcase" + +require 'rexml/document' + +module REXMLTests + class CommentTester < Test::Unit::TestCase + # Bug #5278 + def test_hyphen_end_line_in_doctype + xml = <<-XML + + +]> + + XML + document = REXML::Document.new(xml) + comments = document.doctype.children.find_all do |child| + child.is_a?(REXML::Comment) + end + assert_equal([" comment end with hyphen -\n here "], + comments.collect(&:to_s)) + end + end +end diff --git a/jni/ruby/test/rexml/test_contrib.rb b/jni/ruby/test/rexml/test_contrib.rb new file mode 100644 index 0000000..fa84ebe --- /dev/null +++ b/jni/ruby/test/rexml/test_contrib.rb @@ -0,0 +1,584 @@ +# coding: binary + +require_relative "rexml_test_utils" + +require "rexml/document" +require "rexml/parseexception" +require "rexml/formatters/default" + +module REXMLTests + class ContribTester < Test::Unit::TestCase + include REXMLTestUtils + include REXML + + XML_STRING_01 = < + + + Thomas, David; Hunt, Andrew + english + Addison-Wesley + Programming Ruby. The Pragmatic Programmer's Guide + 2000 + + + Blammo, Blah + english + Hubbabubba + Foozboozer's Life + Book + 2002 + + +DELIMITER + + XML_STRING_02 = < + + english + Addison-Wesley + Programming Ruby. The Pragmatic Programmer's Guide + Book + 2000 + + + Blammo, Blah + english + Hubbabubba + Foozboozer's Life + Book + 2002 + + +DELIMITER + + # Tobias Reif + def test_bad_doctype_Tobias + source = <<-EOF + --> + + + ' + > + ] + > + EOF + doc = REXML::Document.new source + doc.write(out="") + assert(out[/>\'>/] != nil, "Couldn't find >'>") + assert(out[/\]>/] != nil, "Couldn't find ]>") + end + + # Peter Verhage + def test_namespace_Peter + source = <<-EOF + + + + + + + + EOF + doc = REXML::Document.new source + assert_equal "myprog-config", doc.root.name + count = 0 + REXML::XPath.each(doc, "x:myprog-config/x:main/x:parameter", + {"x"=>"http://someurl/program/version"}) { |element| + assert_equal "name", element.attributes["name"] + count += 1; + } + assert_equal 1, count + assert_equal "myprog-config", doc.elements["config:myprog-config"].name + end + + # Tobias Reif + def test_complex_xpath_Tobias + source = <<-EOF + + + + + + + + + + + + + EOF + # elements that have child elements + # but not grandchildren + # and not children that don't have a style attribute + # and not children that have a unique style attribute + complex_path = "*[* "+ + "and not(*/node()) "+ + "and not(*[not(@style)]) "+ + "and not(*/@style != */@style)]" + doc = REXML::Document.new source + results = REXML::XPath.match( doc.root, complex_path ) + assert(results) + assert_equal 1, results.size + assert_equal "foo", results[0].name + end + + # "Chris Morris" + def test_extra_newline_on_read_Chris + text = 'test text' + e = REXML::Element.new('Test') + e.add_text(text) + REXML::Formatters::Default.new.write(e,out="") + + doc = REXML::Document.new(out) + outtext = doc.root.text + + assert_equal(text, outtext) + end + + # Tobias Reif + def test_other_xpath_Tobias + schema = <<-DELIM + + + + + + + + + + + + + + + + DELIM + + doc = REXML::Document.new schema + + result = REXML::XPath.first(doc.root, 'xs:element[descendant::xs:element[@ref]]') + assert result + assert_equal "svg", result.attributes['name'] + result = REXML::XPath.first(doc, 'element[descendant::element[@ref]]') + assert_nil result + end + + #this first test succeeds, to check if stuff is set up correctly + def test_xpath_01_TobiasReif + doc = Document.new XML_STRING_01.dup + desired_result = Document.new 'Thomas, David; Hunt, Andrew' + xpath = '//author' + result = XPath.first(doc, xpath) + assert_equal desired_result.to_s, result.to_s + end + + def test_xpath_whitespace_TobiasReif + # same as above, with whitespace in XPath + doc = Document.new(XML_STRING_01.dup) + desired_result = Document.new('Thomas, David; Hunt, Andrew') + xpath = "\/\/author\n \n" + result = XPath.first(doc, xpath) + failure_message = "\n[[[TR: AFAIK, whitespace should be allowed]]]\n" + assert_equal(desired_result.to_s, result.to_s, failure_message) + end + + def test_xpath_02_TobiasReif + doc = Document.new XML_STRING_01.dup + desired_result = Document.new 'Thomas, David; Hunt, Andrew' + # Could that quirky + # Programmer',"'",'s + # be handled automatically, somehow? + # Or is there a simpler way? (the below XPath should match the author element above, + # AFAIK; I tested it inside an XSLT) + xpath = %q{/biblio/entry[ + title/text()=concat('Programming Ruby. The Pragmatic Programmer',"'",'s Guide') + and + year='2000' + ]/author} + result = XPath.first(doc, xpath) + failure_message = "\nHow to handle the apos inside the string inside the XPath?\nXPath = #{xpath}\n" + assert_equal desired_result.to_s, result.to_s, failure_message + end + + def test_xpath_03_TobiasReif + doc = Document.new XML_STRING_02.dup + desired_result_string = " + english + Addison-Wesley + Programming Ruby. The Pragmatic Programmer's Guide + Book + 2000 + " + Document.new desired_result_string + xpath = "/biblio/entry[not(author)]" + result = XPath.first(doc, xpath) + assert_equal desired_result_string, result.to_s + end + + def test_umlaut + koln_iso = "K\xf6ln" + koln_utf = "K\xc3\xb6ln" + source_iso = "#{koln_iso}" + source_utf = "#{koln_utf}" + + if String.method_defined? :encode + koln_iso.force_encoding('iso-8859-1') + koln_utf.force_encoding('utf-8') + source_iso.force_encoding('iso-8859-1') + source_utf.force_encoding('utf-8') + end + + doc = REXML::Document.new(source_iso) + assert_equal('ISO-8859-1', doc.xml_decl.encoding) + assert_equal(koln_utf, doc.root.text) + doc.write(out="") + assert_equal(source_iso, out ) + doc.xml_decl.encoding = 'UTF-8' + doc.write(out="") + assert_equal(source_utf, out) + + doc = Document.new <<-EOF + + +Technik + +Technik +Die Technik ist das R\xFCckgrat der meisten Gesch\xFCftsprozesse bei Home of the Brave. Deshalb sollen hier alle relevanten technischen Abl\xFCufe, Daten und Einrichtungen beschrieben werden, damit jeder im Bedarfsfall die n\xFCtigen Informationen, Anweisungen und Verhaltensempfehlungen nachlesen und/oder abrufen kann. + + + Flash + N\xFCtzliches von Flashern f\xFCr Flasher. + CVS-FAQ + FAQ zur Benutzung von CVS bei HOB + + +EOF + tn = XPath.first(doc, "//nebenspalte/text()[2]") + expected_iso = "N\xFCtzliches von Flashern f\xFCr Flasher." + expected_utf = expected_iso.unpack('C*').pack('U*') + expected_iso.force_encoding(::Encoding::ISO_8859_1) + expected_utf.force_encoding(::Encoding::UTF_8) + assert_equal(expected_utf, tn.to_s.strip) + f = REXML::Formatters::Default.new + f.write( tn, Output.new(o = "", "ISO-8859-1") ) + assert_equal(expected_iso, o.strip) + + doc = File.open(fixture_path('xmlfile-bug.xml')) {|file| Document.new file } + tn = XPath.first(doc, "//nebenspalte/text()[2]") + assert_equal(expected_utf, tn.to_s.strip) + f.write( tn, Output.new(o = "", "ISO-8859-1") ) + assert_equal(expected_iso, o.strip) + end + + def test_element_cloning_namespace_Chris + aDoc = REXML::Document.new '

Dummy title

' + + anElement = anElement = aDoc.elements[1] + elementAttrPrefix = anElement.attributes.get_attribute('content').prefix + + aClone = anElement.clone + cloneAttrPrefix = aClone.attributes.get_attribute('content').prefix + + assert_equal( elementAttrPrefix , cloneAttrPrefix ) + end + + def test_namespaces_in_attlist_tobias + in_string = File.open(fixture_path('foo.xml'), 'r') do |file| + file.read + end + + doc = Document.new in_string + + assert_nil XPath.first(doc,'//leg') + assert_equal 'http://www.foo.com/human', doc.root.elements[1].namespace + assert_equal 'human leg', + XPath.first(doc, '//x:leg/text()', {'x'=>'http://www.foo.com/human'}).to_s + end + + # Alun ap Rhisiart + def test_less_than_in_element_content + doc = File.open(fixture_path('ProductionSupport.xml')) do |source| + REXML::Document.new source + end + h = Hash.new + doc.elements.each("//CommonError") { |el| + h[el.elements['Key'].text] = 'okay' + } + assert(h.include?('MotorInsuranceContract(Object)>>#error:')) + end + + # XPaths provided by Thomas Sawyer + def test_various_xpath + #@doc = REXML::Document.new('

') + doc = REXML::Document.new('

3

') + + [['/r', REXML::Element], + ['/r/p/c', REXML::Element], + ['/r/attribute::a', Attribute], + ['/r/@a', Attribute], + ['/r/attribute::*', Attribute], + ['/r/@*', Attribute], + ['/r/p/c/attribute::b', Attribute], + ['/r/p/c/@b', Attribute], + ['/r/p/c/attribute::*', Attribute], + ['/r/p/c/@*', Attribute], + ['//c/attribute::b', Attribute], + ['//c/@b', Attribute], + ['//c/attribute::*', Attribute], + ['//c/@*', Attribute], + ['.//node()', REXML::Node ], + ['.//node()[@a]', REXML::Element ], + ['.//node()[@a="1"]', REXML::Element ], + ['.//node()[@b]', REXML::Element ], # no show, why? + ['.//node()[@b="2"]', REXML::Element ] + ].each do |xpath,kind| + begin + REXML::XPath.each( doc, xpath ) do |what| + assert_kind_of( kind, what, "\n\nWrong type (#{what.class}) returned for #{xpath} (expected #{kind.name})\n\n" ) + end + rescue Exception + puts "PATH WAS: #{xpath}" + raise + end + end + + [ + ['/r', 'attribute::a', Attribute ], + ['/r', '@a', Attribute ], + ['/r', 'attribute::*', Attribute ], + ['/r', '@*', Attribute ], + ['/r/p/c', 'attribute::b', Attribute ], + ['/r/p/c', '@b', Attribute ], + ['/r/p/c', 'attribute::*', Attribute ], + ['/r/p/c', '@*', Attribute ] + ].each do |nodepath, xpath, kind| + begin + context = REXML::XPath.first(doc, nodepath) + REXML::XPath.each( context, xpath ) do |what| + assert_kind_of kind, what, "Wrong type (#{what.class}) returned for #{xpath} (expected #{kind.name})\n" + end + rescue Exception + puts "PATH WAS: #{xpath}" + raise + end + end + end + + def test_entities_Holden_Glova + document = <<-EOL + + + + + + + + + + + + + ]> + + + + + uga.rb + 0444 + &rbconfig.libdir;/rexml + ... the file here + + + booga.h + 0444 + &rbconfig.includedir; + ... the file here + + + foo.so + 0555 + &rbconfig.sitearchdir;/rexml + Li4uIHRoZSBmaWxlIGhlcmU=\n + + + + + EOL + + file_xpath = '/rubynet/pkg/files/file' + + root = REXML::Document.new(document) + + root.elements.each(file_xpath) do |metadata| + text = metadata.elements['path'].get_text.value + assert text !~ /&rbconfig/, "'#{text}' failed" + end + + #Error occurred in test_package_file_opens(TC_PackageInstall): + # ArgumentError: + #illegal access mode &rbconfig.prefix;/lib/rexml + # + #[synack@Evergreen] src $ ruby --version + #ruby 1.6.7 (2002-03-01) [i686-linux-gnu] + # + #It looks like it expanded the first entity, but didn't reparse it for more + #entities. possible bug - or have I mucked this up? + end + + def test_whitespace_after_xml_decl + Document.new < + + + + +EOL + end + + def test_external_entity + xp = '//channel/title' + + %w{working.rss broken.rss}.each do |path| + File.open(File.join(fixture_path(path))) do |file| + doc = REXML::Document.new file.readlines.join('') + + # check to make sure everything is kosher + assert_equal( doc.root.class, REXML::Element ) + assert_equal( doc.root.elements.class, REXML::Elements ) + + # get the title of the feed + assert( doc.root.elements[xp].kind_of?( REXML::Element ) ) + end + end + end + + def test_maintain_dtd + src = %q{ + + +%extern-packages; +%extern-common; +]>} + doc = Document.new( src ) + doc.write( out="" ) + src = src.tr('"', "'") + out = out.tr('"', "'") + assert_equal( src, out ) + end + + def test_text_nodes_nomatch + source = "test" + d = REXML::Document.new( source ) + r = REXML::XPath.match( d, %q{/root/child[text()="no-test"]} ) + assert_equal( 0, r.size ) + end + + def test_raw_Terje_Elde + f = REXML::Formatters::Default.new + txt = 'abcødef' + a = Text.new( txt,false,nil,true ) + f.write(a,out="") + assert_equal( txt, out ) + + txt = 'abcødef' + a = Document.new( txt, { :raw => ["russell"] } ) + f.write(a,out="") + assert_equal( txt, out ) + end + + def test_indenting_error + a=Element.new("test1") + b=Element.new("test2") + c=Element.new("test3") + b << c + a << b + + REXML::Formatters::Pretty.new.write(a,"") + end + + def test_pos + require 'tempfile' + Tempfile.create("tidal") {|testfile| + testdata = %Q{ +
+760 +50 +
+
+} + + testfile.puts testdata + testfile.rewind + assert_nothing_raised do + REXML::Document.new(testfile) + end + } + end + + def test_deep_clone + a = Document.new( '' ) + b = a.deep_clone + assert_equal a.to_s, b.to_s + end + + def test_double_escaping + data = 'AT&T' + xml = "" + + doc = REXML::Document.new(xml) + description = doc.find {|e| e.name=="description"} + assert_equal data, description.text + end + + def test_ticket_12 + cfg = "ab" + + config = REXML::Document.new( cfg ) + + assert_equal( "a", config.elements[ "//child1" ].text ) + end + +=begin + # This is a silly test, and is low priority + def test_namespace_serialization_tobi_reif + doc = Document.new ' + + ' + ns = 'http://www.foo.foo' + ns_declaration={'f'=>ns} + returned = XPath.match(doc,'//f:p',ns_declaration) + # passes: + assert( (returned[0].namespace==ns), 'namespace should be '+ns) + serialized = returned.to_s + serialized_and_parsed = Document.new(serialized) + puts 'serialized: '+serialized + # ... currently brings + # prefix b is undeclared (!) + assert( (serialized_and_parsed.namespace==ns), + 'namespace should still be '+ns.inspect+ + ' and not '+serialized_and_parsed.namespace.inspect) + # ... currently results in a failure: + # 'namespace should still be "http://www.foo.foo" and not ""' + end +=end + end +end diff --git a/jni/ruby/test/rexml/test_core.rb b/jni/ruby/test/rexml/test_core.rb new file mode 100644 index 0000000..97aada9 --- /dev/null +++ b/jni/ruby/test/rexml/test_core.rb @@ -0,0 +1,1467 @@ +# coding: binary + +require_relative "rexml_test_utils" + +require "rexml/document" +require "rexml/parseexception" +require "rexml/output" +require "rexml/source" +require "rexml/formatters/pretty" +require "rexml/undefinednamespaceexception" + +require_relative "listener" + +module REXMLTests + class Tester < Test::Unit::TestCase + include REXMLTestUtils + include REXML + def setup + @xsa_source = <<-EOL + + + + + + + + Lars Marius Garshol + larsga@garshol.priv.no + http://www.stud.ifi.uio.no/~lmariusg/ + + + EOL + end + + def test_bad_markup + [ + " foo ", + '<0/>', + '&', + '&a', +# '&a;', # FIXME + '', + '', + '', + '', + '', + '', + '', + "", + "\f", + "", + "\000", +# FIXME '', + '', + '￿', +# FIXME '', +# FIXME '', + ].each do |src| + assert_raise( ParseException, %Q{Parse #{src.inspect} should have failed!} ) do + Document.new(src) + end + end + end + + def test_attribute + # Testing constructors + #a = Attribute.new "hello", "dolly" + #b = Attribute.new a + #d = Document.new( "" ) + #c = d[0].attributes.get_attribute( "hello" ) + + #assert_equal a, b + #for attr in [ a, b, c] + # assert_equal "hello", attr.name + # assert_equal "dolly", attr.value + #end + + # This because of a reported bug in attribute handling in 1.0a8 + source = 'blah' + doc = Document.new source + doc.elements.each do |a| + a.attributes['att'] << 'B' + assert_equal "AB", a.attributes['att'] + a.attributes['att'] = 'C' + assert_equal "C", a.attributes['att'] + end + + # Bryan Murphy + text = "this is a {target[@name='test']/@value} test" + source = <<-EOL + + + EOL + + xml = Document.new source + value = xml.root.attributes["search"] + assert_equal text, value.to_s + + e = Element.new "test" + e.add_attributes({ "name1" => "test1", "name4" => "test4" }) + e.add_attributes([["name3","test3"], ["name2","test2"]]) + assert_equal "test1", e.attributes["name1"] + assert_equal "test2", e.attributes["name2"] + assert_equal "test3", e.attributes["name3"] + assert_equal "test4", e.attributes["name4"] + + # ensure that the attributes come out in sorted order + assert_equal %w().join(' '), e.to_s + end + + def test_cdata + test = "The quick brown fox jumped + & < & < \" ' + over the lazy dog." + + source = "" + d = REXML::Document.new( source ) + + # Test constructors + cdata = d[0][0] + assert_equal test, cdata.value + end + + def test_comment + string = "This is a new comment!" + source = "" + comment = Comment.new string + REXML::Formatters::Default.new.write( comment, out = "" ) + assert_equal(source, out) + + comment2 = Comment.new comment + assert_equal(comment, comment2) + + assert_raise(ParseException) { + REXML::Document.new("") + } + assert_raise(ParseException) { + REXML::Document.new(" + + + + + + + + + + + + + + + + + + EOF + doc = Document.new source + assert_equal "someuri", doc.root.namespace + assert_equal "default", doc.root.elements[1].namespace + assert_equal "someuri", doc.root.elements[2].namespace + assert_equal "notdefault", doc.root.elements[ 3 ].namespace + + # Testing namespaces in attributes + source = <<-EOF + + + + + + EOF + doc = Document.new source + b = doc.root.elements["b"] + assert_equal "x", b.attributes["b:a"] + assert_equal "y", b.attributes["a"] + + doc = Document.new + doc.add_element "sean:blah" + doc.root.text = "Some text" + out = "" + doc.write(out) + assert_equal "Some text", out + end + + + def test_add_namespace + e = Element.new 'a' + e.add_namespace 'someuri' + e.add_namespace 'foo', 'otheruri' + e.add_namespace 'xmlns:bar', 'thirduri' + assert_equal 'someuri', e.attributes['xmlns'] + assert_equal 'otheruri', e.attributes['xmlns:foo'] + assert_equal 'thirduri', e.attributes['xmlns:bar'] + end + + + def test_big_documentation + d = File.open(fixture_path("documentation.xml")) {|f| Document.new f } + assert_equal "Sean Russell", d.elements["documentation/head/author"].text.tr("\n\t", " ").squeeze(" ") + out = "" + d.write out + end + + def test_tutorial + doc = File.open(fixture_path("tutorial.xml")) {|f| Document.new f } + out = "" + doc.write out + end + + def test_stream + c = Listener.new + File.open(fixture_path("documentation.xml")) do |f| + Document.parse_stream( f, c ) + end + assert(c.ts, "Stream parsing apparantly didn't parse the whole file") + assert(c.te, "Stream parsing dropped end tag for documentation") + + Document.parse_stream(" ", c) + + Document.parse_stream("<>&", c) + assert_equal('<>&', c.normalize) + end + + def test_line + f = File.new(fixture_path("bad.xml")) + Document.new f + assert_fail "There should have been an error" + rescue Exception + # We should get here + assert($!.line == 5, "Should have been an error on line 5, "+ + "but was reported as being on line #{$!.line}" ) + ensure + f.close if f + end + + def test_substitution + val = "a'b\"c" + el = Element.new("a") + el.attributes["x"] = val + REXML::Formatters::Default.new.write(el, out="") + + nel = Document.new( out) + assert_equal( val, nel.root.attributes["x"] ) + end + + def test_exception + source = SourceFactory.create_from "" + p = ParseException.new( "dummy message", source ) + begin + raise "dummy" + rescue Exception + p.continued_exception = $! + end + end + + def test_bad_content + in_gt = 'content>content' + in_lt = 'content' + + # This is OK + tree_gt = Document.new in_gt + assert_equal "content>content", tree_gt.elements[1].text + # This isn't + begin + Document.new in_lt + assert_fail "Should have gotten a parse error" + rescue ParseException + end + end + + def test_iso_8859_1_output_function + out = "" + output = Output.new( out ) + koln_iso_8859_1 = "K\xF6ln" + koln_utf8 = "K\xc3\xb6ln" + source = Source.new( koln_iso_8859_1, 'iso-8859-1' ) + results = source.scan(/.*/)[0] + koln_utf8.force_encoding('UTF-8') if koln_utf8.respond_to?(:force_encoding) + assert_equal koln_utf8, results + output << results + if koln_iso_8859_1.respond_to?(:force_encoding) + koln_iso_8859_1.force_encoding('ISO-8859-1') + end + assert_equal koln_iso_8859_1, out + end + + def test_attributes_each + doc = Document.new("") + count = 0 + doc.root.elements[1].attributes.each {|k,v| count += 1 } + assert_equal 4, count + end + + def test_delete_namespace + doc = Document.new "" + doc.root.delete_namespace + doc.root.delete_namespace 'x' + assert_equal "", doc.to_s + end + + def test_each_element_with_attribute + doc = Document.new "" + arry = [] + block = proc { |e| + assert arry.include?(e.name) + arry.delete e.name + } + # Yields b, c, d + arry = %w{b c d} + doc.root.each_element_with_attribute( 'id', &block ) + assert_equal 0, arry.size + # Yields b, d + arry = %w{b d} + doc.root.each_element_with_attribute( 'id', '1', &block ) + assert_equal 0, arry.size + # Yields b + arry = ['b'] + doc.root.each_element_with_attribute( 'id', '1', 1, &block ) + assert_equal 0, arry.size + # Yields d + arry = ['d'] + doc.root.each_element_with_attribute( 'id', '1', 0, 'd', &block ) + assert_equal 0, arry.size + end + def test_each_element_with_text + doc = Document.new 'bbd' + arry = [] + block = proc { |e| + assert arry.include?(e.name) + arry.delete e.name + } + # Yields b, c, d + arry = %w{b c d} + doc.root.each_element_with_text(&block) + assert_equal 0, arry.size + # Yields b, d + arry = %w{b c} + doc.root.each_element_with_text( 'b', &block ) + assert_equal 0, arry.size + # Yields b + arry = ['b'] + doc.root.each_element_with_text( 'b', 1, &block ) + assert_equal 0, arry.size + # Yields d + arry = ['d'] + doc.root.each_element_with_text( nil, 0, 'd', &block ) + assert_equal 0, arry.size + end + + def test_element_parse_stream + s = Source.new( "some text" ) + l = Listener.new + class << l + def tag_start name, attributes + raise "Didn't find proper tag name" unless 'a'==name + end + end + + Document::parse_stream(s, l) + end + + def test_deep_clone + a = Document.new( 'texttexttext' ) + b = a.deep_clone + assert_equal a.to_s, b.to_s + + a = Document.new( 'some < text more > text > ' ) + b = a.deep_clone + assert_equal a.to_s, b.to_s + c = Document.new( b.to_s ) + assert_equal a.to_s, c.to_s + end + + def test_whitespace_before_root + a = < + + + + +EOL + d = Document.new(a) + b = "" + d.write( b ) + assert_equal a,b + end + + def test_entities + a = Document.new( 'eeü' ) + assert_equal('ee端'.force_encoding("UTF-8"), a.root.text) + end + + def test_element_decl + element_decl = Source.new(" +]>") + doc = Document.new( element_decl ) + d = doc[0] + assert_equal("", d.to_s.split(/\n/)[1].strip) + end + + def test_attlist_decl + doc = Document.new <<-EOL + + + ]> + + EOL + assert_equal 'gobble', doc.root.attributes['bar'] + assert_equal 'xxx', doc.root.elements[2].namespace + assert_equal 'two', doc.root.elements[1].namespace + assert_equal 'foo', doc.root.namespace + + doc = Document.new <<-EOL + + + + ]> + + EOL + prefixes = doc.root.prefixes.sort + correct = ['svg', 'xlink', 'xml'] + assert_equal correct, prefixes + end + + def test_attlist_write + doc = File.open(fixture_path("foo.xml")) {|file| Document.new file } + out = '' + doc.write(out) + end + + def test_more_namespaces + assert_raise( REXML::UndefinedNamespaceException, + %Q{Should have gotten an Undefined Namespace error} ) { + Document.new("

") + } + doc2 = Document.new("

") + es = XPath.match(doc2, '//c') + assert_equal 0, es.size + es = XPath.match(doc2, '//n:c') + assert_equal 1, es.size + doc2.root.add_namespace('m', '2') + doc2.root.add_element("m:o") + es = XPath.match(doc2, './/o') + assert_equal 0, es.size + es = XPath.match(doc2, '//n:c') + assert_equal 1, es.size + end + + def test_ticket_51 + doc = REXML::Document.new <<-EOL + + X + Y + + + Z + + + EOL + + # The most common case. People not caring about the namespaces much. + assert_equal( "XY", XPath.match( doc, "/test/a/text()" ).join ) + assert_equal( "XY", XPath.match( doc, "/test/x:a/text()" ).join ) + # Surprising? I don't think so, if you believe my definition of the "common case" + assert_equal( "XYZ", XPath.match( doc, "//a/text()" ).join ) + + # These are the uncommon cases. Namespaces are actually important, so we define our own + # mappings, and pass them in. + assert_equal( "XY", XPath.match( doc, "/f:test/f:a/text()", { "f" => "1" } ).join ) + # The namespaces are defined, and override the original mappings + assert_equal( "", XPath.match( doc, "/test/a/text()", { "f" => "1" } ).join ) + assert_equal( "", XPath.match( doc, "/x:test/x:a/text()", { "f" => "1" } ).join ) + assert_equal( "", XPath.match( doc, "//a/text()", { "f" => "1" } ).join ) + end + + def test_processing_instruction + d = Document.new("") + assert_equal 4, XPath.match(d, '//processing-instruction()' ).size + match = XPath.match(d, "//processing-instruction('foo3')" ) + assert_equal 1, match.size + assert_equal 'bar3', match[0].content + end + + def test_oses_with_bad_EOLs + Document.new("\n\n\n\n\n\n\n\n") + end + + # Contributed (with patch to fix bug) by Kouhei + def test_ignore_whitespace + source = " abc " + + context_all = {:ignore_whitespace_nodes => :all} + context_a = {:ignore_whitespace_nodes => %(a)} + context_b = {:ignore_whitespace_nodes => %(b)} + + tests = [[[" abc ", "def"], context_all], + [[" abc ", "def"], context_a], + [[" ", " abc ", "def", " "], context_b]] + + tests.each do |test| + assert_equal(test[0], Document.new(source, test[1]).root.texts.collect{|x| + x.to_s}) + end + end + + def test_0xD_in_preface + doc = "\x0D\x0D" + doc = Document.new doc + end + + def test_hyphens_in_doctype + doc = REXML::Document.new <<-EOQ + + + + + + EOQ + + assert_equal('a-b-c', doc.doctype.name) + end + + def test_accents + docs = [ + %Q{ + + + + +}, + ' + + + + +', + %Q{ + + + + +}, + %Q{ + + + + +} ] + docs.each_with_index { |d,i| + begin + REXML::Document.new(d) + rescue + puts "#{i} => #{docs[i]}" + raise + end + } + end + + def test_replace_text + e = REXML::Element.new( "a" ) + e.add_text( "foo" ) + assert_equal( "foo", e.to_s ) + e[0].value = "bar" + assert_equal( "bar", e.to_s ) + e[0].value = "<" + assert_equal( "<", e.to_s ) + assert_equal( "<", e[0].value ) + end + + + def test_write_doctype + ## XML Document and Declaration + document = REXML::Document.new + xmldecl = REXML::XMLDecl.new("1.0", "UTF-8") + document.add(xmldecl) + s = "" + document.write(s) + + ## XML Doctype + str = '' + source = REXML::Source.new(str) + doctype = REXML::DocType.new(source) + document.add(doctype) + document.write(s) + + ## Element + element = REXML::Element.new("hoge") + document.add(element) + + document.write(s) + end + + def test_write_cdata + src = "A" + doc = REXML::Document.new( src ) + out = "" + doc.write( out ) + assert_equal( src, out ) + + src = "" + doc = REXML::Document.new( src ) + out = "" + doc.write( out ) + assert_equal( src, out ) + end + + def test_namespace_attributes + source = <<-EOL + + + + EOL + d = Document.new( source ) + assert_equal( 'foo', REXML::XPath.first(d.root, "//x:b/@x:n").value ) + assert_equal( nil, REXML::XPath.first(d.root, "//x:b/@x:n", {})) + end + + def test_null_element_name + a = REXML::Document.new + assert_raise( RuntimeError ) { + a.add_element( nil ) + } + end + + def test_text_raw + # From the REXML tutorial + # (http://www.germane-software.com/software/rexml/test/data/tutorial.html) + doc = Document.new <<-EOL + + + ]> + + EOL + a = doc.root + + # This makes sure that RAW text nodes don't have their entity strings + # replaced + t = Text.new "Sean", false, nil, true + a.text = t + assert_equal( "Sean", t.to_s ) + assert_equal( "Sean", t.value ) + + # This makes sure that they do + t = Text.new "Sean", false, nil, false + a.text = t + assert_equal( "&s;", t.to_s ) + assert_equal( "Sean", t.value ) + + t = Text.new "&s;", false, nil, true + a.text = t + assert_equal( "&s;", t.to_s ) + assert_equal( "Sean", t.value ) + + t = Text.new "&s;", false, nil, true + a.text = t + assert_equal( "&s;", t.to_s ) + assert_equal( "Sean", t.value ) + + # Ticket #44 + t = REXML::Text.new( "&", false, nil, true ) + assert_equal( "&", t.to_s ) + + t = REXML::Text.new("&", false, false) + assert_equal( "&amp;", t.to_s ) + end + + def test_to_xpath + doc = REXML::Document.new( %q{ + + + }) + names = %w{ /tag1/tag2[1] /tag1/tag2[2] } + doc.root.elements.each_with_index {|el, i| + assert_equal( names[i], el.xpath ) + } + end + + def test_transitive + doc = REXML::Document.new( "") + s = "" + doc.write( s, 0, true ) + end + + # This is issue #40 + def test_replace_with + old = 'oldold' + d = REXML::Document.new(old).root + new = REXML::Text.new('new',true,nil,true) + child = d.children[2] + child.replace_with(new) + assert_equal( new, d.children[2] ) + end + + def test_repeated_writes + a = IO.read(fixture_path("iso8859-1.xml")) + f = REXML::Formatters::Pretty.new + + xmldoc = REXML::Document.new( a ) + a_andre = xmldoc.elements['//image'].attributes['caption'] + + f.write(xmldoc,b="") + + xmldoc = REXML::Document.new(b) + b_andre = xmldoc.elements['//image'].attributes['caption'] + assert_equal( a_andre, b_andre ) + + f.write(xmldoc,c="") + + xmldoc = REXML::Document.new(c) + c_andre = xmldoc.elements['//image'].attributes['caption'] + assert_equal( b_andre, c_andre ) + + o = Output.new(d="","UTF-8") + f.write(xmldoc,o) + assert_not_equal( c, d ) + end + + def test_pretty_format_long_text_finite + n = 1_000_000 + long_text = 'aaaa ' * n + xml = "#{long_text}" + formatter = REXML::Formatters::Pretty.new + document = nil + begin + document = REXML::Document.new(xml) + rescue REXML::ParseException + skip_message = "skip this test because we can't check Pretty#wrap " + + "works without # on " + + "small memory system. # " + + "will be raised on the system. See also [ruby-dev:42599]." + return skip_message + end + output = "" + formatter.write(document, output) + assert_equal("\n" + + ((" " + (" aaaa" * 15) + "\n") * (n / 15)) + + " " + ("aaaa " * (n % 15)) + "\n" + + "", + output) + end + + def test_pretty_format_deep_indent + n = 6 + elements = "" + n.times do |i| + elements << "" + elements << "element#{i} " * 5 + end + (n - 1).downto(0) do |i| + elements << "" + end + xml = "#{elements}" + document = REXML::Document.new(xml) + formatter = REXML::Formatters::Pretty.new + formatter.width = 20 + output = "" + formatter.write(document, output) + assert_equal(<<-XML.strip, output) + + + element0 + element0 + element0 + element0 + element0\s + + element1 + element1 + element1 + element1 + element1\s + + element2 + element2 + element2 + element2 + element2\s + + element3 + element3 + element3 + element3 + element3\s + + element4 + element4 + element4 + element4 + element4 + \s + + element5 element5 element5 element5 element5\s + + + + + + + + XML + end + + def test_ticket_58 + doc = REXML::Document.new + doc << REXML::XMLDecl.default + doc << REXML::Element.new("a") + + str = "" + doc.write(str) + + assert_equal("", str) + + doc = REXML::Document.new + doc << REXML::XMLDecl.new("1.0", "UTF-8") + doc << REXML::Element.new("a") + + str = "" + doc.write(str) + + assert_equal("", str) + end + + # Incomplete tags should generate an error + def test_ticket_53 + assert_raise( REXML::ParseException ) { + REXML::Document.new( "" ) + } + assert_raise( REXML::ParseException ) { + REXML::Document.new( "" ) + } + assert_raise( REXML::ParseException ) { + REXML::Document.new( "" ) + } + end + + def test_ticket_52 + source = "" + d = REXML::Document.new(source) + d.write(k="") + assert_equal( source, k ) + + source = "" + target = "\n \n" + d = REXML::Document.new(source) + REXML::Formatters::Pretty.new(4).write(d,k="") + assert_equal( target, k ) + end + + def test_ticket_76 + src = "
at&t" + assert_raise( ParseException, %Q{"#{src}" is invalid XML} ) { + REXML::Document.new(src) + } + end + + def test_ticket_21 + src = "" + assert_raise( ParseException, "invalid XML should be caught" ) { + Document.new(src) + } + begin + Document.new(src) + rescue + assert_match( /missing attribute quote/, $!.message ) + end + end + + def test_ticket_63 + File.open(fixture_path("t63-1.xml")) {|f| Document.new(f) } + end + + def test_ticket_75 + d = File.open(fixture_path("t75.xml")) {|f| REXML::Document.new(f) } + assert_equal("tree", d.root.name) + end + + def test_ticket_48_part_II + f = REXML::Formatters::Pretty.new + #- rexml sanity check (bugs in ruby 1.8.4, ruby 1.8.6) + xmldoc = Document.new("") + xmldoc << XMLDecl.new(XMLDecl::DEFAULT_VERSION, "UTF-8") + content = ['61c3a927223c3e26'].pack("H*") + content.force_encoding('UTF-8') if content.respond_to?(:force_encoding) + #- is some UTF-8 text but just to make sure my editor won't magically convert.. + xmldoc.root.add_attribute('attr', content) + f.write(xmldoc,out=[]) + + xmldoc = REXML::Document.new(out.join) + sanity1 = xmldoc.root.attributes['attr'] + f.write(xmldoc,out=[]) + + xmldoc = REXML::Document.new(out.join) + sanity2 = xmldoc.root.attributes['attr'] + f.write(xmldoc,out=[]) + + assert_equal( sanity1, sanity2 ) + end + + def test_ticket_88 + doc = REXML::Document.new("") + assert_equal("", doc.to_s) + doc = REXML::Document.new("") + assert_equal("", doc.to_s) + end + + def test_ticket_85 + xml = < + + + + +ENDXML + + yml = " + + + +" + + # The pretty printer ignores all whitespace, anyway so output1 == output2 + f = REXML::Formatters::Pretty.new( 2 ) + d = Document.new( xml, :ignore_whitespace_nodes=>:all ) + f.write( d, output1="" ) + + d = Document.new( xml ) + f.write( d, output2="" ) + + # Output directives should override whitespace directives. + assert_equal( output1, output2 ) + + # The base case. + d = Document.new(yml) + f.write( d, output3="" ) + + assert_equal( output3.strip, output2.strip ) + + d = Document.new(yml) + f.write( d, output4="" ) + + assert_equal( output3.strip, output4.strip ) + end + + def test_ticket_91 + source=" + + great + + " + expected=" + + great + + +" + d = Document.new( source ) + d.root.add_element( "bah" ) + p=REXML::Formatters::Pretty.new(2) + p.compact = true # Don't add whitespace to text nodes unless necessary + p.write(d,out="") + assert_equal( expected, out ) + end + + def test_ticket_95 + testd = REXML::Document.new "" + testd.write(out1="") + testd.elements["//c[2]"].xpath + testd.write(out2="") + assert_equal(out1,out2) + end + + def test_ticket_102 + doc = REXML::Document.new '' + assert_equal( "foo", doc.root.elements["item"].attribute("name","ns").to_s ) + assert_equal( "item", doc.root.elements["item[@name='foo']"].name ) + end + + def test_ticket_14 + # Per .2.5 Node Tests of XPath spec + assert_raise( REXML::UndefinedNamespaceException, + %Q{Should have gotten an Undefined Namespace error} ) { + Document.new("") + } + end + + # 5.7 Text Nodes + # Character data is grouped into text nodes. As much character data as + # possible is grouped into each text node: a text node never has an + # immediately following or preceding sibling that is a text node. The + # string-value of a text node is the character data. A text node always has + # at least one character of data. + def test_ticket_105 + d = Document.new("") + d.root.add_text( "a" ) + d.root.add_text( "b" ) + assert_equal( 1, d.root.children.size ) + end + + # phantom namespace same as default namespace + def test_ticket_121 + doc = REXML::Document.new( + 'text' + ) + assert_equal 'text', doc.text( "/doc/item[@name='foo']" ) + assert_equal "name='foo'", + doc.root.elements["item"].attribute("name", "ns").inspect + assert_equal "text", + doc.root.elements["item[@name='foo']"].to_s + end + + def test_ticket_135 + bean_element = REXML::Element.new("bean") + textToAdd = "(&(|(memberof=CN=somegroupabcdefgh,OU=OUsucks,DC=hookemhorns,DC=com)(mail=*someco.com))(acct=%u)(!(extraparameter:2.2.222.222222.2.2.222:=2)))" + bean_element.add_element("prop", {"key"=> "filter"}).add_text(textToAdd) + doc = REXML::Document.new + doc.add_element(bean_element) + + REXML::Formatters::Pretty.new(3).write( doc, out = "" ) + + assert_equal "\n \n (&#38;(|(memberof=CN=somegroupabcdefgh,OU=OUsucks,DC=hookemhorns,DC=com)(mail=*someco.com))(acct=%u)(!(extraparameter:2.2.222.222222.2.2.222:=2)))\n \n", out + end + + def test_ticket_138 + doc = REXML::Document.new( + '' + ) + expected = { + "inkscape" => attribute("xmlns:inkscape", + "http://www.inkscape.org/namespaces/inkscape"), + "version" => { + "inkscape" => attribute("inkscape:version", "0.44"), + "" => attribute("version", "1.0"), + }, + } + assert_equal(expected, doc.root.attributes) + assert_equal(expected, REXML::Document.new(doc.root.to_s).root.attributes) + end + + def test_empty_doc + assert(REXML::Document.new('').children.empty?) + end + + private + def attribute(name, value) + REXML::Attribute.new(name, value) + end + end +end diff --git a/jni/ruby/test/rexml/test_doctype.rb b/jni/ruby/test/rexml/test_doctype.rb new file mode 100644 index 0000000..0b3ea11 --- /dev/null +++ b/jni/ruby/test/rexml/test_doctype.rb @@ -0,0 +1,106 @@ +require 'test/unit' +require 'rexml/document' + +module REXMLTests + class TestDocTypeAccessor < Test::Unit::TestCase + + def setup + @sysid = "urn:x-test:sysid1" + @notid1 = "urn:x-test:notation1" + @notid2 = "urn:x-test:notation2" + document_string1 = <<-"XMLEND" + + + ]> + + XMLEND + @doctype1 = REXML::Document.new(document_string1).doctype + + @pubid = "TEST_ID" + document_string2 = <<-"XMLEND" + + + XMLEND + @doctype2 = REXML::Document.new(document_string2).doctype + + document_string3 = <<-"XMLEND" + + + XMLEND + @doctype3 = REXML::Document.new(document_string3).doctype + + end + + def test_public + assert_equal(nil, @doctype1.public) + assert_equal(@pubid, @doctype2.public) + assert_equal(@pubid, @doctype3.public) + end + + def test_system + assert_equal(@sysid, @doctype1.system) + assert_equal(nil, @doctype2.system) + assert_equal(@sysid, @doctype3.system) + end + + def test_notation + assert_equal(@notid1, @doctype1.notation("n1").system) + assert_equal(@notid2, @doctype1.notation("n2").system) + end + + def test_notations + notations = @doctype1.notations + assert_equal(2, notations.length) + assert_equal(@notid1, find_notation(notations, "n1").system) + assert_equal(@notid2, find_notation(notations, "n2").system) + end + + def find_notation(notations, name) + notations.find { |notation| + name == notation.name + } + end + + end + + class TestNotationDeclPublic < Test::Unit::TestCase + def setup + @name = "vrml" + @id = "VRML 1.0" + @uri = "http://www.web3d.org/" + end + + def test_to_s + assert_equal("", + decl(@id, nil).to_s) + end + + def test_to_s_with_uri + assert_equal("", + decl(@id, @uri).to_s) + end + + private + def decl(id, uri) + REXML::NotationDecl.new(@name, "PUBLIC", id, uri) + end + end + + class TestNotationDeclSystem < Test::Unit::TestCase + def setup + @name = "gif" + @id = "gif viewer" + end + + def test_to_s + assert_equal("", + decl(@id).to_s) + end + + private + def decl(id) + REXML::NotationDecl.new(@name, "SYSTEM", id, nil) + end + end +end diff --git a/jni/ruby/test/rexml/test_document.rb b/jni/ruby/test/rexml/test_document.rb new file mode 100644 index 0000000..46cd6f7 --- /dev/null +++ b/jni/ruby/test/rexml/test_document.rb @@ -0,0 +1,415 @@ +# -*- coding: utf-8 -*- + +require "rexml/document" +require "test/unit" + +module REXMLTests + class TestDocument < Test::Unit::TestCase + def test_version_attributes_to_s + doc = REXML::Document.new(<<-eoxml) + + + + eoxml + + string = doc.to_s + assert_match('xmlns:sodipodi', string) + assert_match('xmlns:inkscape', string) + assert_match('sodipodi:version', string) + assert_match('inkscape:version', string) + end + + def test_new + doc = REXML::Document.new(< +Hello world! +EOF + assert_equal("Hello world!", doc.root.children.first.value) + end + + class EntityExpansionLimitTest < Test::Unit::TestCase + def setup + @default_entity_expansion_limit = REXML::Security.entity_expansion_limit + end + + def teardown + REXML::Security.entity_expansion_limit = @default_entity_expansion_limit + end + + class GeneralEntityTest < self + def test_have_value + xml = < + + + + + + + +]> + +&a; + +EOF + + doc = REXML::Document.new(xml) + assert_raise(RuntimeError) do + doc.root.children.first.value + end + REXML::Security.entity_expansion_limit = 100 + assert_equal(100, REXML::Security.entity_expansion_limit) + doc = REXML::Document.new(xml) + assert_raise(RuntimeError) do + doc.root.children.first.value + end + assert_equal(101, doc.entity_expansion_count) + end + + def test_empty_value + xml = < + + + + + + + +]> + +&a; + +EOF + + doc = REXML::Document.new(xml) + assert_raise(RuntimeError) do + doc.root.children.first.value + end + REXML::Security.entity_expansion_limit = 100 + assert_equal(100, REXML::Security.entity_expansion_limit) + doc = REXML::Document.new(xml) + assert_raise(RuntimeError) do + doc.root.children.first.value + end + assert_equal(101, doc.entity_expansion_count) + end + + def test_with_default_entity + xml = < + + +]> + +&a; +&a2; +< + +EOF + + REXML::Security.entity_expansion_limit = 4 + doc = REXML::Document.new(xml) + assert_equal("\na\na a\n<\n", doc.root.children.first.value) + REXML::Security.entity_expansion_limit = 3 + doc = REXML::Document.new(xml) + assert_raise(RuntimeError) do + doc.root.children.first.value + end + end + end + + class ParameterEntityTest < self + def test_have_value + xml = < + + + + + + + +]> + +EOF + + assert_raise(REXML::ParseException) do + REXML::Document.new(xml) + end + REXML::Security.entity_expansion_limit = 100 + assert_equal(100, REXML::Security.entity_expansion_limit) + assert_raise(REXML::ParseException) do + REXML::Document.new(xml) + end + end + + def test_empty_value + xml = < + + + + + + + +]> + +EOF + + assert_raise(REXML::ParseException) do + REXML::Document.new(xml) + end + REXML::Security.entity_expansion_limit = 100 + assert_equal(100, REXML::Security.entity_expansion_limit) + assert_raise(REXML::ParseException) do + REXML::Document.new(xml) + end + end + end + end + + def test_tag_in_cdata_with_not_ascii_only_but_ascii8bit_encoding_source + tag = "..." + message = "<筝鐚" # Hello world! in Japanese + xml = < + +EOX + xml.force_encoding(Encoding::ASCII_8BIT) + doc = REXML::Document.new(xml) + assert_equal("#{tag}#{message}", doc.root.children.first.value) + end + + def test_xml_declaration_standalone + bug2539 = '[ruby-core:27345]' + doc = REXML::Document.new('') + assert_equal('no', doc.stand_alone?, bug2539) + doc = REXML::Document.new('') + assert_equal('no', doc.stand_alone?, bug2539) + doc = REXML::Document.new('') + assert_equal('no', doc.stand_alone?, bug2539) + end + + class WriteTest < Test::Unit::TestCase + def setup + @document = REXML::Document.new(<<-EOX) + +Hello world! +EOX + end + + class ArgumentsTest < self + def test_output + output = "" + @document.write(output) + assert_equal(<<-EOX, output) + +Hello world! +EOX + end + + def test_indent + output = "" + indent = 2 + @document.write(output, indent) + assert_equal(<<-EOX.chomp, output) + + + Hello world! + +EOX + end + + def test_transitive + output = "" + indent = 2 + transitive = true + @document.write(output, indent, transitive) + assert_equal(<<-EOX, output) + +Hello world! +EOX + end + + def test_ie_hack + output = "" + indent = -1 + transitive = false + ie_hack = true + document = REXML::Document.new("") + document.write(output, indent, transitive, ie_hack) + assert_equal("", output) + end + + def test_encoding + output = "" + indent = -1 + transitive = false + ie_hack = false + encoding = "Windows-31J" + + @document.xml_decl.encoding = "Shift_JIS" + japanese_text = "<" + @document.root.text = japanese_text + @document.write(output, indent, transitive, ie_hack, encoding) + assert_equal(<<-EOX.encode(encoding), output) + +#{japanese_text} +EOX + end + end + + class OptionsTest < self + def test_output + output = "" + @document.write(:output => output) + assert_equal(<<-EOX, output) + +Hello world! +EOX + end + + def test_indent + output = "" + @document.write(:output => output, :indent => 2) + assert_equal(<<-EOX.chomp, output) + + + Hello world! + +EOX + end + + def test_transitive + output = "" + @document.write(:output => output, :indent => 2, :transitive => true) + assert_equal(<<-EOX, output) + +Hello world! +EOX + end + + def test_ie_hack + output = "" + document = REXML::Document.new("") + document.write(:output => output, :ie_hack => true) + assert_equal("", output) + end + + def test_encoding + output = "" + encoding = "Windows-31J" + @document.xml_decl.encoding = "Shift_JIS" + japanese_text = "<" + @document.root.text = japanese_text + @document.write(:output => output, :encoding => encoding) + assert_equal(<<-EOX.encode(encoding), output) + +#{japanese_text} +EOX + end + end + end + + class BomTest < Test::Unit::TestCase + class HaveEncodingTest < self + def test_utf_8 + xml = <<-EOX.force_encoding("ASCII-8BIT") + +Hello world! +EOX + bom = "\ufeff".force_encoding("ASCII-8BIT") + document = REXML::Document.new(bom + xml) + assert_equal("UTF-8", document.encoding) + end + + def test_utf_16le + xml = <<-EOX.encode("UTF-16LE").force_encoding("ASCII-8BIT") + +Hello world! +EOX + bom = "\ufeff".encode("UTF-16LE").force_encoding("ASCII-8BIT") + document = REXML::Document.new(bom + xml) + assert_equal("UTF-16", document.encoding) + end + + def test_utf_16be + xml = <<-EOX.encode("UTF-16BE").force_encoding("ASCII-8BIT") + +Hello world! +EOX + bom = "\ufeff".encode("UTF-16BE").force_encoding("ASCII-8BIT") + document = REXML::Document.new(bom + xml) + assert_equal("UTF-16", document.encoding) + end + end + + class NoEncodingTest < self + def test_utf_8 + xml = <<-EOX.force_encoding("ASCII-8BIT") + +Hello world! +EOX + bom = "\ufeff".force_encoding("ASCII-8BIT") + document = REXML::Document.new(bom + xml) + assert_equal("UTF-8", document.encoding) + end + + def test_utf_16le + xml = <<-EOX.encode("UTF-16LE").force_encoding("ASCII-8BIT") + +Hello world! +EOX + bom = "\ufeff".encode("UTF-16LE").force_encoding("ASCII-8BIT") + document = REXML::Document.new(bom + xml) + assert_equal("UTF-16", document.encoding) + end + + def test_utf_16be + xml = <<-EOX.encode("UTF-16BE").force_encoding("ASCII-8BIT") + +Hello world! +EOX + bom = "\ufeff".encode("UTF-16BE").force_encoding("ASCII-8BIT") + document = REXML::Document.new(bom + xml) + assert_equal("UTF-16", document.encoding) + end + end + + class WriteTest < self + def test_utf_16 + xml = <<-EOX.encode("UTF-16LE").force_encoding("ASCII-8BIT") + +Hello world! +EOX + bom = "\ufeff".encode("UTF-16LE").force_encoding("ASCII-8BIT") + document = REXML::Document.new(bom + xml) + + actual_xml = "" + document.write(actual_xml) + expected_xml = <<-EOX.encode("UTF-16BE") +\ufeff +Hello world! +EOX + assert_equal(expected_xml, actual_xml) + end + end + end + end +end diff --git a/jni/ruby/test/rexml/test_elements.rb b/jni/ruby/test/rexml/test_elements.rb new file mode 100644 index 0000000..f253a75 --- /dev/null +++ b/jni/ruby/test/rexml/test_elements.rb @@ -0,0 +1,118 @@ +require 'test/unit/testcase' +require 'rexml/document' + +module REXMLTests + class ElementsTester < Test::Unit::TestCase + include REXML + def test_accessor + doc = Document.new '' + assert_equal 'b', doc.root.elements[1].name + assert_equal '1', doc.root.elements['c'].attributes['id'] + assert_equal '2', doc.root.elements[2,'c'].attributes['id'] + end + + def test_indexing + doc = Document.new '' + doc.root.elements[10] = Element.new('b') + assert_equal 'b', doc.root.elements[1].name + doc.root.elements[1] = Element.new('c') + assert_equal 'c', doc.root.elements[1].name + doc.root.elements['c'] = Element.new('d') + assert_equal 'd', doc.root.elements[1].name + end + + def test_delete + doc = Document.new '' + block = proc { |str| + out = '' + doc.write out + assert_equal str, out + } + b = doc.root.elements[1] + doc.root.elements.delete b + block.call( "" ) + doc.elements.delete("a/c[@id='1']") + block.call( '' ) + doc.root.elements.delete 1 + block.call( '' ) + end + + def test_delete_all + doc = Document.new '' + deleted = doc.elements.delete_all 'a/c' + assert_equal 4, deleted.size + end + + def test_ticket_36 + doc = Document.new( "" ) + + deleted = doc.root.elements.delete_all( "xi:c" ) + assert_equal( 1, deleted.size ) + + doc = Document.new( "" ) + deleted = doc.root.elements.delete_all( "//xi:c" ) + assert_equal( 2, deleted.size ) + end + + def test_add + a = Element.new 'a' + a.elements.add Element.new('b') + assert_equal 'b', a.elements[1].name + a.elements.add 'c' + assert_equal 'c', a.elements[2].name + end + + def test_size + doc = Document.new 'seanelliottrussell' + assert_equal 6, doc.root.size + assert_equal 3, doc.root.elements.size + end + + def test_each + doc = Document.new 'sean' + count = 0 + block = proc {|e| count += 1} + doc.root.elements.each(&block) + assert_equal 6, count + count = 0 + doc.root.elements.each('b', &block) + assert_equal 2, count + count = 0 + doc.root.elements.each('child::node()', &block) + assert_equal 6, count + count = 0 + XPath.each(doc.root, 'child::node()', &block) + assert_equal 7, count + end + + def test_each_with_frozen_condition + doc = Document.new('') + names = [] + doc.root.elements.each('book'.freeze) do |element| + names << element.attributes["name"] + end + assert_equal(["Ruby", "XML"], names) + end + + def test_to_a + doc = Document.new 'seanelliott' + assert_equal 2, doc.root.elements.to_a.size + assert_equal 2, doc.root.elements.to_a("child::node()").size + assert_equal 4, XPath.match(doc.root, "child::node()").size + end + + def test_collect + doc = Document.new( "" ) + r = doc.elements.collect( "/a/b" ) { |e| e.attributes["id"].to_i } + assert_equal( [1,2], r ) + end + + def test_inject + doc = Document.new( "" ) + r = doc.elements.inject( "/a/b", 3 ) { |s, e| + s + e.attributes["id"].to_i + } + assert_equal 6, r + end + end +end diff --git a/jni/ruby/test/rexml/test_encoding.rb b/jni/ruby/test/rexml/test_encoding.rb new file mode 100644 index 0000000..058fb97 --- /dev/null +++ b/jni/ruby/test/rexml/test_encoding.rb @@ -0,0 +1,107 @@ +# coding: binary + +require_relative "rexml_test_utils" + +require 'rexml/source' +require 'rexml/document' + +module REXMLTests + class EncodingTester < Test::Unit::TestCase + include REXMLTestUtils + include REXML + + def setup + @encoded_root = "\346" + @encoded = ""+ + @encoded_root + @not_encoded = "" + end + + # Given an encoded document, try to write out to that encoding + def test_encoded_in_encoded_out + doc = Document.new( @encoded ) + doc.write( out="" ) + out.force_encoding(::Encoding::ASCII_8BIT) + assert_equal( @encoded, out ) + end + + # Given an encoded document, try to change the encoding and write it out + def test_encoded_in_change_out + doc = Document.new( @encoded ) + doc.xml_decl.encoding = "UTF-8" + assert_equal("UTF-8", doc.encoding) + REXML::Formatters::Default.new.write( doc.root, out="" ) + out.force_encoding(::Encoding::ASCII_8BIT) + assert_equal( @not_encoded, out ) + char = XPath.first( doc, "/a/b/text()" ).to_s + char.force_encoding(::Encoding::ASCII_8BIT) + assert_equal( "", char ) + end + + # * Given an encoded document, try to write it to a different encoding + def test_encoded_in_different_out + doc = Document.new( @encoded ) + REXML::Formatters::Default.new.write( doc.root, Output.new( out="", "UTF-8" ) ) + out.force_encoding(::Encoding::ASCII_8BIT) + assert_equal( @not_encoded, out ) + end + + # * Given a non-encoded document, change the encoding + def test_in_change_out + doc = Document.new( @not_encoded ) + doc.xml_decl.encoding = "ISO-8859-3" + assert_equal("ISO-8859-3", doc.encoding) + doc.write( out="" ) + out.force_encoding(::Encoding::ASCII_8BIT) + assert_equal( @encoded, out ) + end + + # * Given a non-encoded document, write to a different encoding + def test_in_different_out + doc = Document.new( @not_encoded ) + doc.write( Output.new( out="", "ISO-8859-3" ) ) + out.force_encoding(::Encoding::ASCII_8BIT) + assert_equal( "#{@encoded_root}", out ) + end + + # * Given an encoded document, accessing text and attribute nodes + # should provide UTF-8 text. + def test_in_different_access + doc = Document.new <<-EOL + + \xFF + EOL + expect = "\303\277" + expect.force_encoding(::Encoding::UTF_8) + assert_equal( expect, doc.elements['a'].attributes['a'] ) + assert_equal( expect, doc.elements['a'].text ) + end + + + def test_ticket_89 + doc = Document.new <<-EOL + + + EOL + + REXML::Document.new doc + end + + def test_parse_utf16 + utf16 = File.open(fixture_path("utf16.xml")) do |f| + REXML::Document.new(f) + end + assert_equal("UTF-16", utf16.encoding) + assert( utf16[0].kind_of?(REXML::XMLDecl)) + end + + def test_parse_utf16_with_utf8_default_internal + EnvUtil.with_default_internal("UTF-8") do + utf16 = File.open(fixture_path("utf16.xml")) do |f| + REXML::Document.new(f) + end + assert_equal("UTF-16", utf16.encoding) + end + end + end +end diff --git a/jni/ruby/test/rexml/test_entity.rb b/jni/ruby/test/rexml/test_entity.rb new file mode 100644 index 0000000..7d16dc8 --- /dev/null +++ b/jni/ruby/test/rexml/test_entity.rb @@ -0,0 +1,205 @@ +require "test/unit/testcase" + +require 'rexml/document' +require 'rexml/entity' +require 'rexml/source' + +module REXMLTests + class EntityTester < Test::Unit::TestCase + def test_parse_general_decl + simple = "" + simple =~ /#{REXML::Entity::GEDECL}/ + assert $& + assert_equal simple, $& + + REXML::Entity::ENTITYDECL =~ simple + assert REXML::Entity::matches?(simple) + match = REXML::Entity::ENTITYDECL.match(simple) + assert_equal 'foo', match[1] + assert_equal "'bar'", match[2] + + simple = '' + assert REXML::Entity::matches?(simple) + match = REXML::Entity::ENTITYDECL.match(simple) + assert_equal 'Pub-Status', match[1] + assert_equal '"This is a pre-release of the specification."', match[2] + + txt = '"This is a + pre-release of specification."' + simple = "" + assert REXML::Entity::matches?(simple) + match = REXML::Entity::ENTITYDECL.match(simple) + assert_equal 'Pub-Status', match[1] + assert_equal txt, match[2] + end + + def test_parse_external_decl + zero = '' + one = '' + two = '' + three = '' + assert REXML::Entity::matches?(zero) + assert REXML::Entity::matches?(one) + assert REXML::Entity::matches?(two) + assert REXML::Entity::matches?(three) + end + + def test_parse_entity + one = %q{} + two = %q{} + assert REXML::Entity::matches?(one) + assert REXML::Entity::matches?(two) + end + + def test_constructor + one = [ %q{}, + %q{}, + %q{}, + '', + '', + '' ] + source = %q{ + + + + + + ]>} + + d = REXML::Document.new( source ) + dt = d.doctype + c = 0 + dt.each do |child| + if child.kind_of? REXML::Entity + str = one[c].tr("\r\n\t", ' ').squeeze(" ") + assert_equal str, child.to_s + c+=1 + end + end + end + + def test_replace_entities + source = "\n]>&foo;" + doc = REXML::Document.new(source) + assert_equal 'bar', doc.root.text + out = '' + doc.write out + assert_equal source, out + end + + def test_entity_string_limit + template = ' ]> $' + len = 5120 # 5k per entity + template.sub!(/\^/, "B" * len) + + # 10k is OK + entities = '&a;' * 2 # 5k entity * 2 = 10k + xmldoc = REXML::Document.new(template.sub(/\$/, entities)) + assert_equal(len * 2, xmldoc.root.text.bytesize) + + # above 10k explodes + entities = '&a;' * 3 # 5k entity * 2 = 15k + xmldoc = REXML::Document.new(template.sub(/\$/, entities)) + assert_raises(RuntimeError) do + xmldoc.root.text + end + end + + def test_entity_string_limit_for_parameter_entity + template = ' ]>' + len = 5120 # 5k per entity + template.sub!(/\^/, "B" * len) + + # 10k is OK + entities = '%a;' * 2 # 5k entity * 2 = 10k + REXML::Document.new(template.sub(/\$/, entities)) + + # above 10k explodes + entities = '%a;' * 3 # 5k entity * 2 = 15k + assert_raises(REXML::ParseException) do + REXML::Document.new(template.sub(/\$/, entities)) + end + end + + def test_raw + source = ' +]>replace &ent;' + doc = REXML::Document.new( source, {:raw=>:all}) + assert_equal('replace &ent;', doc.root.get_text.to_s) + assert_equal(source, doc.to_s) + end + + def test_lazy_evaluation + source = ' +]>replace &ent;' + doc = REXML::Document.new( source ) + assert_equal(source, doc.to_s) + assert_equal("replace replace", doc.root.text) + assert_equal(source, doc.to_s) + end + + # Contributed (not only test, but bug fix!!) by Kouhei Sutou + def test_entity_replacement + source = %q{ + ]> + &WhatHeSaid;} + + d = REXML::Document.new( source ) + dt = d.doctype + assert_equal( '"Yes"', dt.entities[ "YN" ].value ) + assert_equal( 'He said "Yes"', dt.entities[ "WhatHeSaid" ].value ) + assert_equal( 'He said "Yes"', d.elements[1].text ) + end + + # More unit tests from Kouhei. I looove users who give me unit tests. + def test_entity_insertions + assert_equal("&", REXML::Text.new("&", false, nil, true).to_s) + #assert_equal("&", REXML::Text.new("&", false, false).to_s) + end + + def test_single_pass_unnormalization # ticket 123 + assert_equal '&&', REXML::Text::unnormalize('&amp;&') + end + + def test_entity_filter + document = REXML::Document.new(<<-XML) + + +]> + +XML + respect_whitespace = false + parent = document.root + raw = false + entity_filter = ["copy"] + assert_equal("(c) &release-year;", + REXML::Text.new("(c) 2013", + respect_whitespace, + parent, + raw, + entity_filter).to_s) + end + end +end diff --git a/jni/ruby/test/rexml/test_functions.rb b/jni/ruby/test/rexml/test_functions.rb new file mode 100644 index 0000000..bf501ff --- /dev/null +++ b/jni/ruby/test/rexml/test_functions.rb @@ -0,0 +1,224 @@ +require "test/unit/testcase" + +require "rexml/document" + +module REXMLTests + class FunctionsTester < Test::Unit::TestCase + include REXML + def test_functions + # trivial text() test + # confuse-a-function + source = "more dumb text" + doc = Document.new source + res = "" + XPath::each(doc.root, "text()") {|val| res << val.to_s} + assert_equal "more text", res + + res = XPath::first(doc.root, "b[last()]") + assert_equal '3', res.attributes['id'] + res = XPath::first(doc.root, "b[position()=2]") + assert_equal '2', res.attributes['id'] + res = XPath::first(doc.root, "*[name()='c']") + assert_equal "c", res.name + end + + # Contributed by Mike Stok + def test_starts_with + source = <<-EOF + + a@b.c + http://www.foo.com + + EOF + doc = Document.new source + mailtos = doc.elements.to_a("//a[starts-with(@href, 'mailto:')]") + assert_equal 1, mailtos.size + assert_equal "mailto:a@b.c", mailtos[0].attributes['href'] + + ailtos = doc.elements.to_a("//a[starts-with(@href, 'ailto:')]") + assert_equal 0, ailtos.size + end + + def test_string_length + doc = Document.new <<-EOF + + + + + + + + + EOF + assert doc, "create doc" + + set = doc.elements.to_a("//*[string-length(name()) = 3]") + assert_equal 2, set.size, "nodes with names length = 3" + + set = doc.elements.to_a("//*[string-length(name()) < 3]") + assert_equal 2, set.size, "nodes with names length < 3" + + set = doc.elements.to_a("//*[string-length(name()) > 3]") + assert_equal 3, set.size, "nodes with names length > 3" + end + + # Test provided by Mike Stok + def test_contains + source = <<-EOF + + a@b.c + http://www.foo.com + + EOF + doc = Document.new source + + [['o', 2], ['foo', 1], ['bar', 0]].each { |test| + search, expected = test + set = doc.elements.to_a("//a[contains(@href, '#{search}')]") + assert_equal expected, set.size + } + end + + # Mike Stok and Sean Russell + def test_substring + # examples from http://www.w3.org/TR/xpath#function-substring + doc = Document.new('') + + #puts XPath.first(d, 'node()[0 + 1]') + #d = Document.new("") + #puts XPath.first(d, 'a[0 mod 0]') + [ [1.5, 2.6, '234'], + [0, 3, '12'], + [0, '0 div 0', ''], + [1, '0 div 0', ''], + ['-42', '1 div 0', '12345'], + ['-1 div 0', '1 div 0', ''] + ].each { |start, length, expected| + set = doc.elements.to_a("//test[substring(@string, #{start}, #{length}) = '#{expected}']") + assert_equal 1, set.size, "#{start}, #{length}, '#{expected}'" + } + end + + def test_substring_angrez + testString = REXML::Functions::substring_after("helloworld","hello") + assert_equal( 'world', testString ) + end + + def test_translate + source = <<-EOF + + + + + + + + EOF + + doc = Document.new(source) + + [ ['bar', 'abc', 'ABC', 'w3c one'], + ['--aaa--','abc-','ABC', 'w3c two'], + ['lead', 'dear language', 'doll groover', 'alchemy'], + ['A Space Odissei', 'i', 'y', 'vbxml one'], + ['abcdefg', 'aceg', 'ACE', 'vbxml two'], + ].each { |arg1, arg2, arg3, name| + translate = "translate('#{arg1}', '#{arg2}', '#{arg3}')" + set = doc.elements.to_a("//case[@result = #{translate}]") + assert_equal 1, set.size, translate + assert_equal name, set[0].attributes['name'] + } + end + + def test_name + d = REXML::Document.new("") + assert_equal 1, d.root.elements.to_a('*[name() = "b"]').size + assert_equal 1, d.elements.to_a('//*[name() = "x:b"]').size + end + + def test_local_name + d = REXML::Document.new("") + assert_equal 2, d.root.elements.to_a('*[local_name() = "b"]').size + assert_equal 2, d.elements.to_a('//*[local_name() = "b"]').size + end + + def test_substring2 + doc = Document.new('') + assert_equal(1,doc.elements.to_a("//test[substring(@string,2)='2345']").size) + end + + # Submitted by Kouhei + def test_floor_ceiling_round + source = "" + doc = REXML::Document.new(source) + + id_1 = doc.elements["/a/b[@id='1']"] + id_2 = doc.elements["/a/b[@id='2']"] + id_3 = doc.elements["/a/b[@id='3']"] + + good = { + "floor" => [[], [id_1], [id_2], [id_3]], + "ceiling" => [[id_1], [id_2], [id_3], []], + "round" => [[id_1], [id_2], [id_3], []] + } + good.each do |key, value| + (0..3).each do |i| + xpath = "//b[number(@id) = #{key}(#{i+0.5})]" + assert_equal(value[i], REXML::XPath.match(doc, xpath)) + end + end + + good["round"] = [[], [id_1], [id_2], [id_3]] + good.each do |key, value| + (0..3).each do |i| + xpath = "//b[number(@id) = #{key}(#{i+0.4})]" + assert_equal(value[i], REXML::XPath.match(doc, xpath)) + end + end + end + + # Submitted by Kou + def test_lang + d = Document.new(<<-XML) + + + + + + + + + XML + + assert_equal(1, d.elements.to_a("//*[lang('fr')]").size) + assert_equal(3, d.elements.to_a("//*[lang('ja')]").size) + assert_equal(2, d.elements.to_a("//*[lang('en')]").size) + assert_equal(1, d.elements.to_a("//*[lang('en-us')]").size) + + d = Document.new(<<-XML) + + +
+ + +
+ XML + + assert_equal(5, d.elements.to_a("//*[lang('en')]").size) + end + + def test_ticket_60 + document = REXML::Document.new("A1") + assert_equal( "A", REXML::XPath.first(document, '//b[.="A"]').text ) + assert_equal( "1", REXML::XPath.first(document, '//b[.="1"]').text ) + end + + def test_normalize_space + source = "" + doc = REXML::Document.new(source) + predicate = "string(.)=normalize_space('\nCOMMENT \n A \n\n ')" + m = REXML::XPath.match(doc, "//comment()[#{predicate}]") + assert_equal( [REXML::Comment.new("COMMENT A")], m ) + end + end +end diff --git a/jni/ruby/test/rexml/test_functions_number.rb b/jni/ruby/test/rexml/test_functions_number.rb new file mode 100644 index 0000000..0b5ec92 --- /dev/null +++ b/jni/ruby/test/rexml/test_functions_number.rb @@ -0,0 +1,34 @@ +require 'rexml/document' +require 'test/unit' +require 'rexml/functions' + +module REXMLTests + class TC_Rexml_Functions_Number < Test::Unit::TestCase + + def test_functions_number_int + telem = REXML::Element.new("elem") + telem.text="9" + assert_equal(9, REXML::Functions::number(telem)) + end + def test_functions_number_float + telem = REXML::Element.new("elem") + telem.text="10.4" + assert_equal(10.4, REXML::Functions::number(telem)) + end + def test_functions_number_negative_int + telem = REXML::Element.new("elem") + telem.text="-9" + assert_equal(-9, REXML::Functions::number(telem)) + end + def test_functions_number_negative_float + telem = REXML::Element.new("elem") + telem.text="-9.13" + assert_equal(-9.13, REXML::Functions::number(telem)) + end + #def test_functions_number_scientific_notation + # telem = REXML::Element.new("elem") + # telem.text="9.13E12" + # assert_equal(9.13E12, REXML::Functions::number(telem)) + #end + end +end diff --git a/jni/ruby/test/rexml/test_jaxen.rb b/jni/ruby/test/rexml/test_jaxen.rb new file mode 100644 index 0000000..1eec73f --- /dev/null +++ b/jni/ruby/test/rexml/test_jaxen.rb @@ -0,0 +1,129 @@ +require_relative 'rexml_test_utils' + +require "rexml/document" +require "rexml/xpath" + +# Harness to test REXML's capabilities against the test suite from Jaxen +# ryan.a.cox@gmail.com + +module REXMLTests + class JaxenTester < Test::Unit::TestCase + include REXMLTestUtils + include REXML + + def test_axis ; test("axis") ; end + def test_basic ; test("basic") ; end + def test_basicupdate ; test("basicupdate") ; end + def test_contents ; test("contents") ; end + def test_defaultNamespace ; test("defaultNamespace") ; end + def test_fibo ; test("fibo") ; end + def test_id ; test("id") ; end + def test_jaxen24 ; test("jaxen24") ; end + def test_lang ; test("lang") ; end + def test_message ; test("message") ; end + def test_moreover ; test("moreover") ; end + def test_much_ado ; test("much_ado") ; end + def test_namespaces ; test("namespaces") ; end + def test_nitf ; test("nitf") ; end + def test_numbers ; test("numbers") ; end + def test_pi ; test("pi") ; end + def test_pi2 ; test("pi2") ; end + def test_simple ; test("simple") ; end + def test_testNamespaces ; test("testNamespaces") ; end + def test_text ; test("text") ; end + def test_underscore ; test("underscore") ; end + def test_web ; test("web") ; end + def test_web2 ; test("web2") ; end + + private + def test( fname ) +# Dir.entries( xml_dir ).each { |fname| +# if fname =~ /\.xml$/ + doc = File.open(fixture_path(fname+".xml")) do |file| + Document.new(file) + end + XPath.each( doc, "/tests/document" ) {|e| handleDocument(e)} +# end +# } + end + + # processes a tests/document/context node + def handleContext( testDoc, ctxElement) + testCtx = XPath.match( testDoc, ctxElement.attributes["select"] )[0] + namespaces = {} + if testCtx.class == Element + testCtx.prefixes.each { |pre| handleNamespace( testCtx, pre, namespaces ) } + end + variables = {} + XPath.each( ctxElement, "@*[namespace-uri() = 'http://jaxen.org/test-harness/var']") { |attrib| handleVariable(testCtx, variables, attrib) } + XPath.each( ctxElement, "valueOf") { |e| handleValueOf(testCtx, variables, namespaces, e) } + XPath.each( ctxElement, "test[not(@exception) or (@exception != 'true') ]") { |e| handleNominalTest(testCtx,variables, namespaces, e) } + XPath.each( ctxElement, "test[@exception = 'true']") { |e| handleExceptionalTest(testCtx,variables, namespaces, e) } + end + + # processes a tests/document/context/valueOf or tests/document/context/test/valueOf node + def handleValueOf(ctx,variables, namespaces, valueOfElement) + expected = valueOfElement.text + got = XPath.match( ctx, valueOfElement.attributes["select"], namespaces, variables )[0] + assert_true( (got.nil? && expected.nil?) || !got.nil? ) + case got.class + when Element + assert_equal( got.class, Element ) + when Attribute, Text, Comment, TrueClass, FalseClass + assert_equal( expected, got.to_s ) + when Instruction + assert_equal( expected, got.content ) + when Fixnum + assert_equal( exected.to_f, got ) + when String + # normalize values for comparison + got = "" if got == nil or got == "" + expected = "" if expected == nil or expected == "" + assert_equal( expected, got ) + else + assert_fail( "Wassup?" ) + end + end + + + # processes a tests/document/context/test node ( where @exception is false or doesn't exist ) + def handleNominalTest(ctx, variables, namespaces, testElement) + expected = testElement.attributes["count"] + got = XPath.match( ctx, testElement.attributes["select"], namespaces, variables ) + # might be a test with no count attribute, but nested valueOf elements + assert( expected == got.size.to_s ) if !expected.nil? + + XPath.each( testElement, "valueOf") { |e| + handleValueOf(got, variables, namespaces, e) + } + end + + # processes a tests/document/context/test node ( where @exception is true ) + def handleExceptionalTest(ctx, variables, namespaces, testElement) + assert_raise( Exception ) { + XPath.match( ctx, testElement.attributes["select"], namespaces, variables ) + } + end + + # processes a tests/document node + def handleDocument(docElement) + puts "- Processing document: #{docElement.attributes['url']}" + testFile = File.new( docElement.attributes["url"] ) + testDoc = Document.new testFile + XPath.each( docElement, "context") { |e| handleContext(testDoc, e) } + end + + # processes a variable definition in a namespace like + def handleVariable( ctx, variables, attrib ) + puts "--- Found attribute: #{attrib.name}" + variables[attrib.name] = attrib.value + end + + # processes a namespace definition like + def handleNamespace( ctx, prefix, namespaces ) + puts "--- Found namespace: #{prefix}" + namespaces[prefix] = ctx.namespaces[prefix] + end + + end +end diff --git a/jni/ruby/test/rexml/test_light.rb b/jni/ruby/test/rexml/test_light.rb new file mode 100644 index 0000000..b775eb7 --- /dev/null +++ b/jni/ruby/test/rexml/test_light.rb @@ -0,0 +1,106 @@ +require_relative "rexml_test_utils" +require "rexml/light/node" +require "rexml/parsers/lightparser" + +module REXMLTests + class LightTester < Test::Unit::TestCase + include REXMLTestUtils + include REXML::Light + + def test_parse_large + xml_string = fixture_path("documentation.xml") + parser = REXML::Parsers::LightParser.new(xml_string) + tag, content = parser.parse + assert_equal([:document, :text], [tag, content.first]) + end + + # FIXME INCOMPLETE + # This is because the light API is not yet ready to be used to produce + # trees. +=begin + def test_add_element + doc = Node.new + foo = doc.add_element( 'foo' ) + assert_equal( "foo", foo.name ) + end + + def test_add_attribute + foo = Node.new( "a" ) + foo["attr"] = "bar" + assert_equal( "bar", foo["attr"] ) + end + + def test_write_document + r = make_small_document + assert_equal( "", r.to_s ) + end + + def test_add_attribute_under_namespace + foo = Node.new("a") + foo["attr", "a"] = "1" + foo["attr", "b"] = "2" + foo["attr"] = "3" + assert_equal( '1', foo['attr', 'a'] ) + assert_equal( '2', foo['attr', 'b'] ) + assert_equal( '3', foo['attr'] ) + end + + def test_change_namespace_of_element + foo = Node.new + assert_equal( '', foo.namespace ) + foo.namespace = 'a' + assert_equal( 'a', foo.namespace ) + end + + def test_access_child_elements + foo = make_small_document + assert_equal( 1, foo.size ) + a = foo[0] + assert_equal( 2, a.size ) + assert_equal( 'b', a[0].name ) + assert_equal( 'c', a[1].name ) + end + + def test_itterate_over_children + foo = make_small_document + ctr = 0 + foo[0].each { ctr += 1 } + assert_equal( 2, ctr ) + end + + def test_add_text + foo = Node.new( "a" ) + foo.add_text( "Sean" ) + sean = foo[0] + assert( sean.node_type == :text ) + end + + def test_add_instruction + foo = Node.new( "a" ) + foo.add_instruction( "target", "value" ) + assert( foo[0].node_type == :processing_instruction ) + end + + def test_add_comment + foo = Node.new( "a" ) + foo.add_comment( "target", "value" ) + assert( foo[0].node_type == :comment ) + end + + def test_get_root + foo = Node.new( 'a' ) + 10.times { foo = foo.add_element('b') } + assert_equals( 'b', foo.name ) + assert_equals( 'a', foo.root.name ) + end + + def make_small_document + r = Node.new + a = r.add_element( "a" ) + a.add_element( 'b' ) + a.add_element( 'c' ) + r + end +=end + end +end diff --git a/jni/ruby/test/rexml/test_lightparser.rb b/jni/ruby/test/rexml/test_lightparser.rb new file mode 100644 index 0000000..f8212dc --- /dev/null +++ b/jni/ruby/test/rexml/test_lightparser.rb @@ -0,0 +1,15 @@ +require_relative 'rexml_test_utils' +require 'rexml/parsers/lightparser' + +module REXMLTests + class LightParserTester < Test::Unit::TestCase + include REXMLTestUtils + include REXML + def test_parsing + File.open(fixture_path("documentation.xml")) do |f| + parser = REXML::Parsers::LightParser.new( f ) + parser.parse + end + end + end +end diff --git a/jni/ruby/test/rexml/test_listener.rb b/jni/ruby/test/rexml/test_listener.rb new file mode 100644 index 0000000..309e827 --- /dev/null +++ b/jni/ruby/test/rexml/test_listener.rb @@ -0,0 +1,130 @@ +# coding: binary + +require_relative 'rexml_test_utils' + +require 'rexml/document' +require 'rexml/streamlistener' + +module REXMLTests + class BaseTester < Test::Unit::TestCase + include REXMLTestUtils + def test_empty + return unless defined? @listener + # Empty. + t1 = %Q{} + assert_equal( "", @listener.parse( t1 ), + "Empty" ) + end + + def test_space + return unless defined? @listener + # Space. + t2 = %Q{ } + assert_equal( " ", @listener.parse( t2 ), + "Space" ) + end + + def test_whitespace + return unless defined? @listener + # Whitespaces. + t3 = %Q{RE\n \t \n \t XML} + assert_equal( "RE\n \t \n \t XML", @listener.parse( t3 ), + "Whitespaces" ) + end + + def test_leading_trailing_whitespace + return unless defined? @listener + # Leading and trailing whitespaces. + t4 = %Q{ REXML } + assert_equal( " REXML ", @listener.parse( t4 ), + "Leading and trailing whitespaces" ) + end + + def test_entity_reference + return unless defined? @listener + # Entity reference. + t5 = %Q{<>&lt;&gt;} + assert_equal( "<><>", @listener.parse( t5 ), + "Entity reference" ) + end + + def test_character_reference + return unless defined? @listener + # Character reference. + t6 = %Q{ } + assert_equal( "\r", @listener.parse( t6 ), + "Character reference." ) + end + + def test_cr + return unless defined? @listener + # CR. + t7 = %Q{ \r\n \r \n } + assert_equal( " \n \n \n ".unpack("C*").inspect, + @listener.parse( t7 ).unpack("C*").inspect, "CR" ) + end + + # The accent bug, and the code that exhibits the bug, was contributed by + # Guilhem Vellut + class AccentListener + def tag_start(name,attributes) + #p name + #p attributes + end + def tag_end(name) + #p "/"+name + end + def xmldecl(a,b,c) + #puts "#{a} #{b} #{c}" + end + def text(tx) + #p tx + end + end + + def test_accents + source = %[ + + +] + doc = REXML::Document.new( source ) + a = doc.elements['/g/f'].attribute('a') + if a.value.respond_to? :force_encoding + a.value.force_encoding('binary') + end + assert_equal( "\xC3\xA9", a.value) + doc = File::open(fixture_path("stream_accents.xml")) do |f| + REXML::Document.parse_stream(f, AccentListener::new) + end + end + end + + class MyREXMLListener + include REXML::StreamListener + + def initialize + @text = nil + end + + def parse( stringOrReadable ) + @text = "" + REXML::Document.parse_stream( stringOrReadable, self ) + @text + end + + def text( text ) + @text << text + end + end + + class REXMLTester < BaseTester + def setup + @listener = MyREXMLListener.new + end + + def test_character_reference_2 + t6 = %Q{ } + assert_equal( t6.strip, REXML::Document.new(t6).to_s ) + end + end +end diff --git a/jni/ruby/test/rexml/test_martin_fowler.rb b/jni/ruby/test/rexml/test_martin_fowler.rb new file mode 100644 index 0000000..26db110 --- /dev/null +++ b/jni/ruby/test/rexml/test_martin_fowler.rb @@ -0,0 +1,39 @@ +require 'test/unit' +require 'rexml/document' + +module REXMLTests + class OrderTester < Test::Unit::TestCase + DOC = < +Remove this element and figs order differently +
+
+

Para of text

+

Remove this and figs order differently

+
+
+
+
+ +END + + def initialize n + @doc = REXML::Document.new(DOC) + @figs = REXML::XPath.match(@doc,'//figure') + @names = @figs.collect {|f| f.attributes['src']} + super + end + def test_fig1 + assert_equal 'fig1', @figs[0].attributes['src'] + end + def test_fig2 + assert_equal 'fig2', @figs[1].attributes['src'] + end + def test_fig3 + assert_equal 'fig3', @figs[2].attributes['src'] + end + def test_fig4 + assert_equal 'fig4', @figs[3].attributes['src'] + end + end +end diff --git a/jni/ruby/test/rexml/test_namespace.rb b/jni/ruby/test/rexml/test_namespace.rb new file mode 100644 index 0000000..f5cd294 --- /dev/null +++ b/jni/ruby/test/rexml/test_namespace.rb @@ -0,0 +1,40 @@ +require_relative "rexml_test_utils" + +require "rexml/document" + +module REXMLTests + class TestNamespace < Test::Unit::TestCase + include REXMLTestUtils + include REXML + + def setup + @xsa_source = <<-EOL + + + + + + + + Lars Marius Garshol + larsga@garshol.priv.no + http://www.stud.ifi.uio.no/~lmariusg/ + + + EOL + end + + def test_xml_namespace + xml = <<-XML + + +XML + document = Document.new(xml) + assert_equal("http://www.w3.org/XML/1998/namespace", + document.root.namespace("xml")) + end + end +end diff --git a/jni/ruby/test/rexml/test_order.rb b/jni/ruby/test/rexml/test_order.rb new file mode 100644 index 0000000..0e84961 --- /dev/null +++ b/jni/ruby/test/rexml/test_order.rb @@ -0,0 +1,109 @@ +require_relative 'rexml_test_utils' +require 'rexml/document' +begin + require 'zlib' +rescue LoadError +end + +module REXMLTests + class OrderTester < Test::Unit::TestCase + include REXMLTestUtils + + TESTDOC = < + + + + + + + + +END + + def setup + @doc = REXML::Document.new(TESTDOC) + @items = REXML::XPath.match(@doc,'//x') + end + def test_first_element + assert_equal '1', @items[0].attributes['id'] + end + def test_second_element + assert_equal '2', @items[1].attributes['id'] + end + def test_third_element + assert_equal '3', @items[2].attributes['id'] + end + def test_order + d = REXML::Document.new( " + " ) + items = REXML::XPath.match( d, '//x' ) + assert_equal( %w{1 2 3 4 5}, items.collect{|e| e.attributes['id']} ) + d = REXML::Document.new( " + + " ) + items = REXML::XPath.match( d, '//y' ) + assert_equal( %w{1 2 3 4}, items.collect{|e| e.attributes['id']} ) + end + # Provided by Tom Talbott + def test_more_ordering + doc = Zlib::GzipReader.open(fixture_path('LostineRiver.kml.gz'), encoding: 'utf-8') do |f| + REXML::Document.new(f) + end + actual = [ + "Head south from Phinney Ave N", + "Turn left at N 36th St", + "Turn right at Fremont Ave N", + "Continue on 4th Ave N", + "Turn left at Westlake Ave N", + "Bear right at 9th Ave N", + "Turn left at Mercer St", + "Take the I-5 ramp", + "Take the I-5 S ramp", + "Take the I-90 E exit #164 to Bellevue/Spokane/4th Ave S.", + "Take the I-90 E ramp to Bellevue/Spokane", + "Take exit #137 to Wanapum Dam/Richland", + "Bear right at WA-26", + "Bear right and head toward WA-243", + "Continue on WA-243", + "Bear right at WA-24", + "Continue on WA-240", + "Turn right at WA-240 E", + "Take the I-182 W ramp to Yakima (I-82)/Pendleton", + "Take the I-82 E ramp to Umatilla/Pendleton", + "Take the I-84 E ramp to Pendleton", + "Take the OR-82 exit #261 to La Grande/Elgin", + "Turn right at Island Ave", + "Continue on W 1st St", + "Turn left at N McAlister Rd", + "Bear right at OR-82", + "Continue on Wallowa Lake Hwy", + "Continue on OR-82", + "Continue on Ruckman Ave", + "Continue on OR-82", + "Continue on S 8th Ave", + "Turn right at Albany St", + "Continue on OR-82", + "Continue on Wallowa Lake Hwy", + "Continue on N Madison St", + "Bear left at W 1st St", + "Continue on Wallowa Lake Hwy", + "Continue on Water St", + "Bear right at Lostine River Rd", + "Bear right and head toward Lostine River Rd", + "Turn right at Lostine River Rd", + "Continue on NF-8210", + "Turn right and head toward NF-8210", + "Turn right at NF-8210", + "", + "Route" + ] + count = 0 + REXML::XPath.each( doc, "//Placemark") { |element| + n = element.elements["name"].text.squeeze(" ") + assert_equal( actual[count], n ) unless n =~ /Arrive at/ + count += 1 + } + end if defined?(Zlib::GzipReader) + end +end diff --git a/jni/ruby/test/rexml/test_preceding_sibling.rb b/jni/ruby/test/rexml/test_preceding_sibling.rb new file mode 100644 index 0000000..54fdd5b --- /dev/null +++ b/jni/ruby/test/rexml/test_preceding_sibling.rb @@ -0,0 +1,40 @@ +# ISSUE 32 +require 'test/unit' +require 'rexml/document' + +module REXMLTests + # daz - for report by Dan Kohn in: + # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/156328 + class XPathTesterDd < Test::Unit::TestCase + include REXML + + def setup + @@docDd = Document.new(<<-EOS, :ignore_whitespace_nodes => :all) + + + Success + + + abc02C + + + EOS + end + + def test_Dd_preceding_sibling_children + arr = [] + XPath.each(@@docDd, "//b[@x='ab02A']/preceding-sibling::b/child::*") do |cell| + arr << cell.texts.join + end + assert_equal( 'Success', arr.join ) + end + + def test_Dd_preceding_sibling_all + arr = [] + XPath.each(@@docDd, "//b[@x='ab02A']/preceding-sibling::*") do |cell| + arr << cell.to_s + end + assert_equal( "Success", arr.join ) + end + end +end diff --git a/jni/ruby/test/rexml/test_pullparser.rb b/jni/ruby/test/rexml/test_pullparser.rb new file mode 100644 index 0000000..db336a1 --- /dev/null +++ b/jni/ruby/test/rexml/test_pullparser.rb @@ -0,0 +1,102 @@ +require "test/unit/testcase" + +require 'rexml/parsers/pullparser' + +module REXMLTests + class PullParserTester < Test::Unit::TestCase + include REXML + def test_basics + source = ' + + foo <bar nooo' + parser = REXML::Parsers::PullParser.new(source) + res = { :text=>0 } + until parser.empty? + results = parser.pull + res[ :xmldecl ] = true if results.xmldecl? + res[ :doctype ] = true if results.doctype? + res[ :a ] = true if results.start_element? and results[0] == 'a' + if results.start_element? and results[0] == 'b' + res[ :b ] = true + assert_equal 'value', results[1]['attribute'] + end + res[ :text ] += 1 if results.text? + end + [ :xmldecl, :doctype, :a, :b ].each { |tag| + assert res[tag] , "#{tag} wasn't processed" + } + assert_equal 4, res[ :text ] + rescue ParseException + puts $! + end + + def test_bad_document + source = "" + parser = REXML::Parsers::PullParser.new(source) + assert_raise(ParseException, "Parsing should have failed") { + parser.pull while parser.has_next? + } + end + + def test_entity_replacement + source = ' + + + ]>&la;&lala;' + pp = REXML::Parsers::PullParser.new( source ) + el_name = '' + while pp.has_next? + event = pp.pull + case event.event_type + when :start_element + el_name = event[0] + when :text + case el_name + when 'la' + assert_equal('1234', event[1]) + when 'lala' + assert_equal('--1234--', event[1]) + end + end + end + end + + def test_peek_unshift + source = "" + REXML::Parsers::PullParser.new(source) + # FINISH ME! + end + + def test_inspect + xml = 'Hey' + parser = Parsers::PullParser.new( xml ) + while parser.has_next? + pull_event = parser.pull + if pull_event.start_element? + peek = parser.peek() + peek.inspect + end + end + end + + def test_peek + xml = 'Hey' + parser = Parsers::PullParser.new( xml ) + names = %w{ a b } + while parser.has_next? + pull_event = parser.pull + if pull_event.start_element? + assert_equal( :start_element, pull_event.event_type ) + assert_equal( names.shift, pull_event[0] ) + if names[0] == 'b' + peek = parser.peek() + assert_equal( :start_element, peek.event_type ) + assert_equal( names[0], peek[0] ) + end + end + end + assert_equal( 0, names.length ) + end + end +end diff --git a/jni/ruby/test/rexml/test_rexml_issuezilla.rb b/jni/ruby/test/rexml/test_rexml_issuezilla.rb new file mode 100644 index 0000000..bb63466 --- /dev/null +++ b/jni/ruby/test/rexml/test_rexml_issuezilla.rb @@ -0,0 +1,18 @@ +require_relative 'rexml_test_utils' +require 'rexml/document' + +module REXMLTests + class TestIssuezillaParsing < Test::Unit::TestCase + include REXMLTestUtils + def test_rexml + doc = File.open(fixture_path("ofbiz-issues-full-177.xml")) do |f| + REXML::Document.new(f) + end + ctr = 1 + doc.root.each_element('//issue') do |issue| + assert_equal( ctr, issue.elements['issue_id'].text.to_i ) + ctr += 1 + end + end + end +end diff --git a/jni/ruby/test/rexml/test_sax.rb b/jni/ruby/test/rexml/test_sax.rb new file mode 100644 index 0000000..2d37ec9 --- /dev/null +++ b/jni/ruby/test/rexml/test_sax.rb @@ -0,0 +1,286 @@ +require_relative "rexml_test_utils" +require 'rexml/sax2listener' +require 'rexml/parsers/sax2parser' +require 'rexml/document' + +module REXMLTests + class SAX2Tester < Test::Unit::TestCase + include REXMLTestUtils + include REXML + def test_characters + d = Document.new( "@blah@" ) + txt = d.root.text + p = Parsers::SAX2Parser.new "@blah@" + p.listen(:characters) {|x| assert_equal txt, x} + p.listen(:characters, ["A"]) {|x| assert_equal txt,x} + p.parse + end + + def test_entity_replacement + source = ' + + + ]>&la;&lala;' + sax = Parsers::SAX2Parser.new( source ) + results = [] + sax.listen(:characters) {|x| results << x } + sax.parse + assert_equal 2, results.size + assert_equal '1234', results[0] + assert_equal '--1234--', results[1] + end + + def test_sax2 + File.open(fixture_path("documentation.xml")) do |f| + parser = Parsers::SAX2Parser.new( f ) + # Listen to all events on the following elements + count = 0 + blok = proc { |uri,localname,qname,attributes| + assert %w{ bugs todo }.include?(localname), + "Mismatched name; we got '#{qname}'\nArgs were:\n\tURI: #{uri}\n\tLOCALNAME: #{localname}\n\tQNAME: #{qname}\n\tATTRIBUTES: #{attributes.inspect}\n\tSELF=#{blok}" + count += 1 + } + + start_document = 0 + end_document = 0 + parser.listen( :start_document ) { start_document += 1 } + parser.listen( :end_document ) { end_document += 1 } + parser.listen( :start_element, %w{ changelog bugs todo }, &blok ) + # Listen to all events on the following elements. Synonymous with + # listen( :start_element, %w{ ... } ) + parser.listen( %w{ changelog bugs todo }, &blok ) + # Listen for all start element events + parser.listen( :start_element ) { |uri,localname,qname,attributes| + } + listener = MySAX2Listener.new + # Listen for all events + parser.listen( listener ) + # Listen for all events on the given elements. Does not include children + # events. Regular expressions work as well! + parser.listen( %w{ /change/ bugs todo }, listener ) + # Test the deafening method + blok = proc { |uri,localname,qname,attributes| + assert_fail "This listener should have been deafened!" + } + parser.listen( %w{ changelog }, &blok ) + parser.deafen( &blok ) + + tc = 0 + parser.listen( :characters, %w{version} ) {|text| + assert(text=~/@ANT_VERSION@/, "version was '#{text}'") + tc += 1 + } + + begin + parser.parse + rescue => exception + if exception.kind_of? Test::Unit::AssertionFailedError + raise exception + end + puts $! + puts exception.backtrace + end + assert_equal 2, count + assert_equal 1, tc + assert_equal 1, start_document + assert_equal 1, end_document + end + end + + # used by test_simple_doctype_listener + # submitted by Jeff Barczewski + class SimpleDoctypeListener + include REXML::SAX2Listener + attr_reader :name, :pub_sys, :long_name, :uri + + def initialize + @name = @pub_sys = @long_name = @uri = nil + end + + def doctype(name, pub_sys, long_name, uri) + @name = name + @pub_sys = pub_sys + @long_name = long_name + @uri = uri + end + end + + # test simple non-entity doctype in sax listener + # submitted by Jeff Barczewski + def test_simple_doctype_listener + xml = <<-END + + + Hello, world! + END + parser = Parsers::SAX2Parser.new(xml) + dtl = SimpleDoctypeListener.new + parser.listen(dtl) + tname = nil + tpub_sys = nil + tlong_name = nil + turi = nil + parser.listen(:doctype) do |name, pub_sys, long_name, uri| + tname = name + tpub_sys = pub_sys + tlong_name = long_name + turi = uri + end + parser.parse + assert_equal 'greeting', tname, 'simple doctype block listener failed - incorrect name' + assert_equal 'PUBLIC', tpub_sys, 'simple doctype block listener failed - incorrect pub_sys' + assert_equal 'Hello Greeting DTD', tlong_name, 'simple doctype block listener failed - incorrect long_name' + assert_equal 'http://foo/hello.dtd', turi, 'simple doctype block listener failed - incorrect uri' + assert_equal 'greeting', dtl.name, 'simple doctype listener failed - incorrect name' + assert_equal 'PUBLIC', dtl.pub_sys, 'simple doctype listener failed - incorrect pub_sys' + assert_equal 'Hello Greeting DTD', dtl.long_name, 'simple doctype listener failed - incorrect long_name' + assert_equal 'http://foo/hello.dtd', dtl.uri, 'simple doctype listener failed - incorrect uri' + end + + # test doctype with missing name, should throw ParseException + # submitted by Jeff Barczewseki + def test_doctype_with_mising_name_throws_exception + xml = <<-END + + + Hello, world! + END + parser = Parsers::SAX2Parser.new(xml) + assert_raise(REXML::ParseException, 'doctype missing name did not throw ParseException') do + parser.parse + end + end + + + class KouListener + include REXML::SAX2Listener + attr_accessor :sdoc, :edoc + attr_reader :selem, :decl, :pi + def initialize + @sdoc = @edoc = @selem = false + @decl = 0 + @pi = 0 + end + def start_document + @sdoc = true + end + def end_document + @edoc = true + end + def xmldecl( *arg ) + @decl += 1 + end + def processing_instruction( *arg ) + @pi += 1 + end + def start_element( *arg ) + @selem = true + end + end + + # Submitted by Kou + def test_begin_end_document + parser = Parsers::SAX2Parser.new("") + + kl = KouListener.new + parser.listen(kl) + sd = false + ed = false + parser.listen(:start_document) { sd = true } + parser.listen(:end_document) { ed = true } + + parser.parse + assert( sd, ':start_document block failed' ) + assert( ed, ':end_document block failed' ) + assert( kl.sdoc, ':start_document listener failed' ) + assert( kl.edoc, ':end_document listener failed' ) + end + + # Submitted by Kou + def test_listen_before_start + # FIXME: the following comment should be a test for validity. (The xml declaration + # is invalid). + #parser = Parsers::SAX2Parser.new( "") + parser = Parsers::SAX2Parser.new( "") + k1 = KouListener.new + parser.listen( k1 ) + xmldecl = false + pi = 0 + parser.listen( :xmldecl ) { xmldecl = true } + parser.listen( :processing_instruction ) { pi += 1 } + + parser.parse + + assert( xmldecl, ':xmldecl failed' ) + assert_equal( 2, pi, ':processing_instruction failed' ) + assert( k1.decl, 'Listener for xmldecl failed' ) + assert_equal( 2, k1.pi, 'Listener for processing instruction failed' ) + end + + + def test_socket + require 'socket' + + TCPServer.open('127.0.0.1', 0) do |server| + TCPSocket.open('127.0.0.1', server.addr[1]) do |socket| + ok = false + session = server.accept + begin + session << '' + parser = REXML::Parsers::SAX2Parser.new(socket) + Fiber.new do + parser.listen(:start_element) do + ok = true + Fiber.yield + end + parser.parse + end.resume + assert(ok) + ensure + session.close + end + end + end + end + + def test_char_ref_sax2() + parser = REXML::Parsers::SAX2Parser.new('ü') + result = nil + parser.listen(:characters) {|text| result = text.unpack('U*')} + parser.parse() + assert_equal(1, result.size) + assert_equal(252, result[0]) + end + + + def test_char_ref_dom() + doc = REXML::Document.new('ü') + result = doc.root.text.unpack('U*') + assert_equal(1, result.size) + assert_equal(252, result[0]) + end + + class Ticket68 + include REXML::SAX2Listener + end + def test_ticket_68 + File.open(fixture_path('ticket_68.xml')) do |f| + parser = REXML::Parsers::SAX2Parser.new(f) + parser.listen( Ticket68.new ) + begin + parser.parse + rescue + p parser.source.position + p parser.source.current_line + puts $!.backtrace.join("\n") + flunk $!.message + end + end + end + end + + class MySAX2Listener + include REXML::SAX2Listener + end +end diff --git a/jni/ruby/test/rexml/test_stream.rb b/jni/ruby/test/rexml/test_stream.rb new file mode 100644 index 0000000..3164d91 --- /dev/null +++ b/jni/ruby/test/rexml/test_stream.rb @@ -0,0 +1,129 @@ +require "test/unit/testcase" +require "rexml/document" +require 'rexml/streamlistener' +require 'stringio' + +module REXMLTests + class MyListener + include REXML::StreamListener + end + + + class StreamTester < Test::Unit::TestCase + # Submitted by Han Holl + def test_listener + data = %Q{\n} + + b = RequestReader.new( data ) + b = RequestReader.new( data ) + end + + def test_ticket_49 + source = StringIO.new( <<-EOL ) + + ]> + &ent; + EOL + REXML::Document.parse_stream(source, MyListener.new) + end + + def test_ticket_10 + source = StringIO.new( <<-EOL ) + + + + + ]> + + EOL + listener = MyListener.new + class << listener + attr_accessor :events + def entitydecl( content ) + @events[ :entitydecl ] = true + end + def attlistdecl( element_name, attributes, raw_content ) + @events[ :attlistdecl ] = true + end + def elementdecl( content ) + @events[ :elementdecl ] = true + end + def notationdecl( content ) + @events[ :notationdecl ] = true + end + end + listener.events = {} + + REXML::Document.parse_stream( source, listener ) + + assert( listener.events[:entitydecl] ) + assert( listener.events[:attlistdecl] ) + assert( listener.events[:elementdecl] ) + assert( listener.events[:notationdecl] ) + end + + def test_entity + listener = MyListener.new + class << listener + attr_accessor :entities + def entity(content) + @entities << content + end + end + listener.entities = [] + + source = StringIO.new(<<-XML) + +%ISOLat2; +]> + + XML + REXML::Document.parse_stream(source, listener) + + assert_equal(["ISOLat2"], listener.entities) + end + end + + + # For test_listener + class RequestReader + attr_reader :doc + def initialize(io) + @stack = [] + @doc = nil + catch(:fini) do + REXML::Document.parse_stream(io, self) + raise IOError + end + end + def tag_start(name, args) + if @doc + @stack.push(REXML::Element.new(name, @stack.last)) + else + @doc = REXML::Document.new("<#{name}/>") + @stack.push(@doc.root) + end + args.each do |attr,val| + @stack.last.add_attribute(attr, val) + end + end + def tag_end(name, *args) + @stack.pop + throw(:fini) if @stack.empty? + end + def text(str) + @stack.last.text = str + end + def comment(str) + end + def doctype( name, pub_sys, long_name, uri ) + end + def doctype_end + end + end +end diff --git a/jni/ruby/test/rexml/test_text.rb b/jni/ruby/test/rexml/test_text.rb new file mode 100644 index 0000000..52ee11e --- /dev/null +++ b/jni/ruby/test/rexml/test_text.rb @@ -0,0 +1,21 @@ +require "rexml/text" + +module REXMLTests + class TextTester < Test::Unit::TestCase + include REXML + + def test_shift_operator_chain + text = Text.new("original\r\n") + text << "append1\r\n" << "append2\r\n" + assert_equal("original\nappend1\nappend2\n", text.to_s) + end + + def test_shift_operator_cache + text = Text.new("original\r\n") + text << "append1\r\n" << "append2\r\n" + assert_equal("original\nappend1\nappend2\n", text.to_s) + text << "append3\r\n" << "append4\r\n" + assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s) + end + end +end diff --git a/jni/ruby/test/rexml/test_ticket_80.rb b/jni/ruby/test/rexml/test_ticket_80.rb new file mode 100644 index 0000000..ffeece5 --- /dev/null +++ b/jni/ruby/test/rexml/test_ticket_80.rb @@ -0,0 +1,58 @@ +#------------------------------------------------------------------------------ +# file: rexml_test.rb +# desc: test's REXML's XML/XPath implementation +# auth: Philip J Grabner atdot +# date: 2006/08/17 +# copy: (C) CopyLoose 2006 Bib Development Team atdot +#------------------------------------------------------------------------------ + +require 'test/unit' +require 'rexml/document' + +module REXMLTests + class Ticket80 < Test::Unit::TestCase + + @@xmlstr = ' + + + + + + + + + + + + + +' + + #---------------------------------------------------------------------------- + def test_xpathNamespacedChildWildcard + # tests the "prefix:*" node test syntax + out = Array.new + REXML::XPath.each( REXML::Document.new(@@xmlstr), + '/ns:root/ns:*/ns:l2/@value', + { 'ns' => 'urn:some-xml-ns' } ) do |node| out.push node.value ; end + chk = [ 'foo-01', 'foo-02', 'foo-03', 'bar-01', 'bar-02' ] + assert_equal chk, out + end + + #---------------------------------------------------------------------------- + def test_xpathNamespacedChildWildcardWorkaround + # tests a workaround for the "prefix:*" node test syntax + out = Array.new + REXML::XPath.each( REXML::Document.new(@@xmlstr), + '/ns:root/*[namespace-uri()="urn:some-xml-ns"]/ns:l2/@value', + { 'ns' => 'urn:some-xml-ns' } ) do |node| out.push node.value ; end + chk = [ 'foo-01', 'foo-02', 'foo-03', 'bar-01', 'bar-02' ] + assert_equal chk, out + end + + end +end + +#------------------------------------------------------------------------------ +# end of rexml_test.rb +#------------------------------------------------------------------------------ diff --git a/jni/ruby/test/rexml/test_validation_rng.rb b/jni/ruby/test/rexml/test_validation_rng.rb new file mode 100644 index 0000000..8989fe2 --- /dev/null +++ b/jni/ruby/test/rexml/test_validation_rng.rb @@ -0,0 +1,792 @@ +require "test/unit/testcase" + +require "rexml/document" +require "rexml/validation/relaxng" + +module REXMLTests + class RNGValidation < Test::Unit::TestCase + include REXML + + def test_validate + rng = %q{ + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + no_error( validator, %q{} ) + error( validator, %q{} ) + end + + + def test_sequence + rng = %q{ + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + end + + + def test_choice + rng = %q{ + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + end + + def test_optional + rng = %q{ + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + no_error( validator, %q{} ) + no_error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + end + + def test_zero_or_more + rng = %q{ + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + no_error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + error( validator, %q{} ) + end + + def test_one_or_more + rng = %q{ + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + end + + def test_attribute + rng = %q{ + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + end + + def test_choice_attributes + rng = %q{ + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{}) + no_error( validator, %q{} ) + end + + def test_choice_attribute_element + rng = %q{ + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{}) + no_error( validator, %q{} ) + end + + def test_empty + rng = %q{ + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{Text} ) + no_error( validator, %q{}) + end + + def test_text_val + rng = %q{ + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + no_error( validator, %q{Text} ) + error( validator, %q{}) + end + + def test_choice_text + rng = %q{ + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{Text} ) + error( validator, %q{Text} ) + no_error( validator, %q{Text} ) + no_error( validator, %q{} ) + end + + def test_group + rng = %q{ + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + + rng = %q{ + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + end + + def test_value + # Values as text nodes + rng = %q{ + + + + VaLuE + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{X} ) + error( validator, %q{} ) + no_error( validator, %q{VaLuE} ) + + # Values as text nodes, via choice + rng = %q{ + + + + + Option 1 + Option 2 + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{XYZ} ) + no_error( validator, %q{Option 1} ) + no_error( validator, %q{Option 2} ) + + # Attribute values + rng = %q{ + + + + VaLuE + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + + # Attribute values via choice + rng = %q{ + + + + + Option 1 + Option 2 + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + end + + def test_interleave + rng = %q{ + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + error( validator, %q{} ) + end + + def test_mixed + rng = %q{ + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + no_error( validator, %q{Text} ) + no_error( validator, %q{Text} ) + end + + def test_ref_sequence + rng = %q{ + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + no_error( validator, %q{} ) + error( validator, %q{} ) + end + + def test_ref_choice + rng = %q{ + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + end + + + def test_ref_zero_plus + rng = %q{ + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + end + + + def test_ref_one_plus + rng = %q{ + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + end + + def test_ref_interleave + rng = %q{ + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + end + + def test_ref_recurse + rng = %q{ + + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + error( validator, %q{} ) + no_error( validator, %q{} ) + no_error( validator, %q{} ) + end + + def test_ref_optional + rng = %q{ + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + no_error( validator, %q{} ) + no_error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + + rng = %q{ + + + + + + + + + + + + + + + + } + validator = REXML::Validation::RelaxNG.new( rng ) + + no_error( validator, %q{} ) + no_error( validator, %q{} ) + error( validator, %q{} ) + error( validator, %q{} ) + end + + + + def error( validator, source ) + parser = REXML::Parsers::TreeParser.new( source ) + parser.add_listener( validator.reset ) + assert_raise( REXML::Validation::ValidationException, + "Expected a validation error" ) { parser.parse } + end + + def no_error( validator, source ) + parser = REXML::Parsers::TreeParser.new( source ) + parser.add_listener( validator.reset ) + assert_nothing_raised { parser.parse } + end + end +end diff --git a/jni/ruby/test/rexml/test_xml_declaration.rb b/jni/ruby/test/rexml/test_xml_declaration.rb new file mode 100644 index 0000000..a96d40c --- /dev/null +++ b/jni/ruby/test/rexml/test_xml_declaration.rb @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# +# Created by Henrik M奪rtensson on 2007-02-18. +# Copyright (c) 2007. All rights reserved. + +require "rexml/document" +require "test/unit" + +module REXMLTests + class TestXmlDeclaration < Test::Unit::TestCase + def setup + xml = <<-'END_XML' + + + + END_XML + @doc = REXML::Document.new xml + @root = @doc.root + @xml_declaration = @doc.children[0] + end + + def test_is_first_child + assert_kind_of(REXML::XMLDecl, @xml_declaration) + end + + def test_has_document_as_parent + assert_kind_of(REXML::Document, @xml_declaration.parent) + end + + def test_has_sibling + assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling) + assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling) + end + end +end diff --git a/jni/ruby/test/rexml/xpath/test_attribute.rb b/jni/ruby/test/rexml/xpath/test_attribute.rb new file mode 100644 index 0000000..95af4de --- /dev/null +++ b/jni/ruby/test/rexml/xpath/test_attribute.rb @@ -0,0 +1,29 @@ +require 'test/unit' +require 'rexml/document' + +module REXMLTests + class TestXPathAttribute < Test::Unit::TestCase + def setup + @xml = <<-XML + + + child1 + child2 + child3 + + XML + @document = REXML::Document.new(@xml) + end + + def test_elements + root = @document.elements["root"] + second_child = root.elements["child[@name='two']"] + assert_equal("child2", second_child.text) + end + + def test_xpath_each + children = REXML::XPath.each(@document, "/root/child[@name='two']") + assert_equal(["child2"], children.collect(&:text)) + end + end +end diff --git a/jni/ruby/test/rexml/xpath/test_axis_preceding_sibling.rb b/jni/ruby/test/rexml/xpath/test_axis_preceding_sibling.rb new file mode 100644 index 0000000..2731807 --- /dev/null +++ b/jni/ruby/test/rexml/xpath/test_axis_preceding_sibling.rb @@ -0,0 +1,39 @@ +require "test/unit/testcase" +require "rexml/document" + +module REXMLTests + class TestXPathAxisPredcedingSibling < Test::Unit::TestCase + include REXML + SOURCE = <<-EOF + + + + + + + + + EOF + + def setup + @@doc = Document.new(SOURCE) unless defined? @@doc + end + + def test_preceding_sibling_axis + context = XPath.first(@@doc,"/a/e/f[last()]") + assert_equal "6", context.attributes["id"] + + prev = XPath.first(context, "preceding-sibling::f") + assert_equal "5", prev.attributes["id"] + + prev = XPath.first(context, "preceding-sibling::f[1]") + assert_equal "5", prev.attributes["id"] + + prev = XPath.first(context, "preceding-sibling::f[2]") + assert_equal "4", prev.attributes["id"] + + prev = XPath.first(context, "preceding-sibling::f[3]") + assert_equal "3", prev.attributes["id"] + end + end +end diff --git a/jni/ruby/test/rexml/xpath/test_base.rb b/jni/ruby/test/rexml/xpath/test_base.rb new file mode 100644 index 0000000..a57ba63 --- /dev/null +++ b/jni/ruby/test/rexml/xpath/test_base.rb @@ -0,0 +1,1089 @@ +require_relative "../rexml_test_utils" + +require "rexml/document" + +module REXMLTests + class TestXPathBase < Test::Unit::TestCase + include REXMLTestUtils + include REXML + SOURCE = <<-EOF + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + EOF + JENI_TENNISON = <<-EOJT + + + + + + + + + + + + + + + + + + + + + + + + EOJT + + def setup + @@doc = Document.new(SOURCE) unless defined? @@doc + @@jeni = Document.new( JENI_TENNISON ) unless defined? @@jeni + end + + def each_test( element, xpath ) + count = 0 + XPath::each( element, xpath ) { |child| + count += 1 + yield child if block_given? + } + count + end + + def test_descendant + doc = Document.new("") + p = XPath.match( doc, "//c" ) + assert_equal( 2, p.size ) + p = XPath.first( @@doc, "//p" ) + assert_equal "p", p.name + c = each_test( @@doc, "//c" ) { |child| assert_equal "c", child.name } + assert_equal 5, c + c = each_test( @@doc.root, "b//c" ) { |child| + assert_equal "c", child.name + } + assert_equal 2, c + + doc = Document.new( "" ) + # //para[1] : all descendants which are the first para child of their parent + assert_equal( 4, XPath.match( doc, "//z[1]" ).size ) + # /descendant::para[1] : the first descendant para element + assert_equal( 1, XPath.match( doc, "/descendant::z[1]" ).size ) + end + + def test_root + source = "" + doc = Document.new( source ) + assert_equal doc, doc.root_node + assert_equal "a", XPath::first( doc, "/" ).elements[1].name + end + + def test_abbreviated_simple_child + assert_equal "a", XPath::first(@@doc, "a").name + end + + def test_child + c = XPath::first( @@doc, "a/b/c" ) + assert_equal "c", c.name + assert_equal "3", XPath::first(@@doc, "a/b/c").attributes["id"] + end + + def test_root_child + assert_equal "a", XPath::first(@@doc, "/a").name + c = XPath::first( @@doc, "a/b/c" ) + assert_equal "a", XPath::first(c, "/a").name + end + + def test_root_children + c = XPath::first( @@doc, "a/b/c" ) + assert_equal "2", XPath::first(c, "/a/b").attributes["id"] + end + + def test_abbreviated_step + c = XPath::first( @@doc, "a/b/c" ) + assert_equal("c", c.name) + assert_equal("a", XPath::first(@@doc.root, ".").name) + assert_equal("b", XPath::first(c, "..").name) + assert_equal("a", XPath::first(@@doc, "a/b/..").name) + + doc = File.open(fixture_path("project.xml")) do |f| + REXML::Document.new(f) + end + c = each_test(doc.root, "./Description" ) { |child| + assert_equal("Description",child.name) + } + assert_equal 1, c + end + + # Things that aren't tested elsewhere + def test_predicates + assert_equal "12", XPath::first(@@doc, "a/e/f[3]").attributes["id"] + assert_equal "13", XPath::first(@@doc, "a/e/f[3]/g").attributes["id"] + assert_equal "14", XPath::first(@@doc, "a/e/f[@a='d'][2]").attributes["id"] + assert_equal "14", XPath::first(@@doc, "a/e/f[@a='d'][@id='14']").attributes["id"] + assert_equal "a", XPath::first( @@doc, "*[name()='a' and @id='1']" ).name + c=each_test( @@doc, "//*[name()='f' and @a='d']") { |i| + assert_equal "f", i.name + } + assert_equal 2, c + c=each_test( @@doc, "//*[name()='m' or @a='d']") { |i| + assert ["m","f"].include?(i.name) + } + assert_equal 3, c + + assert_equal "b", XPath::first( @@doc, "//b[@x]" ).name + end + + def test_node_type + doc = Document.new "text" + #res = XPath::first(doc.root, "text()") + #assert_equal "text", res.to_s + + #res = XPath::first(doc, "*") + #assert_equal "a", res.name + + assert_equal( :processing_instruction, + XPath::first(doc.root, "processing-instruction()").node_type) + assert_equal( :comment, XPath::first(doc.root, "comment()").node_type) + end + + def test_functions + # trivial text() test + # confuse-a-function + source = "more dumb text" + doc = Document.new source + res = "" + #XPath::each(doc.root, "text()") {|val| res << val.to_s} + #assert_equal "more text", res + + #res = XPath::first(doc.root, "b[last()]") + #assert_equal '3', res.attributes['id'] + res = XPath::first(doc.root, "b[position()=2]") + assert_equal '2', res.attributes['id'] + res = XPath::first(doc.root, "*[name()='c']") + assert_equal "c", res.name + end + + def no_test_ancestor + doc = REXML::Document.new(File.new(fixture_path("testsrc.xml"))) + doc.elements.each("//item") { |el| print el.name + if el.attributes['x'] + puts " -- "+el.attributes['x'] + else + puts + end + } + doc.elements.each("//item/ancestor::") { |el| print el.name + if el.attributes['x'] + puts " -- "+el.attributes['x'] + else + puts + end + } + end + + # Here are some XPath tests that were originally submitted by ... + # The code has changed some, but the logic and the source documents are the + # same. + # This method reads a document from a file, and then a series of xpaths, + # also from a file. It then checks each xpath against the source file. + def test_more + xmlsource = fixture_path("testsrc.xml") + xpathtests = fixture_path("xp.tst") + + doc = File.open(xmlsource) {|f| REXML::Document.new(f) } + #results = "" + results = REXML::Document.new + results.add_element "test-results" + File.foreach(xpathtests) do |line| + line.strip! + begin + doc.root + #puts "#"*80 + #print "\nDoing #{line} " ; $stdout.flush + doc.elements.each(line) do |el| + #print "." ; $stdout.flush + results.root << el.clone + #results << el.to_s + end + #ObjectSpace.garbage_collect + GC::start + rescue Exception => z + #puts "\n'#{line}' failed" + fail("Error on line #{line}:\n#{z.message}\n"+z.backtrace[0,10].join("\n")) + #results.root.add_element( "error", {"path"=>line}).text = z.message+"\n"+z.backtrace[0,10].join("\n") + #results << ""+z.message+"" + end + end + end + + def test_axe_descendant + assert_equal "f", XPath::first( @@doc, "descendant::f").name + end + + def test_axe_parent + q = XPath.first( @@doc, "a/d/c/parent::*/q" ) + assert_equal 19, q.attributes["id"].to_i + end + + def test_abbreviated_attribute + assert_equal 'a', XPath::first( @@doc, "a[@id='1']" ).name + c = XPath::first( @@doc, "a/b/c[@id='4']" ) + assert_equal 'c', c.name + assert_equal '4', c.attributes['id'] + + result = XPath::first( @@doc, "descendant::f[@a='c']") + assert_equal "11", result.attributes['id'] + + assert_equal "11", XPath::first(@@doc, "a/e/f[@a='c']").attributes["id"] + assert_equal "11", XPath::first(@@doc, "a/e/*[@a='c']").attributes["id"] + end + + def test_axe_self + c = XPath::first( @@doc, "a/b/c" ) + assert c + assert_equal "c", c.name + assert_equal "c", XPath::first( c, "self::node()" ).name + end + + def test_axe_ancestor + doc = REXML::Document.new " + + + + + + + + + " + + d = XPath.first( doc, "//d" ) + assert_equal "d", d.name + b = each_test( d, "ancestor::b" ) { |el| + assert((1..2) === el.attributes['id'].to_i, + "Expected #{el.attributes['id']} to be either 1 or 2" + ) + } + assert_equal 2, b + end + + def test_axe_child + m = XPath.first( @@doc, "a/child::m" ) + assert_equal 15, m.attributes['id'].to_i + end + + def test_axe_attribute + a = XPath.first( @@doc, "a/attribute::id" ) + assert_equal "1", a.value + a = XPath.first( @@doc, "a/e/f[@id='14']/attribute::a" ) + assert_equal "d", a.value + end + + def test_axe_sibling + doc = Document.new "" + first_f = XPath.first( doc, "a/e/f" ) + assert first_f + assert_equal '10', first_f.attributes['id'] + next_f = XPath.first( doc, "a/e/f/following-sibling::node()" ) + assert_equal '11', next_f.attributes['id'] + + b = XPath.first( doc, "a/e/preceding-sibling::node()" ) + assert_equal 'b', b.name + end + + def test_lang + doc = File.open(fixture_path("lang0.xml")) {|f| Document.new(f) } + #puts IO.read( "test/lang.xml" ) + + #puts XPath.match( doc, "//language/*" ).size + c = each_test( doc, "//language/*" ) { |element| + #puts "#{element.name}: #{element.text}" + } + assert_equal 4, c + end + + def test_namespaces_1 + source = <<-EOF + + this bar + that bar + + EOF + doc = Document.new source + XPath.each( doc, "//bar" ) { + fail "'bar' should match nothing in this case" + } + + namespace = {"t"=>"this"} + results = XPath.first( doc, "//t:bar", namespace ) + assert_equal "this bar", results.text + end + + def test_namespaces_2 + source = <<-EOF + + this bar + that bar + + EOF + doc = Document.new source + res = XPath::first(doc, "//*[local_name()='bar']") + assert res, "looking for //*[name()='bar']" + assert_equal 'this', res.namespace + res = XPath::first(doc.root, "*[namespace_uri()='that']") + assert_equal 'that bar', res.text + end + + def test_complex + next_f = XPath.first( @@doc, "a/e/f[@id='11']/following-sibling::*" ) + assert_equal 12, next_f.attributes['id'].to_i + prev_f = XPath.first( @@doc, "a/e/f[@id='11']/preceding-sibling::*" ) + assert_equal 10, prev_f.attributes['id'].to_i + c = each_test( @@doc, "descendant-or-self::*[@x='y']" ) + assert_equal 2, c + end + + def test_grouping + t = XPath.first( @@doc, "a/d/*[name()='d' and (name()='f' or name()='q')]" ) + assert_nil t + t = XPath.first( @@doc, "a/d/*[(name()='d' and name()='f') or name()='q']" ) + assert_equal 'q', t.name + end + + def test_preceding + d = Document.new "" + start = XPath.first( d, "/a/b[@id='1']" ) + assert_equal 'b', start.name + c = XPath.first( start, "preceding::c" ) + assert_equal '2', c.attributes['id'] + + c1, c0 = XPath.match( d, "/a/b/c[@id='2']/preceding::node()" ) + assert_equal '1', c1.attributes['id'] + assert_equal '0', c0.attributes['id'] + + c2, c1, c0, b, b2, b0 = XPath.match( start, "preceding::node()" ) + + assert_equal 'c', c2.name + assert_equal 'c', c1.name + assert_equal 'c', c0.name + assert_equal 'b', b.name + assert_equal 'b', b2.name + assert_equal 'b', b0.name + + assert_equal '2', c2.attributes['id'] + assert_equal '1', c1.attributes['id'] + assert_equal '0', c0.attributes['id'] + assert b.attributes.empty? + assert_equal '2', b2.attributes['id'] + assert_equal '0', b0.attributes['id'] + + d = REXML::Document.new("") + matches = REXML::XPath.match(d, "/a/d/preceding::node()") + assert_equal("c", matches[0].name) + assert_equal("b", matches[1].name) + + s = "" + d = REXML::Document.new(s) + c = REXML::XPath.match( d, "//c[@id = '5']") + cs = REXML::XPath.match( c, "preceding::c" ) + assert_equal( 4, cs.length ) + end + + def test_following + d = Document.new "" + start = XPath.first( d, "/a/b[@id='0']" ) + assert_equal 'b', start.name + c = XPath.first( start, "following::c" ) + assert_equal '1', c.attributes['id'] + + s = "" + d = Document.new(s) + c = XPath.first(d, '/a/b/c') + assert_equal 'c', c.name + res = XPath.match( c, 'following::*' ) + assert_equal 6, res.size + res = XPath.match( c, 'following::i' ) + assert_equal 2, res.size + end + + # The following three paths were provided by + # Jeni Tennison + # a consultant who is also an XSL and XPath expert + #def test_child_cubed + # els = @@jeni.elements.to_a("*****") + # assert_equal 3, els.size + #end + + #def test_div_2 + # results = doc.elements.to_a("/ div 2") + #end + + #def test_nested_predicates + # puts @@jeni.root.elements[1].elements[1].name + # results = @@jeni.root.elements[1].elements[1].elements.to_a("../following-sibling::*[*[name() = name(current())]]") + # puts results + #end + + # Contributed by Mike Stok + def test_starts_with + source = <<-EOF + + a@b.c + http://www.foo.com + + EOF + doc = Document.new source + mailtos = doc.elements.to_a("//a[starts-with(@href, 'mailto:')]") + assert_equal 1, mailtos.size + assert_equal "mailto:a@b.c", mailtos[0].attributes['href'] + + ailtos = doc.elements.to_a("//a[starts-with(@href, 'ailto:')]") + assert_equal 0, ailtos.size + end + + def test_toms_text_node + file = "ABCDEF" + doc = Document.new(file) + assert_equal 'A', XPath.first(doc[0], 'text()').to_s + assert_equal 'AF', XPath.match(doc[0], 'text()').collect { |n| + n.to_s + }.join('') + assert_equal 'B', XPath.first(doc[0], 'b/text()').to_s + assert_equal 'D', XPath.first(doc[0], '//d/text()').to_s + assert_equal 'ABCDEF', XPath.match(doc[0], '//text()').collect {|n| + n.to_s + }.join('') + end + + def test_string_length + doc = Document.new <<-EOF + + + + + + + + + EOF + assert doc, "create doc" + + set = doc.elements.to_a("//*[string-length(name()) = 3]") + assert_equal 2, set.size, "nodes with names length = 3" + + set = doc.elements.to_a("//*[string-length(name()) < 3]") + assert_equal 2, set.size, "nodes with names length < 3" + + set = doc.elements.to_a("//*[string-length(name()) > 3]") + assert_equal 3, set.size, "nodes with names length > 3" + end + + # Test provided by Mike Stok + def test_contains + source = <<-EOF + + a@b.c + http://www.foo.com + + EOF + doc = Document.new source + + [ + #['o', 2], + ['foo', 1], ['bar', 0]].each { |search, expected| + set = doc.elements.to_a("//a[contains(@href, '#{search}')]") + assert_equal expected, set.size + } + end + + # Mike Stok and Sean Russell + def test_substring + # examples from http://www.w3.org/TR/xpath#function-substring + doc = Document.new('') + + Document.new("") + #puts XPath.first(d, 'node()[0 + 1]') + #d = Document.new("") + #puts XPath.first(d, 'a[0 mod 0]') + [ [1.5, 2.6, '234'], + [0, 3, '12'], + [0, '0 div 0', ''], + [1, '0 div 0', ''], + ['-42', '1 div 0', '12345'], + ['-1 div 0', '1 div 0', ''] + ].each { |start, length, expected| + set = doc.elements.to_a("//test[substring(@string, #{start}, #{length}) = '#{expected}']") + assert_equal 1, set.size, "#{start}, #{length}, '#{expected}'" + } + end + + def test_translate + source = <<-EOF + + + + + + + + EOF + + doc = Document.new(source) + + [ ['bar', 'abc', 'ABC', 'w3c one'], + ['--aaa--','abc-','ABC', 'w3c two'], + ['lead', 'dear language', 'doll groover', 'alchemy'], + ['A Space Odissei', 'i', 'y', 'vbxml one'], + ['abcdefg', 'aceg', 'ACE', 'vbxml two'], + ].each { |arg1, arg2, arg3, name| + translate = "translate('#{arg1}', '#{arg2}', '#{arg3}')" + set = doc.elements.to_a("//case[@result = #{translate}]") + assert_equal 1, set.size, translate + assert_equal name, set[0].attributes['name'] + } + end + + def test_math + d = Document.new( '' ) + assert XPath.first( d.root, 'node()[1]' ) + assert_equal 'b', XPath.first( d.root, 'node()[1]' ).name + assert XPath.first( d.root, 'node()[0 + 1]' ) + assert_equal 'b', XPath.first( d.root, './node()[0 + 1]' ).name + assert XPath.first( d.root, 'node()[1 + 1]' ) + assert_equal 'c', XPath.first( d.root, './node()[1 + 1]' ).name + assert XPath.first( d.root, 'node()[4 div 2]' ) + assert_equal 'c', XPath.first( d.root, './node()[4 div 2]' ).name + assert XPath.first( d.root, 'node()[2 - 1]' ) + assert_equal 'b', XPath.first( d.root, './node()[2 - 1]' ).name + assert XPath.first( d.root, 'node()[5 mod 2]' ) + assert_equal 'b', XPath.first( d.root, './node()[5 mod 2]' ).name + assert XPath.first( d.root, 'node()[8 mod 3]' ) + assert_equal 'c', XPath.first( d.root, './node()[8 mod 3]' ).name + assert XPath.first( d.root, 'node()[1 * 2]' ) + assert_equal 'c', XPath.first( d.root, './node()[1 * 2]' ).name + assert XPath.first( d.root, 'node()[2 + -1]' ) + assert_equal 'b', XPath.first( d.root, './node()[2 + -1]' ).name + end + + def test_name + assert_raise( UndefinedNamespaceException, "x should be undefined" ) { + REXML::Document.new("") + } + d = REXML::Document.new("") + assert_equal 1, d.root.elements.to_a('*[name() = "b"]').size + assert_equal 1, d.elements.to_a('//*[name() = "x:b"]').size + end + + def test_local_name + d = REXML::Document.new("") + assert_equal 2, d.root.elements.to_a('*[local_name() = "b"]').size + assert_equal 2, d.elements.to_a('//*[local_name() = "b"]').size + end + + def test_comparisons + source = "" + doc = REXML::Document.new(source) + + # NOTE TO SER: check that number() is required + assert_equal 2, REXML::XPath.match(doc, "//b[number(@id) > 1]").size + assert_equal 3, REXML::XPath.match(doc, "//b[number(@id) >= 1]").size + assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) <= 1]").size + assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) = (1 * 1)]").size + assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) = (1 mod 2)]").size + assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) = (4 div 2)]").size + end + + # Contributed by Kouhei + def test_substring_before + doc = Document.new("") + assert_equal("a", doc.root.elements.to_a("*[name()=substring-before('abc', 'b')]")[0].name) + assert_equal("c", doc.root.elements.to_a("*[name()=substring-after('abc', 'b')]")[0].name) + end + + def test_spaces + doc = Document.new(" + + + + + ") + assert_equal( 1, REXML::XPath.match(doc, + "//*[local-name()='c' and @id='b']").size ) + assert_equal( 1, REXML::XPath.match(doc, + "//*[ local-name()='c' and @id='b' ]").size ) + assert_equal( 1, REXML::XPath.match(doc, + "//*[ local-name() = 'c' and @id = 'b' ]").size ) + assert_equal( 1, + REXML::XPath.match(doc, '/a/c[@id]').size ) + assert_equal( 1, + REXML::XPath.match(doc, '/a/c[(@id)]').size ) + assert_equal( 1, + REXML::XPath.match(doc, '/a/c[ @id ]').size ) + assert_equal( 1, + REXML::XPath.match(doc, '/a/c[ (@id) ]').size ) + assert_equal( 1, + REXML::XPath.match(doc, '/a/c[( @id )]').size ) + assert_equal( 1, REXML::XPath.match(doc.root, + '/a/c[ ( @id ) ]').size ) + assert_equal( 1, REXML::XPath.match(doc, + '/a/c [ ( @id ) ] ').size ) + assert_equal( 1, REXML::XPath.match(doc, + ' / a / c [ ( @id ) ] ').size ) + end + + def test_text_nodes + # source = " + # + #test + #" + source = "test" + d = REXML::Document.new( source ) + r = REXML::XPath.match( d, %q{/root/child[text()="test"]} ) + assert_equal( 1, r.size ) + assert_equal( "child", r[0].name ) + assert_equal( "test", r[0].text ) + end + + def test_auto_string_value + source = "Introduction" + d = REXML::Document.new( source ) + #r = REXML::XPath.match( d, %q{/root[title="Introduction"]} ) + #assert_equal( 1, r.size ) + source = "test" + d = REXML::Document.new( source ) + r = REXML::XPath.match( d, %q{/a[c='test']} ) + assert_equal( 1, r.size ) + r = REXML::XPath.match( d, %q{a[c='test']} ) + assert_equal( 1, r.size ) + r = d.elements["/a[c='test']"] + assert_not_nil( r ) + r = d.elements["a[c='test']"] + assert_not_nil( r ) + r = d.elements["a[c='xtest']"] + assert_nil( r ) + r = REXML::XPath.match( d, %q{a[c='xtest']} ) + assert_equal( 0, r.size ) + end + + def test_ordering + source = "" + d = REXML::Document.new( source ) + r = REXML::XPath.match( d, %q{/a/*/*[1]} ) + assert_equal( 1, r.size ) + r.each { |el| assert_equal( '1', el.attribute('id').value ) } + end + + def test_descendant_or_self_ordering + source = " + + + + + + + + + + + + + + + " + d = REXML::Document.new( source ) + cs = XPath.match( d, "/descendant-or-self::c" ) + assert_equal( 4, cs.length ) + 1.upto(4) {|x| assert_equal( x.to_s, cs[x-1].attributes['id'] ) } + end + + def test_and + d = Document.new %q{} + assert_equal( nil, d.root.elements["route[@run='0']"] ) + assert_equal( nil, d.root.elements["route[@run='0' and @title='HNO']"] ) + end + + + def test_numbers + d = Document.new %q{} + + xp1 = "/a[ @x = 0 ]" + xp2 = "/a[ @x = '0' ]" + xp3 = "/a[ (@x + 1) = 1 ]" + xp4 = "/a[ @y = 0 ]" + xp5 = "/a[ (@z + 1) = 5 ]" + xp6 = "/a[ (@w + 1) = 5 ]" + xp7 = "/a[ (@v + 1) = 1 ]" + xp8 = "/a[ @n = 0 ]" + + assert_equal( 1, XPath.match( d, xp1 ).length ) + assert_equal( 1, XPath.match( d, xp2 ).length ) + assert_equal( 1, XPath.match( d, xp3 ).length ) + assert_equal( 0, XPath.match( d, xp4 ).length ) + assert_equal( 0, XPath.match( d, xp5 ).length ) + assert_equal( 0, XPath.match( d, xp6 ).length ) + assert_equal( 0, XPath.match( d, xp7 ).length ) + assert_equal( 0, XPath.match( d, xp8 ).length ) + end + + def test_tobis_preceding + doc_string = ' + + + + + +' + + doc = Document.new(doc_string) + + # e = REXML::XPath.first(doc,'/a/c/e') + e = doc.root.get_elements('/a/c/e')[0] + assert_equal( 1, e.get_elements('preceding-sibling::*').length ) + assert_equal( 2, XPath.match(e, 'preceding::*').length ) + end + + + def test_filtering + #doc=Document.new("") + #assert_equal( 3, XPath.match( doc, '/a/b/*[1]' ).length ) + #assert_equal( 2, XPath.match( doc, '/a/b/following-sibling::*[1]' ).length ) + end + + # Submitted by Alex + def test_union + data = %Q{

+ + a + + b +
} + rd = REXML::Document.new( data ) + #union = rd.get_elements("/div/span | /div/em") + #assert_equal(2, union.length, "/div/span | /div/em" ) + union = rd.get_elements('//*[name()="em" or name()="strong"]') + assert_equal(2, union.length, 'name() and "or" failed') + union = rd.get_elements('//em|//strong') + assert_equal(2, union.length, + 'Both tag types are returned by XPath union operator') + end + + + def test_union2 + src = <<-EOL +
+ +a + +b +
+ EOL + rd = REXML::Document.new( src ) + union = rd.get_elements('//em|//strong') + assert_equal(2, union.length, + 'Both tag types are returned by XPath union operator') + end + + + def test_a_star_star_one + string = <<-EOL + + + + + + + + + + + + + + + EOL + d = REXML::Document.new( string ) + c1 = XPath.match( d, '/a/*/*[1]' ) + assert_equal( 1, c1.length ) + assert_equal( 'c1', c1[0].name ) + end + + def test_sum + d = Document.new(""+ + "123"+ + "12"+ + ""+ + "") + + for v,p in [[6, "sum(/a/b)"], + [9, "sum(//b | //d)"], + [3, "sum(/a/e/@*)"] ] + assert_equal( v, XPath::match( d, p ).first ) + end + end + + def test_xpath_namespace + d = REXML::Document.new("xa") + x = d.root + num = 0 + x.each_element('tada') { num += 1 } + assert_equal(1, num) + end + + def test_ticket_39 + doc = REXML::Document.new( <<-EOL ) + + + + true + + Item 1 + + + Item 2 + Thu, 13 Oct 2005 19:59:00 +0000 + + + Item 3 + + + + EOL + root_node = XPath.first(doc, "rss") + assert_not_nil root_node + channel_node = XPath.first(root_node, "channel") + assert_not_nil channel_node + items = XPath.match(channel_node, "*") + assert_equal 4, items.size + items = XPath.match(channel_node, "item") + assert_equal 3, items.size # fails + end + + + def test_ticket_42 + source = "" + doc = Document.new(source) + bElem = Element.new('b') + doc.root.add_element(bElem) + doc.elements.each('//b[name(..) = "a"]') { |x| + assert_equal x,bElem + } + end + + def test_ticket_56 + namespaces = {'h' => 'http://www.w3.org/1999/xhtml'} + + finaldoc = REXML::Document.new(File.read(fixture_path('google.2.xml'))) + + column_headers = [] + + REXML::XPath.each(finaldoc, '//h:form[@action="ModifyCampaign"]//h:th', + namespaces) do |el| + node = REXML::XPath.first(el, 'h:a/text()', namespaces) + column_headers << (node ? node.value : nil) + end + column_headers.map! { |h| h.to_s.strip.chomp } + expected = ["", "", "Current Status", "Current Budget", + "Clicks", "Impr.", "CTR", "Avg. CPC", "Cost", "Conv. Rate", + "Cost/Conv."] + assert_equal( expected, column_headers ) + end + + + def test_ticket_70 + string = < + + Text1, text, +text + + Text2, text, +text + + + + +EOF + doc = Document.new string + assert_equal( 1, XPath.match( doc, "//someelement[contains(@attribute,'1.10')]" ).length ) + end + + def test_ticket_43 + #url = http://news.search.yahoo.com/news/rss?p=market&ei=UTF-8&fl=0&x=wrt + + sum = File.open(fixture_path("yahoo.xml")) do |f| + Document.new(f).elements.to_a("//item").size + end + assert_equal( 10, sum ) + + text = File.open(fixture_path("yahoo.xml")) do |f| + Document.new(f).elements.to_a(%Q{//title[contains(text(), "'")]}).collect{|e| e.text}.join + end + assert_equal( "Broward labor market's a solid performer (Miami Herald)", text ) + end + + def test_ticket_57 + data = "zzz" + + r = Document.new(data) + + assert_equal(Text, REXML::XPath.first(r,"a:x/a:y[@p='p' and @q='q']/a:z/text()").class) + assert_equal("zzz", REXML::XPath.first(r,"a:x/a:y[@p='p' and @q='q']/a:z/text()").to_s) + end + + def test_ticket_59 + data = " + + + + + + + + + + + + + + + + + + + + + + + + + + + " + d = Document.new(data) + res = d.elements.to_a( "//c" ).collect {|e| e.attributes['id'].to_i} + assert_equal( res, res.sort ) + end + + def ticket_61_fixture(doc, xpath) + matches = [] + doc.elements.each(xpath) do |element| + matches << element + assert_equal('Add', element.text) + assert_equal('ButtonText', element.attributes['class']) + end + assert_equal(1, matches.length) + end + + def test_ticket_61_text + doc = File.open(fixture_path("ticket_61.xml")) do |file| + REXML::Document.new file + end + ticket_61_fixture( doc, "//div[text()='Add' and @class='ButtonText']" ) + end + + def test_ticket_61_contains + doc = File.open(fixture_path("ticket_61.xml")) do |file| + REXML::Document.new file + end + ticket_61_fixture( doc, "//div[contains(.,'Add') and @class='ButtonText']" ) + end + + def test_namespaces_0 + d = Document.new(%q{}) + assert_equal( 1, XPath.match( d, "//x:a" ).size ) + assert_equal( 1, XPath.match( d, "//x:*" ).size ) + end + + def test_ticket_71 + doc = Document.new(%Q{}) + el = doc.root.elements[1] + assert_equal( "element", el.name ) + el2 = XPath.first( doc.root, "element[@ns:attrname='foo']", { 'ns' => "xyz" } ) + assert_equal( el, el2 ) + end + + def test_ticket_78 + doc = <<-EOT + + + 123 + + + 123a + + + EOT + seq = %w{BEGIN 123 END BEGIN 123a END} + + xmlDoc = Document.new(doc) + + ["//element[tag='123']/tag", "//element[tag='123a']/tag"].each do |query| + assert_equal( "BEGIN", seq.shift ) + XPath.each(xmlDoc, query) { |element| + assert_equal( seq.shift, element.text ) + } + assert_equal( "END", seq.shift ) + end + end + + def test_ticket_79 + source = "test3" + d = REXML::Document.new( source ) + r = REXML::XPath.match( d, %q{/a/b[c='test']} ) + assert_equal(1, r.size()) + r = REXML::XPath.match( d, %q{/a/b[c='3']} ) + assert_equal(1, r.size()) + end + + def test_or_and + doc = " + + + test + + +

+ A link. +

+ + +" + + xmldoc = REXML::Document.new(doc) + xpath = "descendant::node()[(local-name()='link' or local-name()='a') and @rel='sub']" + hrefs = [] + xmldoc.elements.each(xpath) do |element| + hrefs << element.attributes["href"] + end + assert_equal(["/"], hrefs, "Bug #3842 [ruby-core:32447]") + end + end +end diff --git a/jni/ruby/test/rexml/xpath/test_node.rb b/jni/ruby/test/rexml/xpath/test_node.rb new file mode 100644 index 0000000..aec2de1 --- /dev/null +++ b/jni/ruby/test/rexml/xpath/test_node.rb @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +require_relative "../rexml_test_utils" + +require "rexml/document" + +module REXMLTests + class TestXPathNode < Test::Unit::TestCase + def matches(xml, xpath) + document = REXML::Document.new(xml) + REXML::XPath.each(document, xpath).collect(&:to_s) + end + + class TestQName < self + def test_ascii + xml = <<-XML + + + + child + + + XML + assert_equal(["child"], + matches(xml, "/root/ascii/child")) + end + + def test_non_ascii + xml = <<-XML + + + + child + + + XML + assert_equal(["child"], + matches(xml, "/root/non-scii/child")) + end + end + end +end diff --git a/jni/ruby/test/rexml/xpath/test_predicate.rb b/jni/ruby/test/rexml/xpath/test_predicate.rb new file mode 100644 index 0000000..287e131 --- /dev/null +++ b/jni/ruby/test/rexml/xpath/test_predicate.rb @@ -0,0 +1,82 @@ +require "test/unit/testcase" +require "rexml/document" +require "rexml/xpath" +require "rexml/parsers/xpathparser" + +module REXMLTests + class TestXPathPredicate < Test::Unit::TestCase + include REXML + SRC=<<-EOL +
+
+ free flowing text. +
+
+
+ free flowing text. +
+
+ free flowing text. +
+
+
+ EOL + + def setup + @doc = REXML::Document.new( SRC ) + @parser = REXML::Parsers::XPathParser.new + + end + + def test_predicates_parent + path = '//section[../self::section[@role="division"]]' + m = do_path( path ) + assert_equal( 2, m.size ) + assert_equal( "2", m[0].attributes["id"] ) + assert_nil( m[1].attributes["id"] ) + end + + def test_predicates_single + path = '//section[@role="subdivision" and not(../self::section[@role="division"])]' + m = do_path( path ) + assert_equal( 1, m.size ) + assert_equal( "1", m[0].attributes["id"] ) + end + + def test_predicates_multi + path = '//section[@role="subdivision"][not(../self::section[@role="division"])]' + m = do_path( path ) + assert_equal( 1, m.size ) + assert_equal( "1", m[0].attributes["id"] ) + end + + def do_path( path ) + m = REXML::XPath.match( @doc, path ) + #puts path, @parser.parse( path ).inspect + return m + end + + def test_get_no_siblings_terminal_nodes + source = <<-XML + + TEXT1 + + + + TEXT2 + + + +XML + doc = REXML::Document.new(source) + predicate = "count(child::node()|" + + "following-sibling::node()|" + + "preceding-sibling::node())=0" + m = REXML::XPath.match(doc, "/descendant-or-self::node()[#{predicate}]") + assert_equal( [REXML::Text.new("TEXT1"), + REXML::Text.new("TEXT2"), + REXML::Comment.new("COMMENT")], + m ) + end + end +end diff --git a/jni/ruby/test/rexml/xpath/test_text.rb b/jni/ruby/test/rexml/xpath/test_text.rb new file mode 100644 index 0000000..46aba3c --- /dev/null +++ b/jni/ruby/test/rexml/xpath/test_text.rb @@ -0,0 +1,74 @@ +require 'test/unit' +require 'rexml/document' +require 'rexml/element' +require 'rexml/xpath' + +module REXMLTests + class TestXPathText < Test::Unit::TestCase + def setup + @doc = REXML::Document.new + end + + def tear_down + end + + def test_text_as_element + node1 = REXML::Element.new('a', @doc) + node2 = REXML::Element.new('b', node1) + REXML::Text.new('test', false, node2) + assert_equal(1, @doc.elements.size, "doc owns 1 element node1") + assert_same(node1, @doc.elements[1], "doc owns 1 element node1") + assert_equal(1, node1.elements.size, "node1 owns 1 element node2") + assert_same(node2, node1.elements[1], "node1 owns 1 element node2") + assert_equal(1, node2.size, "node2 owns 1 text element") + end + + def test_text_in_xpath_query + node1 = REXML::Element.new('a', @doc) + node2 = REXML::Element.new('b', node1) + textnode = REXML::Text.new('test', false, node2) + textnode.parent = node2 # should be unnecessary + nodes = @doc.get_elements('//b') + assert_equal(1, nodes.size, "document has one element") + # why doesn't this query work right? + nodes = REXML::XPath.match(@doc, '//text()') + assert_equal(1, nodes.size, "//text() should yield one Text element") + assert_equal(REXML::Text, nodes[0].class) + end + + def test_comment_in_xpath_query + node1 = REXML::Element.new('a', @doc) + node2 = REXML::Element.new('b', node1) + commentnode = REXML::Comment.new('test', node2) + nodes = REXML::XPath.match(@doc, '//comment()') + assert_equal(1, nodes.size, "//comment() should yield one Comment element") + assert_same commentnode, nodes[0] + end + + def test_parentage + node1 = REXML::Element.new('a', @doc) + assert_same(@doc, node1.parent, "node1 parent is document") + node2 = REXML::Element.new('b', node1) + assert_same(node1, node2.parent, "node2 parent is node1") + textnode = REXML::Text.new('test', false, node2) + # why isn't the text's parent node2? + # Also look at Comment, etc. + assert_same(node2, textnode.parent) + comment = REXML::Comment.new('Test comment', node2) + assert_same(node2, comment.parent) + end + + def test_ancestors + node1 = REXML::Element.new('a', @doc) + node2 = REXML::Element.new('b', node1) + textnode = REXML::Text.new('test', false, node2) + #textnode.parent = node2 # should be unnecessary + assert_same node2, textnode.parent + nodes = @doc.get_elements('//b/ancestor::*') + assert_equal(1, nodes.size, " has one element ancestor") + nodes = @doc.get_elements('//b/ancestor::node()') + assert_equal(2, nodes.size, " has two node ancestors") + assert nodes[1].kind_of?(REXML::Document) + end + end +end -- cgit v1.2.3-70-g09d2