Re: [xml] problem with Xinclude

On Mon, Apr 07, 2008 at 11:43:26PM +0400, ÐÐ wrote:
I'm using libxml2 (ver.2.6.31) under Linux (kernel 2.2.20).
Some problem with XInclude.
xmllint --xinclude maindoc.xml -> failed build URL...

1. If i remove blank between symbol "1" and  string "man" (<item name="1man">) at attribute section in both 
files then it works fine.

  See the XInclude spec describing the xinclude element is at
It is an URI Reference so spaces need to be percent escaped.
The problem is that the construct you are trying to use (the full xpointer
scheme never made it in the final standard) so this construct

  <xinclude:include href="doc.xml#xpointer(/doc/tasks/item[ name='1%20man']/coord)"/>

is in theory invalid in Xinclude, a separate xpointer attribute should be
used, but that allows only a very limited and near useless subset of what
XPointer was supposed to provide. Be concious it's a libxml2 specificity
not backed up by the standard.

2. Usually, i use koi8-r encoding. if use Cyrillics symbols here - xinclude dont work, no matter blank 
remove or not.  

At the same time, XPath works fine in any case (with Cyrillics and blanks).
Any solution?

  See URI escaping, you need to escape the character code point in an UTF-8
encoding using the %xx values.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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