Some Issues while testing

Glen Barnes <[email protected]> Thu, 17 Jul 2003 21:31:30 +0100
Newsgroups gmane.text.xml.o-xml
Message-ID <[email protected]>
Martin,

Here are a few things I came up with while testing the new version and 
trying a couple of things. See the attached files for examples of the 
issues:

1. Command line parameter passing.

How can i pass a parameter with the -D flag which contains spaces, line 
feeds, etc? The example run script just contains entries such as 
ANewEntry but I would like it to show 'A New Entry'

2. insertAfter throws error

The Node Manipulation function insertAfter throws the error:

Thu Jul 17 21:07:24 BST 2003 error: error in program: test1.oml
Thu Jul 17 21:07:24 BST 2003 error: no such function: 
Element.insertAfter(Nodeset)

See Line: <!-- <o:do 
select="$blog/blog/entries/entry.insertAfter($newEntry)"/> -->

3. append Node manipluation palces node in wrong place?

In the example I attached the following line <o:do 
select="$blog/blog/entries/entry.append($newEntry)"/> appends the new 
entry BETWEEN the first and third 'entry' nodes. Is this correct? I 
thought it would add it after the LAST 'entry' node.

4. Extra </entry> entry

Check in the test.out file. Note where it added the above new entry. 
You will see there is an extra '</entry>' added to the file.

5. Reading/Writing files

I really need to just manipulate an xml file on disk by updating the 
lastupdate node and adding a new blog entry. How can I do this? I would 
expect to be able to do something like:

- Open a file and assign a pointer to it to a variable
- Update the contents of the variable
- Save and close the file

Thats it for now. create the files just use run.sh. Also you can pass 
the -xsl paramater to run.sh and it will pick it up.

Thanks,
Glen
test.oml (application/octet-stream, 1.1 KB) - not displayed
test.out (application/octet-stream, 4 KB) - not displayed
test.sh (application/octet-stream, 291 B)
cp=obox.jar:xalan.jar:xml-apis.jar:xerces.jar:tagbox-utils.jar:xinclude.jar:jcup-rt.jar:jakarta-oro-2.0.7.jar

var="-DlastUpdate=1/1/1999 -DblogDate=1/1/2004 -DblogTitle=ANewBlog -DblogBody=thebody -DblogImageLink=imgage999.jpg"


java  -cp $cp org.oXML.engine.ObjectBox   test.oml $var $1
test.xml (application/octet-stream, 4.5 KB)
<?xml version="1.0"?>
		<blog>
			<info>
				<name>The travel Blog</name>
				<lastupdate>2/1/03</lastupdate>
			</info>

			<entries>
				<entry>
					<date>20/6/03</date>
					<title>Groove Armada</title>
					<body>The joys of a London summer...Groove Armada in the park on sunny afternoon.</body>
					<imagelink>image1.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 3</title>
					<body>With the FOS by. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 4</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 5</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 6</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 7</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 8</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 9</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 10</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
				<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 11</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 12</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 13</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 14</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 15</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 16</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 17</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 18</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 19</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 20</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 21</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
				<entry>
					<date>2/1/03</date>
					<title>The Sea 22</title>
					<body>With the FOS by the sea. A nice little day trip out to the coast.</body>
					<imagelink>image2.jpg</imagelink>
				</entry>
			</entries>
		</blog>
test.xsl (application/octet-stream, 1.3 KB) - not displayed