daisy/pipeline-modules-common

px:fileset-store: remove @xml:base from root elements before storing

Closed this issue · 4 comments

We use xml:base attributes as a hack to set the target of documents (or am I the only one?). But after the document has been stored the attribute has no use anymore.

@bertfrees yes I use this hack as well, but usually I remove the xml:base attribute right after I added it (the base URI won't be affected, as per the XProc spec), so I don't have it serialized.

I think px:fileset-store should not delete the attribute. If there is one, the author may want to explicitly serialize it.

What we should have however is a common utility to set a document's base and which would replace this hack wherever we use it. The implementation can wrap the new pxp:set-base-uri step provided by Calabash.

@bertfrees yes I use this hack as well, but usually I remove the xml:base attribute right after I added it (the base URI won't be affected, as per the XProc spec), so I don't have it serialized.

Aha! Didn't think of that.

What we should have however is a common utility to set a document's base and which would replace this hack wherever we use it. The implementation can wrap the new pxp:set-base-uri step provided by Calabash.

OK, sounds reasonable.

I usually leave the attribute in there all the way until I store the document, because there is/was a bug with the base URI being wrecked when running XSLTs.

Seems it might be fixed now, although I havent tested it:
https://lists.w3.org/Archives/Public/xproc-dev/2013Mar/0050.html

Closing without action.

We should make the pxi:set-base-uri step public so that we don't have to use the xml:base hack anymore. Created a new issue: #107.