This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[docbook-apps] Re: Proposals to improve xalan extension: com.nwalsh.xalan.Text


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

/ Alexander Karnstedt <alexander_berlin@gmx.de> was heard to say:
| I find the ability to reference external text data really useful. But
| I had to struggle with some problems according the appropriate
| extension class ?»com.nwalsh.xalan.Text?« to get it to work for
| me. So here are my experiences:
|
| First, returning a NodeSet object (of TextNodes) gives me an error
| from Xalans DTMManager (Data Type Mapping?). So I had to redesign the
| insertfile method to return a string object instead.

Sigh. They must have changed the API again. If you send along patches,
I'll be happy to incorporate them.

| Second: what is the base directory for relative paths in the
| texdata/fileref attribute? I think its simply taken from wherever you
| start Xalan. But this seems to be wrong - shouldn't the base
| (defaultly) be equal to that directory where the including document
| resides?

Yes. If you can get that from Xalan, that's what we should use.

| However, I've would propose to use the URIResolver object to resolve
| the full URL,

Indeed.

| in ?»com.nwalsh.xalan.Text?«, instead of:
|
|        fileURL = new URL(href);
|
| I used this:
|
|        this.href = getFilename(context, elem);
|        String base = context.getTransformer().getBaseURLOfSource();
|        javax.xml.transform.URIResolver resolver =
| context.getTransformer().getURIResolver();
|        javax.xml.transform.Source source =
| this.resolver.resolve(this.href, this.base);
|        this.hrefSystemID = source.getSystemId();
|        ....
|        fileURL = new URL(this.hrefSystemID);

Looks good to me.

                                        Be seeing you,
                                          norm

- -- 
Norman Walsh <ndw@nwalsh.com>      | We have fewer friends than we
http://www.oasis-open.org/docbook/ | imagine, but more than we
Chair, DocBook Technical Committee | know.--Hugo Von Hofmannsthal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQE/Ze0nOyltUcwYWjsRAkq/AKCYMGzipmByvL4pzCZCit9IO4wwZQCfQmwV
DpvCwxKlNr+Travu4nzM3aU=
=liGU
-----END PGP SIGNATURE-----

To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]