Re: [xml] Forcing the xml:base attribute for included files in the same directory




I have a question regarding the omission of the xml:base attribute when
including a file located in the same directory as the includer. I've
read, in an old newsgroup post, that this was done on purpose
when the xml:base support was implemented
(http://sources.redhat.com/ml/docbook/2003-03/msg00101.html)

Is there a workaround for this? In other words, is there
a way I could force the parser to add the xml:base attribute for all
inclusions, regardless of their directory?

I'm hoping to implement an error-reporting and coverage tool for
xml-embedded code, and using the xml:base attribute seems like the least
invasive way to locate a code snippet. (I'm using libxml 2.6.22 by the
way, but could consider an upgrade if essential. However, nothing in the
release notes indicated that this behavior had changed)  Of course, we
can always
move the files around so that includer files will always be in a
directory of their own. But I'd prefer a more elegant solution if possible.

As far as I know it's not that the xml:base is omitted, but that it is
not 'fixup'ed when including a file from the same directory. So one
solution might be to have a xml:base='<base-URI-of-this-file>' in
each include file.


BTW I know there have been some discussions about xml:base fixup
being required by the XInclude standard, but under Eclipse we use
Apache Xerces which has a feature to switch off 'fixup-base-uris'.
This allows us to use XInclude without going through updating each and
every Schema file. 
In order to use the same with xmllint we have patched libxml2 to
provide a --nofixup-base-uris option preventing xml:base fixup at all
(moreless the opposite of what Catherine wants), would there be any
interest in this patch?

Regards,
  Wieant



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]