using Pollo with the latest MSV
"Gregory Davis" <[email protected]> Thu, 2 Oct 2003 21:41:44 -0700
| Newsgroups | gmane.editors.pollo.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
------=_NextPart_000_007C_01C3892D.F91B10A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hello,
I was having difficulty getting Pollo to operate with external XML Schemas,
whether locally defined, or preexisting.
For example, I could not load http://www.w3.org/2001/XMLSchema.xsd, using
itself as the schema, rather than the Pollo built-in (which does not support
validation). Also, my own schemas would not be parsed to make the tags
available for creating conforming XML files.
The version of msv.jar included with the Pollo distribution was not capable
of validating the XMLSchema.xsd, but the bugs have been corrected. The
nightly build is said to be stable. It worked for me.
There have been some changes to MSV. Attribute values are now returned as
integers and strings, where Pollo has assumed only strings.
In summary, I made 3 changes to Pollo that greatly increased usability for
my needs:
1) Built the latest nightly release of MSV, see
http://groups.yahoo.com/group/msv-interest/message/52 ,
and copy the 5 JAR files to ./src/lib directory of Pollo
2. Apply the patches to MsvSchema.java, as shown in the attached file.
Optionally, update
the pollo.sh to allow execution from any directory.
3. Re-build Pollo.
Test, by opening XMLSchema.xsd, using XMLSchema.xsd, and validating it.
Hope this is of use.
- Greg
------=_NextPart_000_007C_01C3892D.F91B10A0
Content-Type: text/plain;
name="pollo.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="pollo.txt"
------------------------------------------------------------------------
./src/org/outerj/pollo/xmleditor/schema/MsvSchema.java
186c186,191
< attrSchema.values =3D (String =
[])attrValues.toArray(new String [] {});
---
> {
> Iterator it =3D attrValues.iterator();
> attrSchema.values =3D new String [attrValues.size()];
> for (int index =3D 0; index < attrValues.size(); index++)
> attrSchema.values[index] =3D it.next().toString();
> }
204c209
< String value =3D (String)it.next();
---
> String value =3D it.next().toString();
------------------------------------------------------------------------
./bin/pollo.sh
SCRIPTDIR=3D`dirname $0`
DIR=3D`cd $SCRIPTDIR/..; pwd`
export =
CLASSPATH=3D$DIR/lib/pollo.jar:$DIR/lib/pollohelp.jar:$DIR/lib/endorsed/d=
om3-xercesImpl.jar:$DIR/lib/endorsed/dom3-xmlParserAPIs.jar:$DIR/lib/jhba=
sic.jar:$DIR/lib/commons-digester.jar:$DIR/lib/avalon-configuration.jar:$=
DIR/lib/commons-beanutils.jar:$DIR/lib/commons-collections.jar:$DIR/lib/l=
og4j-core.jar:$DIR/lib/jaxen-core.jar:$DIR/lib/jaxen-dom.jar:$DIR/lib/sax=
path.jar:$DIR/lib/msv.jar:$DIR/lib/xsdlib.jar:$DIR/lib/relaxngDatatype.ja=
r:$DIR/lib/isorelax.jar:$DIR/conf:$DIR/build
java -Djava.endorsed.dirs=3D$DIR/lib/endorsed org.outerj.pollo.Pollo $@
------=_NextPart_000_007C_01C3892D.F91B10A0--
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf